Package nltk_lite :: Package semantics :: Module logic :: Class VariableBinderExpression
[hide private]
[frames] | no frames]

Class VariableBinderExpression

source code

Expression --+
             |
            VariableBinderExpression
Known Subclasses:
AllExpression, LambdaExpression, SomeExpression

A variable binding expression: e.g. \x.M.

Instance Methods [hide private]
 
__init__(self, variable, term) source code
 
equals(self, other)
Defines equality modulo alphabetic variance.
source code
 
_relabel(self, other)
Relabel other's bound variables to be the same as self's variable.
source code
 
variables(self)
Set of all variables.
source code
 
free(self)
Set of free variables.
source code
 
subterms(self)
Set of all subterms (including self).
source code
 
replace(self, variable, expression)
Replace all instances of variable v with expression E in self, where v is free in self.
source code
 
alpha_convert(self, newvar)
Rename all occurrences of the variable introduced by this variable binder in the expression to @newvar.
source code
 
simplify(self)
Evaluate the form by repeatedly applying applications.
source code
 
infixify(self) source code
 
__str__(self, continuation=0) source code
 
__hash__(self) source code

Inherited from Expression: __eq__, __ne__, __repr__, skolemise

Inherited from Expression (private): _skolemise

Class Variables [hide private]
  _counter = Counter()
Method Details [hide private]

__init__(self, variable, term)
(Constructor)

source code 
Overrides: Expression.__init__

equals(self, other)

source code 

Defines equality modulo alphabetic variance.

If we are comparing \x.M and \y.N, then check equality of M and N[x/y].

Overrides: Expression.equals

variables(self)

source code 

Set of all variables.

Overrides: Expression.variables
(inherited documentation)

free(self)

source code 

Set of free variables.

Overrides: Expression.free
(inherited documentation)

subterms(self)

source code 

Set of all subterms (including self).

Overrides: Expression.subterms
(inherited documentation)

replace(self, variable, expression)

source code 

Replace all instances of variable v with expression E in self, where v is free in self.

Overrides: Expression.replace
(inherited documentation)

simplify(self)

source code 

Evaluate the form by repeatedly applying applications.

Overrides: Expression.simplify
(inherited documentation)

__str__(self, continuation=0)
(Informal representation operator)

source code 
Overrides: Expression.__str__

__hash__(self)
(Hashing function)

source code 
Overrides: Expression.__hash__