Package jazzparser :: Package formalisms :: Package base :: Package semantics :: Module lambdacalc :: Class Variable
[hide private]
[frames] | no frames]

Class Variable

source code

 object --+    
          |    
LogicalForm --+
              |
             Variable
Known Subclasses:

A variable in a semantic expression.

Instance Methods [hide private]
 
__init__(self, name, index=0)
Creates a new variable object, representing the variable given by name.
source code
 
copy(self)
This should be overridden by subclasses.
source code
 
get_variable_name(self) source code
 
alpha_convert(self, source_var, target_var)
This should be overridden by subclasses.
source code
 
beta_reduce(self, *args, **kwargs)
This should be overridden by subclasses.
source code
 
substitute(self, source_variable, target_expression)
This should be overridden by subclasses.
source code
 
replace_immediate_constituent(self, old_lf, new_lf)
This should be overridden by subclasses.
source code
 
get_variables(self)
This should be overridden by subclasses.
source code
 
get_bound_variables(self)
This should be overridden by subclasses.
source code
 
__eq__(self, lf)
For the time being, two variables are considered equal if they have the same name.
source code
 
alpha_equivalent(self, other, substitution)
Checks whether self is equal to a LF that can be derived by some variable substitution S into other, where S contains the substitution T given by "substitution".
source code
 
__str__(self)
str(x)
source code
 
to_latex(self) source code
 
get_children(self)
This should be overridden by subclasses.
source code
 
get_sibling_variables(self)
Returns a list of all the instances of Variable within the logical form that represent the same variable.
source code
 
__hash__(self)
hash(x)
source code

Inherited from LogicalForm: __ne__, __repr__, get_ancestor_bound_variables, get_instances, get_unbound_variables, replace_in_parent

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, index=0)
(Constructor)

source code 

Creates a new variable object, representing the variable given by name.

Overrides: object.__init__

copy(self)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.copy
(inherited documentation)

alpha_convert(self, source_var, target_var)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.alpha_convert
(inherited documentation)

beta_reduce(self, *args, **kwargs)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.beta_reduce
(inherited documentation)

substitute(self, source_variable, target_expression)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.substitute
(inherited documentation)

replace_immediate_constituent(self, old_lf, new_lf)

source code 

This should be overridden by subclasses. It should replace the LogicalForm old_lf with new_lf if it appears as an immediate constituent of this LogicalForm.

Overrides: LogicalForm.replace_immediate_constituent
(inherited documentation)

get_variables(self)

source code 

This should be overridden by subclasses.

This method returns a list of all the variables used in this LF. This includes bound and unbound variables. (Only unbound variables need to be alpha-converted to avoid accidental binding, but we will convert bound variables too for readability.)

Note that this only contains one instance of each variable, not every occurrence.

Overrides: LogicalForm.get_variables
(inherited documentation)

get_bound_variables(self)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.get_bound_variables
(inherited documentation)

__eq__(self, lf)
(Equality operator)

source code 

For the time being, two variables are considered equal if they have the same name. We could use some more elaborate internal representation if this turns out to be a problem, but if alpha conversion is carried out when it should be this method ought to be ok.

Overrides: LogicalForm.__eq__

alpha_equivalent(self, other, substitution)

source code 

Checks whether self is equal to a LF that can be derived by some variable substitution S into other, where S contains the substitution T given by "substitution".

Overrides: LogicalForm.alpha_equivalent

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

get_children(self)

source code 

This should be overridden by subclasses.

Overrides: LogicalForm.get_children
(inherited documentation)

get_sibling_variables(self)

source code 

Returns a list of all the instances of Variable within the logical form that represent the same variable.

If it's a free variable, returns all other occurrences within the logical form. If it's bound, returns all other variables bound by the same abstraction.

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)