-
Notifications
You must be signed in to change notification settings - Fork 34
Constructing Flattened Transitions
This algorithm constructs a flattened transition from a state or junction to a state or junction.
-
A state or junction soj1 representing the source of the transition in the hierarchical state machine.
-
A state or junction soj2 representing the destination of the transition in the hierarchical state machine.
-
A list A of actions specified in the source model.
-
A state or junction transition that goes to a leaf state or junction and that records all actions specified in the source model together with all entry actions, exit actions, and initial transition actions implied by the hierarchical structure.
-
Let sd1 be the state definition where soj1 is defined. Let sd2 be the state definition where soj2 is defined.
-
Compute the state definition sd which is the lowest common ancestor of sd1 and sd2 in the AST.
-
Let A' be the list of exit actions, in order, seen when passing from sd1 to sd.
-
Let A'' be the list of entry actions, in order, seen when passing from sd to sd2.
-
If sd2 is a leaf state or junction, then let soj2' be soj2, and let A''' be the empty list of actions.
-
Otherwise
-
Let soj2' be the unique leaf state reachable from soj2 by following a chain of initial transition specifiers.
-
Let A''' be the list of do actions and entry actions seen when following the chain, in the order they are seen.
-
-
Return the state transition from soj1 to soj2' whose actions are the concatenation of A', A, A'', and A'''.