Package pyxb :: Package utils :: Module fac :: Class Configuration
[hide private]
[frames] | no frames]

Class Configuration

source code

       object --+    
                |    
Configuration_ABC --+
                    |
                   Configuration

The state of an Automaton in execution.

This combines a state node of the automaton with a set of counter values.

Instance Methods [hide private]
 
__get_state(self)
The state of the configuration.
source code
 
_set_state(self, state, is_layer_change)
Internal state transition interface.
source code
 
_get_counterValues(self) source code
 
__get_automaton(self) source code
 
__get_subConfiguration(self)
Reference to configuration being executed in a sub-automaton.
source code
 
__get_superConfiguration(self)
Reference to the configuration for which this is a sub-configuration.
source code
 
__get_subAutomata(self)
A set of automata that must be satisfied before the current state can complete.
source code
 
_set_subAutomata(self, automata) source code
 
makeLeaveAutomatonTransition(self)
Create a transition back to the containing configuration.
source code
 
leaveAutomaton(self, sub_configuration)
Execute steps to leave a sub-automaton.
source code
 
enterAutomaton(self, automaton)
Execute steps to enter a new automaton.
source code
 
satisfies(self, transition) source code
 
reset(self) source code
 
candidateTransitions(self, symbol=None)
Return list of viable transitions on symbol
source code
 
acceptableSymbols(self)
Return the acceptable Symbols given the current configuration.
source code
 
step(self, symbol)
Execute an automaton transition using the given symbol.
source code
 
isInitial(self)
Return True iff no transitions have ever been made.
source code
 
isAccepting(self)
Return True iff the automaton is in an accepting state.
source code
 
