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

Class LogicalForm

source code

object --+
         |
        LogicalForm
Known Subclasses:

A semantic element, used to build the semantic interpretations returned by the parser. This class is effectively abstract. Most of its methods should be overridden.

Instance Methods [hide private]
 
__init__(self)
Builds a basic logical form object.
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
 
get_unbound_variables(self) source code
 
get_children(self)
This should be overridden by subclasses.
source code
 
get_instances(self, lf)
Returns all instances of logical forms equal to lf among this logical form and its descendents.
source code
 
alpha_equivalent(self, other, substitution)
This should be overridden by subclasses.
source code
 
__eq__(self, other)
This should be overridden by subclasses.
source code
 
__ne__(self, lf) source code
 
copy(self)
This should be overridden by subclasses.
source code
 
replace_in_parent(self, other)
Replaces references in this LF's parent to this LF with references to the LF other.
source code
 
get_ancestor_bound_variables(self)
Returns all the variables that are bound at some point higher up the structure and can therefore be used unbound within this element.
source code
 
__repr__(self)
repr(x)
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Builds a basic logical form object.

Overrides: object.__init__

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.

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.

get_instances(self, lf)

source code 

Returns all instances of logical forms equal to lf among this logical form and its descendents. This is particularly useful for getting all instances of a variable.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)