Package sage :: Package calculus :: Module equations :: Class GenericDeclaration
[hide private]
[frames] | no frames]

Class GenericDeclaration

source code

                      object --+    
                               |    
structure.sage_object.SageObject --+
                                   |
                                  GenericDeclaration

Instance Methods [hide private]
 
__init__(self, var, assumption)
This class represents generic assumptions, such as a variable being an integer or a function being increasing.
source code
 
__repr__(self)
EXAMPLES:...
source code
 
__cmp__(self, other)
TESTS:...
source code
 
assume(self)
TEST:...
source code
 
forget(self)
TEST:...
source code

Inherited from structure.sage_object.SageObject: __hash__, __new__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, var, assumption)
(Constructor)

source code 

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]

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

EXAMPLES:
    sage: from sage.calculus.equations import GenericDeclaration
    sage: GenericDeclaration(x, 'foo')
    x is foo

Overrides: structure.sage_object.SageObject.__repr__

__cmp__(self, other)
(Comparison operator)

source code 

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

assume(self)

source code 

TEST:
    sage: from sage.calculus.equations import GenericDeclaration
    sage: decl = GenericDeclaration(x, 'even')
    sage: decl.assume()
    sage: cos(x*pi)
    1
    sage: decl.forget()

forget(self)

source code 

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)