Skip to content

Constructing Flattened Transitions

Rob Bocchino edited this page Nov 4, 2024 · 25 revisions

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

Input

  1. The current state machine analysis data structure sma.

  2. A state or choice soc1 representing the source of the transition in the hierarchical state machine.

  3. A transition t.

Output

  1. A transition that records all actions specified in the source model together with all entry and exit actions implied by the state machine hierarchy.

Procedure

  1. If t is an internal transition, then return t.

  2. Otherwise

    1. Let A be the actions of t, and let soc2 be the target of t.

    2. If soc1 is a state definition sd or is a choice defined in a state definition sd, then let L2 be the list of state definitions in the state hierarchy in sma from the top level to sd, including sd, highest first. Otherwise let L1 be the empty list.

    3. If soc2 is a state definition or a choice defined in a state definition sd, then let L2 be the list of state definitions in the state hierarchy in sma from the top level to sd, including sd, highest first. Otherwise let L2 be the empty list.

    4. For each i in [1,2], let L'i be Li with the longest common prefix of L1 and L2 deleted.

    5. 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.

    6. Let A2 be the concatenation of the entry action lists of the elements of L'2.

    7. Return the external transition whose actions are the concatenation of A1, A, and A2, and whose target is soc2.

Clone this wiki locally