Skip to content

Check Initial Transitions

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

This algorithm traverses a state machine definition and checks the initial transition specifiers.

Input

  1. A state machine definition smd.

  2. A state machine analysis data structure sma representing the results of analysis so far.

Output

  1. sma if the check passes; otherwise an error.

Procedure

If smd has state machine members, then

  1. Check that smd has exactly one initial transition specifier in its members.

  2. Visit each of the state machine members smm of smd as specified below.

Visiting State Machine Members

Visit a state machine member smm as follows:

  1. If smm is an initial transition specifier s, then check that the state definition or choice definition referred to in the enter expression of s leads to a member of the enclosing state machine.

  2. Otherwise if smm is a state definition d with state definition member sequence sdms and sdms has at least one state definition, then

    1. Check that sdms has exactly one initial transition specifier.

    2. Visit each element sdm of sdms.

  3. Otherwise do nothing.

Visiting State Definition Members

Visit a state definition member sdm as follows:

  1. If smm is an initial transition specifier s, then check that the state definition or choice definition referred to in the enter expression of s leads to a member of the enclosing state definition.

  2. Otherwise if sdm is a state definition, then visit it in the same way as for the corresponding state machine member.

  3. Otherwise do nothing.

Clone this wiki locally