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

Class NegatedExpression

source code

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

Instance Methods [hide private]
 
__init__(self, term)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
simplify(self) source code
 
replace(self, variable, expression, replace_bound=False)
Replace every instance of 'variable' with 'expression'
source code
 
variables(self)
Return a set of all the variables that are available to be replaced.
source code
 
free(self, indvar_only=True)
Return a set of all the free (non-bound) variables in self.
source code
 
__eq__(self, other) source code
 
str(self, syntax=1) source code

Inherited from Expression: __and__, __call__, __gt__, __hash__, __lt__, __neg__, __or__, __repr__, __str__, applyto, negate, substitute_bindings, tp_equals

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, term)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

replace(self, variable, expression, replace_bound=False)

source code 

Replace every instance of 'variable' with 'expression'

Parameters:
  • variable - Variable The variable to replace
  • expression - Expression The expression with which to replace it
  • replace_bound - boolean Should bound variables be replaced?

variables(self)

source code 

Return a set of all the variables that are available to be replaced. This includes free (non-bound) variables as well as predicates.

Returns:
set of Variables
Overrides: Expression.variables

See Also: Expression.variables()

free(self, indvar_only=True)

source code 

Return a set of all the free (non-bound) variables in self. Variables serving as predicates are no included.

Parameters:
  • indvar_only - boolean only return individual variables?
Returns:
set of Variables
Overrides: Expression.free

See Also: Expression.free()

__eq__(self, other)
(Equality operator)

source code 
Overrides: Expression.__eq__