**4. Informal semantics of a set of sequence diagrams**

The definition of UML presented in the standard (OMG, 2011) is informal. Lack of formal semantics brings ambiguity problems (Harel & Maoz, 2008; Störrle, 2004), especially in the case of automation of system development process and design of tools supporting the process. Furthermore, the possibility of UML model-checking is limited to syntax verification. To allow analysis of the properties of the spetcification formulated in UML, we propose a transformation of the specification – a set of sequence diagrams – to the abstract model which describes the behavior of the modeled system as a graph of possible scenarios (Fig. 8).

The graph of possible scenarios consists of nodes and arcs. Nodes represent system's configurations, meaning its states. Arcs represent events that cause transitions between configurations. Events may represent message sending or message receiving, time events and synchronization events. The latter are related to entering into or exiting from the combined fragments or their arguments.

The structure of the graph is similar to a tree. The root of the tree represents an initial configuration, in general, while leafs represent final configurations. It is possible however for some leafs to return to the initial configuration what is formally represented by an arc labeled with an artificial event δ. It is also possible to have loops for some configurations. The loops are labeled by synchronization events that do not change system configurations. A sequence of transitions starting from the initial configuration (a scenario) may be finite or infinite. The set of all sequences of transitions defines the set of possible scenarios of interactions between the system and its environment.

Fig. 8 presents only a fragment of the graph of possible scenarios for our exemplary specification. The graph contains only selected scenarios that are derived from the specification. The labels on arcs are symbols of messages taken from the sequence diagrams.

Now, semantics of the set of sequence diagrams may be defined as the set of all scenarios – sequences of events – generated by this graph. The scenarios are derived from fragments of interactions represented by single diagrams. On the basis of the set of sequence diagrams the graph expressing all derived scenarios is constructed.

104 Real-Time Systems, Architecture, Scheduling, and Application

Fig. 7. Sequence diagrams – representation of expected and forbidden behaviors

The definition of UML presented in the standard (OMG, 2011) is informal. Lack of formal semantics brings ambiguity problems (Harel & Maoz, 2008; Störrle, 2004), especially in the case of automation of system development process and design of tools supporting the process. Furthermore, the possibility of UML model-checking is limited to syntax verification. To allow analysis of the properties of the spetcification formulated in UML, we propose a transformation of the specification – a set of sequence diagrams – to the abstract model which describes the behavior of the modeled system as a graph of possible scenarios

The graph of possible scenarios consists of nodes and arcs. Nodes represent system's configurations, meaning its states. Arcs represent events that cause transitions between configurations. Events may represent message sending or message receiving, time events and synchronization events. The latter are related to entering into or exiting from the combined

The structure of the graph is similar to a tree. The root of the tree represents an initial configuration, in general, while leafs represent final configurations. It is possible however for some leafs to return to the initial configuration what is formally represented by an arc labeled with an artificial event δ. It is also possible to have loops for some configurations. The loops are labeled by synchronization events that do not change system configurations. A sequence of transitions starting from the initial configuration (a scenario) may be finite or infinite. The set of all sequences of transitions defines the set of possible scenarios of

Fig. 8 presents only a fragment of the graph of possible scenarios for our exemplary specification. The graph contains only selected scenarios that are derived from the specification. The labels on arcs are symbols of messages taken from the sequence diagrams. Now, semantics of the set of sequence diagrams may be defined as the set of all scenarios – sequences of events – generated by this graph. The scenarios are derived from fragments of interactions represented by single diagrams. On the basis of the set of sequence diagrams

**4. Informal semantics of a set of sequence diagrams** 

(Fig. 8).

fragments or their arguments.

interactions between the system and its environment.

the graph expressing all derived scenarios is constructed.

Fig. 8. Fragments of the graph of possible scenarios

The algorithm constructs the graph while walking from one location to another location along the lifelines on the sequence diagrams. A location is a time point on an object's lifeline with attached event, e.g. sending or receiving message. A set which for each lifeline of a given single diagram contains its location constitutes a snapshot of the diagram.

The snapshot represents current progress of the behavior modeled by the sequence diagram. The diagram together with its snapshot and the values of currently exchanged messages constitute a live copy of the diagram. The set of live copies of all diagrams which are involved into common scenario, i.e. operate on the same messages, determines a configuration. A configuration is changing when an event appears.

Of course, construction of the graph has to take into account all possible relationships between scenarios presented by individual sequence diagrams. In particular, in the first place, a consistency between scenarios has to be checked. The algorithm of the graph construction is presented in details in Section 6.
