-
Notifications
You must be signed in to change notification settings - Fork 34
Constructing Flattened Transitions
This algorithm constructs a flattened transition to a state or junction.
-
The current state machine analysis data structure sma.
-
A state or junction soj1 representing the source of the transition in the hierarchical state machine.
-
A transition t.
-
A transition that records all actions specified in the source model together with all entry and exit actions implied by the state machine hierarchy.
-
If t is an internal transition, then return t.
-
Otherwise
-
Let A be the actions of t, and let soj2 be the target of t.
-
For each i in [1,2]
-
If soji is a state definition sd or is a junction defined in a state definition sd, then let Li be the list of state definitions in the state hierarchy in sma from the top level to sd, including sd, highest first.
-
Otherwise let Li be the empty list.
-
-
Let P be the common prefix of L1 and L2.
-
If (i) soj1 and soj2 are states and (ii) P is nonempty and (iii) L1 = P or L2 = P (or both), then t represents a self transition, and the last element sd of P is the outer state definition. Remove sd from P so that we exit and reenter sd.
-
For each i in [1,2], let L'i be Li with the prefix P removed.
-
Let L''1 be the reverse of L'1. Let A1 be the concatenation of the exit action lists of the elements of L''1.
-
Let A2 be the concatenation of the entry action lists of the elements of L'2.
-
Return the external transition whose actions are the concatenation of A1, A, and A2, and whose target is soj2.
-