next up previous contents index
Next: 2.2.6 Importation Up: 2.2 Overview of Abstract Previous: 2.2.4 Variables   Contents   Index


2.2.5 Transition Priorities

Transition Priorities are an extension of concepts found in STATEMATE statecharts, UML statecharts and DEVS (the select function). They are used to solve run-time conflicts between multiple transitions enabled by the same event at a given time. This case would make the model non-deterministic. [26]

Two possible kinds of transition conflicts are described in [5].

  1. At least two transitions are enabled by the same event, the source state of one of the transitions is a substate (or superstate) of the source state of the other transition(s).

  2. At least two transitions are enabled by the same event, they have the same source state.

(Note that if those transitions have source states in different orthogonal components, no conflict occurs and all those transitions are triggered by the same event. In that case, the order of the firing of those transitions is random or implementation-dependent.)

Solutions to the first kind of conflicts are found in both the STATEMATE semantics [5] and the UML [27]. Unfortunately, the solutions from the two sources are opposite: in UML, if the source state of a transition is a substate of the source state of the others, it gets higher priority; however, in the STATEMATE semantics, it gets lower priority.

In DCharts, it is possible to customize the priority of transitions by setting the $TP$ attribute of states (1st-round decision) and the $Prio$ attribute of transitions (2nd-round decision). The semantics of the different values of $TP$ is formalized below (function $Priority(t)$ is the total priority number of transition $t$; $t_1$ and $t_2$ are transitions; $SRC_1$ is the $SRC$ of $t_1$; $SRC_2$ is the $SRC$ of $t_2$):

Figure 2.3: An example of transition priorities
Image t1t2t3

Suppose there are three transitions t1, t2 and t3 as illustrated in Figure 2.3. When event e occurs, they are all enabled, so there is a conflict of the first kind. To understand the priority of these transitions, one must first consider the outermost state and step inward from there. Because S1 is specified to be $ITF$, the priority of t1 must be lower than both t2 and t3. Since S2 is $OTF$, t2 has a higher priority than t3. So the ordering by priority is t2, t3, t1. Detailed explanation of the graphical representation of DCharts models is in section 4.1.

The above scheme cannot solve the second type of conflicts. In case of such a conflict, the transition with the smallest $Prio$ number is fired. It is the designer's responsibility to ensure that this situation does not occur, or even if it occurs, there is a unique decision among the conflicting transitions according to their $Prio$ numbers. If the choice is not unique (more than one transition has the smallest $Prio$ number), the transition that is fired is random or implementation-dependent.


next up previous contents index
Next: 2.2.6 Importation Up: 2.2 Overview of Abstract Previous: 2.2.4 Variables   Contents   Index
Thomas Huining Feng 2004-04-28