Skip to content

Constructing Flattened Transitions

Rob Bocchino edited this page Sep 12, 2024 · 25 revisions

This algorithm constructs a flattened transition to a state or junction.

Input

  1. A state or junction soj1 representing the source of the transition in the hierarchical state machine.

  2. A transition t with actions A and destination soj2.

Output

  1. An external transition that records all actions specified in the source model together with all entry and exit actions implied by the hierarchical structure.

Procedure

  1. If soj1 is a state definition, then let sd1 be that state definition. Otherwise let sd1 be the state definition where soj1 is defined.

  2. Let sd2 be the state definition where soj2 is defined.

  3. Compute the definition d which is the lowest common ancestor of sd1 and sd2 in the AST. This is either a state definition or a state machine definition.

  4. Let L' be the list of state definitions in the state hierarchy connecting sd1 to d, not including d, lowest first. Let A' be the concatenation of the exit action lists of the elements of L'.

  5. Let L'' be the list of state definitions in the state hierarchy connecting d to sd2, not including d, highest first. Let A'' be the concatenation of the entry action lists of the elements of L''.

  6. Return the transition whose actions are the concatenation of A', A, and A'', and whose destination is soj2.

Clone this wiki locally