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

Class Transition

source code

object --+
         |
        Transition

Representation of a FAC state transition.

Instance Methods [hide private]
 
__get_destination(self)
The transition destination state.
source code
 
__get_updateInstructions(self)
The set of counter updates that are applied when the transition is taken.
source code
 
__get_nextTransition(self)
The next transition to apply in this chain.
source code
 
__get_layerLink(self)
A directive relating to changing automaton layer on transition.
source code
 
__init__(self, destination, update_instructions, layer_link=None)
Create a transition to a state.
source code
 
consumingState(self)
Return the state in this transition chain that must match a symbol.
source code
 
consumedSymbol(self)
Return the symbol of the consumingState.
source code
 
satisfiedBy(self, configuration)
Check the transition update instructions against configuration counter values.
source code
 
apply(self, configuration, clone_map=None)
Apply the transitition to a configuration.
source code
 
chainTo(self, next_transition)
Duplicate the state and chain the duplicate to a successor transition.
source code
 
makeEnterAutomatonTransition(self)
Replicate the transition as a layer link into its automaton.
source code
 
__hash__(self)
hash(x)
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__str__(self)
str(x)
source code

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

Class Variables [hide private]
  __destination = None
hash(x)
  __updateInstructions = None
hash(x)
  __nextTransition = None
hash(x)
  __layerLink = None
hash(x)
Properties [hide private]
  destination
The transition destination state.
  updateInstructions
The set of counter updates that are applied when the transition is taken.
  nextTransition
The next transition to apply in this chain.
  layerLink
A directive relating to changing automaton layer on transition.

Inherited from object: __class__

Method Details [hide private]

__get_nextTransition(self)

source code 

The next transition to apply in this chain.

None if this is the last transition in the chain.

__get_layerLink(self)

source code 

A directive relating to changing automaton layer on transition.

None indicates this transition is from one state to another within a single automaton.

An instance of Configuration is a transition on completion of a subautomaton back to the configuration in the parent automaton. The destination is the state in the parent automaton.

An instance of Automaton requires creation of a sub-configuration and initial entry into the automaton. The destination is the state in the sub-automaton.

__init__(self, destination, update_instructions, layer_link=None)
(Constructor)

source code 

Create a transition to a state.

Parameters:
  • destination - the state into which the transition is made
  • update_instructions - A iterable of UpdateInstructions denoting the changes that must be made to counters as a consequence of taking the transition.
  • layer_link - The value for layerLink.
Overrides: object.__init__

satisfiedBy(self, configuration)

source code 

Check the transition update instructions against configuration counter values.

This implementation follows layer changes, updating the configuration used as counter value source as necessary.

Parameters:
  • configuration - A Configuration instance containing counter data against which update instruction satisfaction is checked.
Returns:
True iff all update instructions along the transition chain are satisfied by their relevant configuration.

apply(self, configuration, clone_map=None)

source code 

Apply the transitition to a configuration.

This updates the configuration counter values based on the update instructions, and sets the new configuration state.

Parameters:
  • configuration - A Configuration of an executing automaton
  • clone_map - A map from Configuration to Configuration reflecting the replacements made when the configuration for which the transition was calculated was subsequently cloned into the configuration passed into this method. This is only necessary when the transition includes layer transitions.
Returns:
The resulting configuration

Note: If the transition involves leaving a sub-automaton or creating a new sub-automaton, the returned configuration structure will be different from the one passed in. You should invoke this as:

 cfg = transition.apply(cfg)

chainTo(self, next_transition)

source code 

Duplicate the state and chain the duplicate to a successor transition.

This returns a new transition which applies the operation for this transition, then proceeds to apply the next transition in the chain.

Parameters:
  • next_transition - A Transition node describing a subsequent transition.
Returns:
a clone of this node, augmented with a link to next_transition.

Note: The node that is invoking this must not have successor transitions.

makeEnterAutomatonTransition(self)

source code 

Replicate the transition as a layer link into its automaton.

This is used on initial transitions into sub-automata where a sub-configuration must be created and recorded.

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

destination

The transition destination state.

Get Method:
__get_destination(self) - The transition destination state.

updateInstructions

The set of counter updates that are applied when the transition is taken.

Get Method:
__get_updateInstructions(self) - The set of counter updates that are applied when the transition is taken.

nextTransition

The next transition to apply in this chain.

None if this is the last transition in the chain.

Get Method:
__get_nextTransition(self) - The next transition to apply in this chain.

layerLink

A directive relating to changing automaton layer on transition.

None indicates this transition is from one state to another within a single automaton.

An instance of Configuration is a transition on completion of a subautomaton back to the configuration in the parent automaton. The destination is the state in the parent automaton.

An instance of Automaton requires creation of a sub-configuration and initial entry into the automaton. The destination is the state in the sub-automaton.

Get Method:
__get_layerLink(self) - A directive relating to changing automaton layer on transition.