Package jazzparser :: Package formalisms :: Package base :: Module syntax :: Class VariableSubstitution
[hide private]
[frames] | no frames]

Class VariableSubstitution

source code

object --+    
         |    
      dict --+
             |
            VariableSubstitution

A mapping from some sort of variable subject to unification that appears in categories. The types of variables included in the substitution are defined by variable substitutors. It is recommended that you subclass variable substitution to provide a type of substition suitable to a formalism.

Nested Classes [hide private]
  InvalidVariableTypeError
  VariableSubstitutionError
Instance Methods [hide private]
new empty dictionary

__init__(self, variable_types)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_is_inconsistent(self) source code
 
__getitem__(self, type)
x[y]
source code
 
__setitem__(self, type, assignment)
x[i]=y
source code
 
add_assignment(self, type, key, value)
Constrain the key to take a value that matches this one.
source code
 
add_equality(self, type, key, other_key)
Constrain the two keys to take the same value.
source code
 
get_assignment(self, type, key)
Returns the value that this key is constrained to match.
source code
 
get_equalities(self, type, key, pop=False)
Returns all the key that are constrained to be equal to this one.
source code
 
apply(self, category, make_copy=True)
Applies the variable substitution to the given category object.
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values, viewitems, viewkeys, viewvalues

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]
  inconsistent

Inherited from object: __class__

Method Details [hide private]

__init__(self, variable_types)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns:
new empty dictionary

Overrides: object.__init__
(inherited documentation)

__getitem__(self, type)
(Indexing operator)

source code 

x[y]

Overrides: dict.__getitem__
(inherited documentation)

__setitem__(self, type, assignment)
(Index assignment operator)

source code 

x[i]=y

Overrides: dict.__setitem__
(inherited documentation)

get_equalities(self, type, key, pop=False)

source code 

Returns all the key that are constrained to be equal to this one. Optionally remove this equivalence class in the process.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Property Details [hide private]

inconsistent

Get Method:
_is_inconsistent(self)