Because of the restriction of actions in DCharts models, compound statements cannot be directly written in the action list of the output of a transition. Suppose comp_stm1, comp_stm2, ... are compound statements, and simp_stm1, simp_stm2, ... are simple statements. The model in Figure 5.1 is invalid since the output of a transition is a list of compound statements instead of simple statements. On the contrary, the model in Figure 5.2 is valid.
It is important to transform a model with compound statements in its output into a valid form, since the statements discussed later are mostly compound statements. This transformation can always be found with the following method. (Since the composition of compound statements is still a compound statement, this method only consider transitions that have a single compound statement in their output.)
As an example, Figure 5.3 shows the transformation from a model with a compound statement in its output into a valid DCharts model. It assumes comp_stm to be a compound statement consisting of stm1, stm2 and stm3, which may be simple statements or compound statements. The model in the upper part is converted into the model in the lower part. If stm1, stm2 or stm3 is not a simple statement or a list of simple statements, this transformation is repeated.
As a result of this transformation, the output of each transition becomes a simple statement or a list of simple statements. (Note that this transformation may be done with graph grammars .)
Sequential execution of substatements in the compound statement is guaranteed by this transformation. However, synchronization is lost. Actions in other orthogonal components may be executed during the execution of those substatements, and the execution result of those interleaving actions becomes unpredictable. This semantics is different from executing a compound statement in a critical session provided by the simulator or executor. To solve this problem, it is suggested that the simulator or executor provide actions that allow designers to control the critical sessions. If such actions are available, the orthogonal component generated by this transformation is explicitly placed in a critical session. All the statements in it are executed continuously without interleaving with other actions. This topic is out of the scope of this thesis.