Package nltk :: Package sem :: Module logic :: Class NegatedExpression
[hide private]
[frames] | no frames]

type NegatedExpression

source code

         object --+        
                  |        
SubstituteBindingsI --+    
                      |    
             Expression --+
                          |
                         NegatedExpression
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, term) source code
 
_set_type(self, other_type=?, signature=None)
@see Expression._set_type()
source code
 
findtype(self, variable)
Find the type of the given variable as it is used in this expression.
source code
 
visit(self, function, combinator, default)
Recursively visit sub expressions
source code
 
negate(self)
If this is a negated expression, remove the negation.
source code
 
__eq__(self, other) source code
 
__str__(self) source code
 
str(self, syntax=Tokens.NLTK)

Inherited from Expression: __and__, __call__, __gt__, __hash__, __lt__, __neg__, __neq__, __or__, __repr__, applyto, equiv, free, make_VariableExpression, normalize, replace, simplify, substitute_bindings, tp_equals, typecheck, variables

Properties [hide private]
  type
Method Details [hide private]

__init__(self, term)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

_set_type(self, other_type=?, signature=None)

source code 

@see Expression._set_type()

Parameters:
  • other_type - Type to set
  • signature - dict<str, list<AbstractVariableExpression>> store all variable expressions with a given name
Overrides: Expression._set_type

findtype(self, variable)

source code 

Find the type of the given variable as it is used in this expression. For example, finding the type of "P" in "P(x) & Q(x,y)" yields "<e,t>"

Parameters:
  • variable - Variable
Overrides: Expression.findtype
(inherited documentation)

visit(self, function, combinator, default)

source code 

Recursively visit sub expressions

Parameters:
  • function - Function to call on each sub expression
  • combinator - Function to combine the results of the function calls
Returns:
result of combination
Overrides: Expression.visit

See Also: Expression.visit()

negate(self)

source code 

If this is a negated expression, remove the negation. Otherwise add a negation.

Overrides: Expression.negate

See Also: Expression.negate()

__eq__(self, other)
(Equality operator)

source code 
Overrides: Expression.__eq__

__str__(self)
(Informal representation operator)

source code 
Overrides: Expression.__str__

Property Details [hide private]

type