__init__(self, automaton, super_configuration=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
clone(self, clone_map=None)
Clone a configuration and its descendents.
source code
 
_clone(self, clone_map, super_configuration) source code
 
__str__(self)
str(x)
source code

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

Class Variables [hide private]
  __state = None
hash(x)
  __counterValues = None
The values of the counters.
  __automaton = None
hash(x)
  __subConfiguration = None
hash(x)
  __superConfiguration = None
hash(x)
  __subAutomata = None
hash(x)
Properties [hide private]
  state
The state of the configuration.
  automaton
  subConfiguration
Reference to configuration being executed in a sub-automaton.
  superConfiguration
Reference to the configuration for which this is a sub-configuration.
  subAutomata
A set of automata that must be satisfied before the current state can complete.

Inherited from object: __class__

Method Details [hide private]

__get_state(self)

source code 

The state of the configuration.

This is None to indicate an initial state, or one of the underlying automaton's states.

_set_state(self, state, is_layer_change)

source code 

Internal state transition interface.

Parameters:
  • state - the new destination state
  • is_layer_change - True iff the transition inducing the state change involves a layer change.

__get_subConfiguration(self)

source code 

Reference to configuration being executed in a sub-automaton.

None if no sub-automaton is active, else a reference to a configuration that is being executed in a sub-automaton.

Sub-configurations are used to match sub-terms in an unordered catenation term. A configuration may have at most one sub-configuration at a time, and the configuration will be removed and possibly replaced when the term being processed completes.

__get_superConfiguration(self)

source code 

Reference to the configuration for which this is a sub-configuration.

None if no super-automaton is active, else a reference to a configuration that is being executed in a super-automaton.

The super-configuration relation persists for the lifetime of the configuration.

__get_subAutomata(self)

source code 

A set of automata that must be satisfied before the current state can complete.

This is used in unordered catenation. Each sub-automaton represents a term in the catenation. When the configuration enters a state with sub-automata, a set containing references to those automata is assigned to this attribute. Subsequently, until all automata in the state are satisfied, transitions can only occur within an active sub-automaton, out of the active sub-automaton if it is in an accepting state, and into a new sub-automaton if no sub-automaton is active.

makeLeaveAutomatonTransition(self)

source code 

Create a transition back to the containing configuration.

This is done when a configuration is in an accepting state and there are candidate transitions to other states that must be considered. The transition does not consume a symbol.

leaveAutomaton(self, sub_configuration)

source code 

Execute steps to leave a sub-automaton.

Parameters:
  • sub_configuration - The configuration associated with the automata that has completed.
Returns:
self

enterAutomaton(self, automaton)

source code 

Execute steps to enter a new automaton.

The new automaton is removed from the set of remaining automata for the current state, and a new configuration created. No transition is made in that new configuration.

Parameters:
  • automaton - The automaton to be entered
Returns:
The configuration that executes the new automaton as a sub-configuration of self.

candidateTransitions(self, symbol=None)

source code 

Return list of viable transitions on symbol

The transitions that are structurally permitted from this state, in order, filtering out those transitions where the update instruction is not satisfied by the configuration counter values and optionally those for which the symbol does not match.

Parameters:
  • symbol - A symbol through which a transition from this state is intended. A value of None indicates that the set of transitions should ignore the symbol; candidates are still filtered based on the counter state of the configuration.
Returns:
A list of Transition instances permitted from the current configuration. If symbol is not None, transitions that would not accept the symbol are excluded. Any transition that would require an unsatisfied counter update is also excluded. Non-deterministic automata may result in a lits with multiple members.

acceptableSymbols(self)

source code 

Return the acceptable Symbols given the current configuration.

This method extracts the symbol from all candidate transitions that are permitted based on the current counter values. Because transitions are presented in a preferred order, the symbols are as well.

Overrides: Configuration_ABC.acceptableSymbols
(inherited documentation)

step(self, symbol)

source code 

Execute an automaton transition using the given symbol.

Parameters:
Returns:
The new configuration resulting from the step.
Raises:
Overrides: Configuration_ABC.step
(inherited documentation)

__init__(self, automaton, super_configuration=None)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

clone(self, clone_map=None)

source code 

Clone a configuration and its descendents.

This is used for parallel execution where a configuration has multiple candidate transitions and must follow all of them. It clones the entire chain of configurations through multiple layers.

Parameters:
  • clone_map - Optional map into which the translation from the original configuration object to the corresponding cloned configuration object can be reconstructed, e.g. when applying a transition that includes automata exits referencing superconfigurations from the original configuration.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details [hide private]

__counterValues

The values of the counters.

This is a map from the CounterCondition instances of the underlying automaton to integer values.

Value:
None

Property Details [hide private]

state

The state of the configuration.

This is None to indicate an initial state, or one of the underlying automaton's states.

Get Method:
__get_state(self) - The state of the configuration.

automaton

Get Method:
__get_automaton(self)

subConfiguration

Reference to configuration being executed in a sub-automaton.

None if no sub-automaton is active, else a reference to a configuration that is being executed in a sub-automaton.

Sub-configurations are used to match sub-terms in an unordered catenation term. A configuration may have at most one sub-configuration at a time, and the configuration will be removed and possibly replaced when the term being processed completes.

Get Method:
__get_subConfiguration(self) - Reference to configuration being executed in a sub-automaton.

superConfiguration

Reference to the configuration for which this is a sub-configuration.

None if no super-automaton is active, else a reference to a configuration that is being executed in a super-automaton.

The super-configuration relation persists for the lifetime of the configuration.

Get Method:
__get_superConfiguration(self) - Reference to the configuration for which this is a sub-configuration.

subAutomata

A set of automata that must be satisfied before the current state can complete.

This is used in unordered catenation. Each sub-automaton represents a term in the catenation. When the configuration enters a state with sub-automata, a set containing references to those automata is assigned to this attribute. Subsequently, until all automata in the state are satisfied, transitions can only occur within an active sub-automaton, out of the active sub-automaton if it is in an accepting state, and into a new sub-automaton if no sub-automaton is active.

Get Method:
__get_subAutomata(self) - A set of automata that must be satisfied before the current state can complete.