| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
structure.sage_object.SageObject --+
|
GenericDeclaration
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
This class represents generic assumptions, such as a variable being
an integer or a function being increasing. It passes such information
to maxima's declare (wrapped in a context so it is able to forget).
INPUT:
var -- the variable about which assumptions are being made
assumption -- a maxima feature, either user defined or in the list
given by maxima('features')
EXAMPLES:
sage: from sage.calculus.equations import GenericDeclaration
sage: decl = GenericDeclaration(x, 'integer')
sage: decl.assume()
sage: sin(x*pi)
0
sage: decl.forget()
sage: sin(x*pi)
sin(pi*x)
Here is the list of acceptable features:
sage: maxima('features')
[integer,noninteger,even,odd,rational,irrational,real,imaginary,complex,analytic,increasing,decreasing,oddfun,evenfun,posfun,commutative,lassociative,rassociative,symmetric,antisymmetric,integervalued]
|
EXAMPLES:
sage: from sage.calculus.equations import GenericDeclaration
sage: GenericDeclaration(x, 'foo')
x is foo
|
TESTS:
sage: from sage.calculus.equations import GenericDeclaration as GDecl
sage: var('y')
y
sage: GDecl(x, 'integer') == GDecl(x, 'integer')
True
sage: GDecl(x, 'integer') == GDecl(x, 'rational')
False
sage: GDecl(x, 'integer') == GDecl(y, 'integer')
False
|
TEST:
sage: from sage.calculus.equations import GenericDeclaration
sage: decl = GenericDeclaration(x, 'even')
sage: decl.assume()
sage: cos(x*pi)
1
sage: decl.forget()
|
TEST:
sage: from sage.calculus.equations import GenericDeclaration
sage: decl = GenericDeclaration(x, 'odd')
sage: decl.assume()
sage: cos(x*pi)
-1
sage: decl.forget()
sage: cos(x*pi)
cos(pi*x)
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:31 2008 | http://epydoc.sourceforge.net |