called Promela, in order to determine whether it sat-
isfies the given constraints in the form of LTL (Linear
Temporal Logic) formulae. Therfore, we first have to
transform a sequence model into a Promela code.
In the nextsection, we discuss how sequence mod-
els are transformed into Promela codes.
3 TRANSFORMATION INTO
PROMELA CODES
A UML sequence model consists of various graphical
model elements, which include lifelines, messages,
combined fragments, execution occurrences, state in-
variants, and so on. Therefore, in order to transform a
sequence model to a Promela code, we have to define
the transformation rules for each model element. The
following shows these transformation rules.
I. Lifeline. A lifeline represents an object which
includes the associated methods. An object, and
consequently a lifeline, can be expressed as a pro-
cess in terms of Promela, which is designated by a
Promela statement “proctypeh. On the other hand,
each method within the object can be implemented
as an inline macro designated by a “inlineh statement.
The code within the inline macro firstly checks the
pre-condition of the method, then set the related vari-
ables to the values that satisfy the post-condition.
II. Messages. Messages in a UML sequence dia-
gram are classified into synchronous messages, asyn-
chronous messages, return messages, creation mes-
sages, lost messages, and found messages.
II-1. Synchronous Message and Return Message.
A synchronous message represents bi-directional
communication between lifelines. Promela provides
communication capability between two processes by
message channel definitions. Since a lifeline is im-
plemented by a process in Promela as stated above,
a synchronous message and its return message can
be implemented using message channels. A message
channel is defined as
chan name [buffer size] of {data type(s) }
The above “[buffer size]” represents the maximum
number of messages that thechannel can stores. How-
ever, since a sequence diagram does not provides us
with a queuing facility, this value is always set to zero,
which is known as the rendez-vous communication.
Since each channel is associated with a specific
data type or a list of data types, and so is each message
in a sequence model, we have to define at least one
channel for each data type or a list of data types used
in the model. Through these channels, messages are
sent from one process to another or the same process
defined by the “proctype” statement. For example, a
message m from “Object 1” to “Object 2 with the re-
turn message r, which is denoted as r = m(x
1
, ··· , x
m
),
can be expressed as shown in Figure 1 (a). In this
figure, X
i
and R represents the data types of x
i
and r
respectively. On the other hand, “chM” and “chR”
represent the channels for m and r respectively.
II-2. Asynchronous Message. Unlike a synchronous
message, a sender lifeline of an asynchronous mes-
sage does not wait for the return message. Such mes-
sage can be implemented in Promela as a simple mes-
sage sending as.shown in Figure 1 (b).
II-3. Creation Message. A creation message cre-
ates instantiates an object. The operation name on
the message represents the constructor of the object.
Since an object is represented as a process designated
by a “proctype” statement, this message can be im-
plemented as a “run” statement for the process that
represents the object to be created. In this process,
the message is received through the channel for it in
the same way as a synchronous or an asynchronous
message.
II-4. Lost Message and Found Message. A lost
message is a message that is sent outside the model
boundary, and therefore onlythe sender lifeline exists.
Such message is expressed in Promela as a sender
channel without the corresponding receiver channel.
The sender process sends the message using “chM !
x1, c, xm”, however no corresponding “chR ? x1, c
,xn” occurs in the Promela code.
On the other hand, a found message is a mes-
sage that is received from the outside of the model
boundary. Theoretically, such message is expressed in
Promela as a receiver channel without the correspond-
ing sender channel. However, in this implementation,
no process in the Promala code puts the message in
the channel. Therefore a dummy process is needed,
which put the message into the above channel.
The basic control structure of a sequence model
is that all the messages are processed along lifelines
from top to bottom. A combined fragment defines
a special region in a sequence model, which can pro-
vide more complicated control structures such as con-
currency, conditional branches, or iterations. The se-
mantics of a combined fragment is designated by a
tag on the fragment, e.g. par, alt, or loop. According
to these tags, combined fragments can be expressed
by Promela as follows.
III-1. Alternative Fragment. An alternative frag-
ment represents if-then-else control structure, which
is designated by the alt tag. This control structure is
EVALUATING UML SEQUENCE MODELS USING THE SPIN MODEL CHECKER
419