<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Petri Net Approach to Synthesize Intelligible State Machine Models from Choreography?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Toshiyuki Miyamoto</string-name>
          <email>miyamoto@eei.eng.osaka-u.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yasuwo Hasegawa</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Graduate School of Engineering, Osaka University</institution>
          ,
          <addr-line>Suita, Osaka 565-0871</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <fpage>222</fpage>
      <lpage>236</lpage>
      <abstract>
        <p>Application of service-oriented architecture, which builds the entire system by a combination of independent software components, to a wide variety of computer systems is expected. The problem to synthesize state machine models of the services from a communication diagram representing the overall specifications of service interaction is known as the choreography realization problem. It should be minded on automatic synthesis that software models should be simple to be understood easily by software engineers. In this paper, we propose a method to synthesize hierarchical state machine models for the choreography realization problem. The proposed method is evaluated using a metric for intelligibility.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>In recent years, the internationalization of activities and information technology
in the enterprise has intensified competition between companies. Companies are
under pressure to respond quickly to business needs, and the period for making
changes to existing business and launching new businesses has been shortened.
For this reason, the need to change or build quickly information systems has
been increasing.</p>
      <p>
        Under such circumstances, service-oriented architecture (SOA)[
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] has been
attracting attention as the architecture of information systems in the enterprise.
In SOA, an information system is built by composing independent software units
called services.
      </p>
      <p>In this paper, we consider the problem of synthesizing a concrete model from
an abstract specification. It is not easy for the designers to design a concrete
model directly from requirements since there exists huge gaps. But, defining an
abstract specification is relatively simple. Therefore, if we can automatically
synthesize a concrete model from abstract high-quality specification, it is expected
that designer’s workload is greatly reduced and product quality is improved.</p>
      <p>
        In the field of software engineering, there exist several investigations that
synthesize the concrete model from the abstract specification. Harel et al. proposes
a methodology for synthesizing statechart models from scenario-based
requirements[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Whittle et al. proposes a methodology for synthesizing hierarchical
? This work was supported by KAKENHI (23500045).
state machine models from expressive scenario descriptions[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. Liang et al.
defines a set of comparison criteria, and surveys 21 different synthesis approaches
presented in literature based on the criteria[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In addition, the theory of regions
has been attracting attention as a method to synthesize nets[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>
        In SOA, the problem to synthesize the concrete model from an abstract
specification is known as the choreography realization problem[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. In which
the abstract specification, called choreography, is defined as a set of interactions
among services, which are given in a dependency relation of messages sent and
received; the concrete model is called the service implementation which defines
the behavior of the service. This paper utilizes the communication diagram and
the state machine of UML 2.x[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] to describe the choreography and the service
implementation, respectively.
      </p>
      <p>
        Bultan and Fu formally introduced the choreography realization problem in
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. They used collaboration diagrams of UML1.x and showed some conditions
for a given choreography to be realizable. In addition, they showed a method
to represent the service implementation as the state space in which a state was
defined as a set of unsent messages, and they also showed a method to map to
a set of finite state machines. However, it is not intelligible because the number
of states increases exponentially as the number of messages increases.
Furthermore, they have adopted the semantics that message send and receive events for
a synchronous call occur simultaneously. Under this semantics, the UML
specification that “the execution of the call operation action waits until the execution
of the invoked behavior completes and a reply transmission is returned to the
caller”[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] can not be represented.
      </p>
      <p>
        Miyamoto et al. have proposed a method to synthesize hierarchical state
machines from the choreography given in communication diagrams[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. In the
method, dependency constraints between message send and receive events are
represented by Petri nets[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]; the state machine is synthesized from its
reachability space. A method to extract the hierarchical structure by analyzing the
reachability space is given, but the technique can only be applied to simple cases.
      </p>
      <p>This paper proposes a method of converting a Petri net into the state machine
directly. It is shown that there is a relation between the possibility of direct
conversion and structural properties of Petri nets. At first the proposed method
converts the Petri net so as to satisfy the structural properties, then it converts
Petri nets into hierarchical state machines without generating their state spaces.</p>
      <p>This paper is organized as follows. Section 2 introduces an UML subset,
called subset of UML for formally describing choreography and behavioral feature
(cbUML), to discuss the choreography realization problem, and an extended
Petri net, called message mark graph (MMG). The proposed method, called
Construct State-machine Cutting Bridges (CSCB) method, is evaluated in terms
of the intelligibility in Sect. 3. However, in this paper it is assumed that the
choreography is given in a single communication diagram as the first stage of
the study. Section 4 is the conclusion.</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>cbUML
Let us introduce a subset of UML, called cbUML, for the discussion in this paper.
Definition 1 (cbUML). cbUML is a tuple (C, M, A, CD, SM), where C is the
set of classes, M is the set of messages, A is the set of attributes, CD is the
set of communication diagrams, and SM is the set of state machines. Each of
messages and attributes is owned by a class, and behavior of a class is defined
by a state machine.</p>
      <p>Messages The set M of messages are partitioned with respect to the sort of
messages: M = Msop ∪ Maop ∪ Mrep, where Msop is the set of synchronous
messages generated by synchronous calls, Maop is the set of asynchronous
messages generated by asynchronous calls, and Mrep is the set of reply messages
to synchronous messages. Let Ms = Msop and Ma = Maop ∪ Mrep.
Correspondence between the synchronous call and its response is given by the
function ref er : M 7→ M ∪ {nil}, such that ∀m ∈ Msop : ref er(m) ∈ Mrep,
∀m ∈ Mrep : ref er(m) ∈ Msop, and ∀m ∈ Maop : ref er(m) = nil. Note that
∀m ∈ Msop ∪ Mrep : ref er(ref er(m)) = m.</p>
      <p>There is a difference in behavior during interactions due to differences in the
sort of message as follows: In a synchronous call, caller’s execution is stopped
until it receives a reply from the callee. On the other hand, in the asynchronous
call, the caller is possible to continue to operate, regardless of the behavior of
the callee side.</p>
      <p>In UML, each message has two events: a send event and a receive event. For a
synchronous message, it is considered that they occur simultaneously. However,
for the later discussion we need two events that occur separately. Therefore
we define that each synchronous message has two events: a preparation event
for message sending and a send-receive event, where the preparation event is a
caller’s event and the send-receive event is a callee’s event. A preparation event
and a send-receive event for a synchronous message m ∈ Ms are denoted by $m
and !m, respectively. For an asynchronous message m ∈ Ma, its send event and
receive event are denoted by !m and ?m, respectively. Hereafter a send event is a
send-receive event for a synchronous message or a send event for an asynchronous
message. The set Σ of message events and the set Δ of send events are defined
as follows:
Σ = {$m, !m | m ∈ Ms} ∪ {!m, ?m | m ∈ Ma}, and
Δ = {!m | m ∈ M}.</p>
      <p>Communication Diagrams Communication diagrams show interactions where
the arcs between the communicating lifelines are decorated with description of
the passed messages and their sequencing.</p>
      <p>Service1
Answer</p>
      <p>Service2</p>
      <p>Req1</p>
      <p>Check2
ReplyCheck2
Check3</p>
      <p>Service4
Service5</p>
      <p>Info1
Definition 2 (Communication Diagram). A communication diagram cd ∈
CD is a tuple cd = (Ccd, Mcd, Conncd, linecd, Dcd), where Ccd ⊆ C is the set of
instances of classes (called lifelines or objects) in cd, Mcd ⊆ M is the set of
messages in cd, Conncd ⊆ Ccd × Ccd is the set of connectors, which is given as a
symmetric relation on Ccd, linecd : Mcd 7→ Conncd assigns a connector for each
message, and Dcd ⊆ Δcd × Δcd is a dependency relation among send events.
Note that the reflexive and transitive closure of Dcd is a partial order.</p>
      <p>A conversation is the sequence of messages exchanged among the objects.
The set of conversations defined by a communication diagram cd is denoted by
C(cd) ⊆ 2M∗ , where M∗ is the set of all sequences of messages.</p>
      <p>Definition 3. A conversation σ = m1m2 · · · mn is in C(cd) if and only if σ ∈
M∗ and the corresponding sequence γ =!m1!m2 · · ·!mn of send events satisfies
∀i, j ∈ [1..n] : (!mi, !mj ) ∈ Dcd ⇒ i &lt; j.</p>
      <p>σ = Req1 Check1 Req1_rep Check2 Check3
State Machines The behavior of each object is described by a state machine.
Definition 4 (State Machine). A state machine is a tuple sm = (Vsm, Rsm,
topsm, contsm, T Rsm, Esm, Constsm, Behsm), where Vsm = SSsm∪CSsm∪F Ssm∪
ISsm is the set of vertices1, Rsm is the set of regions, top ∈ Rsm is the top
region, contsm : (Vsm ∪ Rsm) \ {topsm} 7→ (CSsm ∪ Rsm) is an ownership relation
between vertices and regions, T Rsm is the set of transition relations, Esm is
the set of events, Constsm is the set of constraints, and Behsm is the set of
behaviors.</p>
      <p>In UML state machines, although there are various kinds of states and
pseudo-states, only simple states, composite states, final states, and initial
pseudostates are used in this paper. A composite state is able to own one or more
regions, and a region is able to own vertices. The function contsm represents
the ownership of vertices and regions, and contsm(x1) = x2 means that x1 is
owned by x2. For a x ∈ Vsm ∪ Rsm, let des(x) = {x0 | ∃i &gt; 0 : contism(x0) = x}
be the set of descendants of x, where conts1m(·) = contsm(·) and contism(·) =
contsm(contis−m1(·)) (i &gt; 1).</p>
      <p>Definition 5 (Orthogonal State). If there exist vertices v1, v2 ∈ Vsm and
different regions r1, r2 ∈ Rsm, r1 6= r2 such that contsm(r1) = contsm(r2),
v1 ∈ des(r1), and v2 ∈ des(r2), two vertices v1, v2 are called orthogonal, and
denoted by v1 ⊥ v2.</p>
      <p>Definition 6. A set Vˆsm ⊂ Vsm of vertices is called consistent if and only if for
each pair v1, v2 ∈ Vˆsm of vertices v1 ⊥ v2, v1 ∈ des(v2), or v2 ∈ des(v1).</p>
      <p>The set Esm of events is given as Esm = Σsm ∪ {τ }, where Σsm is the set of
message events in the state machine and τ is the completion event that occurs
when a transition with no trigger event fires.</p>
      <p>
        A transition relation etr ∈ T Rsm is a tuple etr = (src, trig, grd, ef f, tgt),
where src ∈ Vsm is the originating vertex of the transition, a trigger trig ∈
Esm is the event that makes the transition fire, a guard grd ∈ Constsm is
a constraint, an effect ef f ∈ Behsm is an optional behavior to be performed
when the transition fires, and tgt ∈ Vsm is the target vertex. Note that {src, tgt}
must not be consistent. According to the UML specification[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], triggers, guards,
and effects are denoted like “ trig[grd]/ef f ” in diagrams. It is supposed that
Σsm ⊆ Behsm, and a caller’s event of message sending becomes an effect and a
callee’s event becomes a trigger.
      </p>
      <p>Due to space limitations, the details of operational semantics of state
machines are omitted, and the steps of doing synchronous calls and asynchronous
calls are explained by examples.</p>
      <p>Figure 3 shows the execution of the asynchronous call. Gray states are active.
When state machine sm1 transitions from state s11 to state s12 by the occurrence
of the completion event, an asynchronous call is executed. At this time the send
1 SSsm is the set of simple states, CSsm is the set of composite states, F Ssm is the set
of final states , and ISsm is the set of initial pseudo states.</p>
      <p>/!m
?m
/!m</p>
      <p>?m
s11
s12
sm1
/!m
s21
s22
sm2</p>
      <p>?m
rm
s11
s12
sm1
s21
s23
sm2
!m
!rm
s11
s12
sm1
s21
s23
sm2
!m
!rm
s11
s12
sm1
s11
s12
sm1
s21
event !m occurs, and the message m will be appended at the end of the queue of
sm2. The state machine sm2 transitions from state s21 to state s22 consuming
the message m by the occurrence of the receive event ?m.</p>
      <p>Figure 4 shows the execution of the synchronous call. A synchronous call is
executed in sm1. At this time, the preparation event $m occurs in sm1, and the
region that contains the transition is suspended. In addition, the message m is
appended at the end of the queue of sm2. The state machine sm2 transitions
from state s21 to s22 consuming the message m by the occurrence of the
sendreceive event !m. The sm2 sends a reply message rm to sm1 on transitioning
from s22 to s23. At this time the send event !rm occurs, and the message rm
is appended at the end of the queue of sm1. The sm1 releases the suspended
region, and transitions from state s11 to state s12 consuming the reply message
rm by the occurrence of the receive event ?rm. Note that the receive event ?rm
does not appear in the state machine, because we are using the region suspend
mechanism.</p>
      <p>
        The set of all conversations obtained by the execution of a set SM of state
machines is denoted by C(SM).
The proposed method represents the dependency relation between message send
an receive events by using Petri nets[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Since this paper assumes that the
choreography is given by a communication diagram, Petri nets that appear in this
paper are marked graphs.
      </p>
      <p>A Petri net N = (P, T, F, W ) is called ordinary when ∀(x, y) ∈ F : W (x, y) =
1. Then the weight function W is omitted. For x ∈ P ∪ T , the set {y ∈ P ∪ T |
(y, x) ∈ F } is called the preset of x, and denoted by •x. In the same way, the
set {y | (x, y) ∈ F } is called the postset of x, and denoted by x•.</p>
      <p>A place p ∈ P is called a source place and a sink place when •p = ∅ and
p• = ∅, respectively. In the same way a transition t ∈ T is called a source
transition and a sink transition when •t = ∅ and t• = ∅, respectively. A transition
t is called a fork transition and a join transition when |t • | ≥ 1 and | • t| ≥ 1,
respectively. The sets of join transitions and fork transitions are denoted by Tjoin
and Tfork, respectively. Under the standard definition, if ∀p ∈ P : | • p| = 1 and
|p • | = 1, then the Petri net is called a marked graph. In this paper, we relax the
condition as ∀p ∈ P : | • p| ≤ 1 and |p • | ≤ 1.</p>
      <p>Definition 7 (Message Marked Graph). A message marked graph (MMG)
is a tuple N = (P, T, F, W, G, A), where the underlying Petri net (P, T, F, W )
satisfies the following conditions:
1. N is an ordinary and acyclic,
2. there exist only one source place ps and only one sink place pe,
3. no source transitions and sink transitions exist, and
4. |ps • | = 1, | • pe| = 1, and ∀p ∈ P \{ps, pe} : [| • p| = 1, |p • | = 1].
G : T 7→ 2T is a firing constraint, and the partial function
an event for the transition.</p>
      <p>A : T 7→ Σ assigns</p>
      <p>A state of MMG is expressed by a pair (M, X), where M : P 7→ Z+ is a
marking and X : T 7→ B is a firing configuration, where Z+ is the set of
nonnegative integers and B = {true, false}. The initial state (M0, X0) of MMG is
given as follows:</p>
      <p>M0(p) =
(1 if p = ps</p>
      <p>0 otherwise, and</p>
      <p>X0(t) = false (∀t ∈ T ).</p>
      <p>A transition t ∈ T is enabled if and only if ∀p ∈ •t : M (p) ≥ W (p, t) and
∀t0 ∈ G(t) : X(t0) = true. A new state (M 0, X0) obtained by the firing of
transition t is given as follows:</p>
      <p>X0(t0) =
(true</p>
      <p>if t0 = t</p>
      <p>X(t0) otherwise.</p>
      <p>M 0(p) = M (p) − W (p, t) + W (t, p), and
Handles and Bridges Let N = (P, T, F ), and N1 = (P1, T1, F1) be a subnet
of N . An elementary path H = (n1, . . . , nr), r ≥ 2 of N is a handle of N1 if and
only if H ∩ (P1 ∪ T1) = {n1, nr}.</p>
      <p>Let N = (P, T, F ), and N1 = (P1, T1, F1) and N2 = (P2, T2, F2) be subnets
of N . An elementary path B = (n1, . . . , nr), r ≥ 2 is a bridge from N1 to N2 if
and only if B ∩ (P1 ∪ T1) = {n1} and B ∩ (P2 ∪ T2) = {nr}.</p>
      <p>
        For a transition t ∈ T , F J (t) ⊆ T is a set of terminal vertices of handles
starting from t. Similarly, J F (t) ⊆ T is a set of starting vertices of handles
terminating at t. Please refer to [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] for more detail about handles and bridges.
Convertible MMG Intuitively, if two states in a state machine are consistent,
both states may be active concurrently. The UML specification prohibits
drawing a transition between consistent states. An MMG is a representation of the
relationship between the order of the messages in the marked graph; in general
cases a state machine which satisfies the specification can not be directly, namely
without generating its state space, derived from the MMG.
      </p>
      <p>Let us introduce a subclass of MMG called the convertible MMG (CMMG),
from which we can get a state machine satisfying the specification directly by
using Algorithm 1 shown later.</p>
      <p>Definition 8.</p>
      <p>A MMG is called a CMMG if the following conditions hold:
1. |Tfork| = |Tjoin|
2. Tfork ∩ Tjoin = ∅
3. For any pair of handles H, H0 in the MMG, only one of following conditions
holds: (a) H and H0 share the same starting vertex and the same
terminal vertex, and (b) the starting vertices of H and H0 are different and the
terminal vertices of H and H0 are different.
4. If A(t) = $m, then t • • = {t0}, A(t0) =?ref er(m).</p>
      <p>From the definition of CMMG, for all t ∈ Tfork (resp. t ∈ Tjoin) |F J (t)| = 1
(resp. |J F (t)| = 1). Moreover the following lemma holds.</p>
      <p>Lemma 1. Let N be a MMG, N1 be a subnet of N , and H be a handle of N1.
If N is a CMMG, then there is no bridge from H to N1.</p>
      <p>Algorithm 1 shows how a CMMG is converted to a state machine. In the
algorithm, if A(t) ∈ {!m | m ∈ Ms} ∪ {?m | m ∈ Ma} then Event(t) = A(t), and
Constraint(t) = ∧a∈G(t)f ireda. The mapping Behavior(t) is given as follows:
own(m).m(· · · )

Behavior(t) = 
if A(t) ∈ {$m | m ∈ Msop}
send m(· · · ) to own(m) if A(t) ∈ {!m | m ∈ Maop}
reply to m(· · · ) if A(t) ∈ {!m | m ∈ Mrep}
where, own(m) is the owner object of message m, and in cbUML these
expressions show a synchronous call, an asynchronous call, and a reply for a
synchronous call. In addition, if f iredt ∈ A, then add an expression ‘f iredt = true’
to Behavior(t). The ‘new’ expression shows a new element is generated.
Lemma 2. A CMMG is directly convertible to a state machine.
By a single communication diagram, one scenario that is an interaction of objects
in the system are described. All behavior of the system is given by a set of
communication diagram; this is referred to as choreography.
Algorithm 1: Converting CMMG to a state machine</p>
      <p>Input: CMMG (P, T, F, G, A)</p>
      <p>Output: State machine (V, R, top, cont, T R, E, Const, Beh), Attribute A
1 begin
2 A ← {f iredt | t ∈ St0∈T G(t0)};
3 E ← {Event(t) | t ∈ T };
4 Const ← {Constraint(t) | t ∈ T };
5 Beh ← {Behavior(t) | t ∈ T };
6 V ← ∅;
7 R ← ∅;
8 tinit ← ps•;
9 tend ← •pe;
10 top ← new Region();
11 RNG(tinit, top, tend);
12 RNG(t, r, te)
13 ip ← new InitialPseudoState(); cont(ip) ← r;
14 if Event(t) = Constraint(t) = ε then
15 s ← ip
16 else
17 s ← new SimpleState(); cont(s) ← r;
18 new Transition (ip, ε, ε, ε, s);
while t 6= te do
ev ← Event(t); const ← Constraint(t); beh ← Behavior(t);
if ev = const = beh = ε ∧ |t • | = 1 then</p>
      <p>t ← t • •; continue;
if A(t) ∈ {$m | m ∈ Ms} then t ← t • •;
if |t • | ≥ 2 then
s0 ← new CompositeState(); cont(s0) ← r;
forall the p0 ∈ t• do
r0 ← new Region(); cont(r0) ← s;</p>
      <p>RN G(p0•, r0, F J (t));
t ← F J (t) ;
else
s0 ← new SimpleState(); cont(s0) ← r;
t ← t • •;
new Transition (s, ev, const, beh, s0);
s ← s0;
f s ← new FinalState();
new Transition (s, ε, ε, ε, f s);</p>
      <p>Intuitively, the choreography realization problem is the problem to determine
whether it is possible to synthesize a set of state machines which realize the
choreography. In addition, it is desired to synthesize the state machines. The
choreography realization problem is formally defined as follows.</p>
      <p>Service6-init
!Check5
Problem 1. For a given set CD of communication diagrams, is it possible to
synthesize the set SM of state machines which satisfy C(CD) = C(SM)? If
possible, obtain the set of state machines.</p>
      <p>In the case of un-realizable choreography, is is desired to synthesize state
machines which behave as close to the choreography as possible. It is called
weakly realizable if there exist state machines which satisfy C(CD) ⊇ C(SM).
For a weakly realizable choreography, obtain the set of state machines whose
C(SM) is maximal.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], sufficient realizability conditions for a class of collaboration diagrams
have been shown. We suppose that given CD is (weak) realizable hereafter and
the set CD contains only one communication diagram.
3.2
      </p>
      <p>CSCB Method
The proposed CSCB method synthesizes state machines from a communication
diagram as below. Due to space limitations the details of the algorithm are
omitted.
1. Construct a dependency relation ⇒cd on the set of events.</p>
      <p>For each object c, perform the following steps.
2. Derive a dependency relation ⇒ccd from ⇒cd.
3. Construct an MMG from ⇒ccd.
4. Cut T-T bridges from the MMG.
5. Separate fork and join transitions in the MMG.
6. Find one-to-one correspondence between Tfork and Tjoin in the MMG.
7. Perform Algorithm 1.
!Req1_rep
!Check1
!Check3
?Req1_rep
!Check2
?Check1
Construction of dependency relation ⇒cd The dependency relation ⇒cd⊆
Σcd × Σcd on the set of events is given by the following expression:
cd cd
⇒cd=Dcd ∪ {($m, !m) | m ∈ Ms } ∪ {(!m, ?m) | m ∈ Ma }
∪ {(?m1, !m2) | m1 ∈ Mcad, m2 ∈ Mcad, (!m1, !m2) ∈ Dcd}
∪ {(?m1, $m2) | m1 ∈ Mcad, m2 ∈ Mcsd, (!m1, !m2) ∈ Dcd}
∪ {(!m1, $m2) | m1 ∈ Mcsd, m2 ∈ Mcsd, (!m1, !m2) ∈ Dcd}</p>
      <p>Deriving ⇒ccd and Construction of MMG At first, ⇒cd is transitively
reduced, then the dependency relation ⇒ccd for each object c is derived. At this
time, in order to satisfy the condition 4 of CMMG, for all synchronous message
m ∈ Ma, if there exists an event e 6=?ref er(m) such that ($m, e) ∈⇒ccd, then a
relation (?ref er(m), e) is added in ⇒ccd.</p>
      <p>The dependency relations ⇒ccd, which are derived from the dependency
relation ⇒cd shown in Fig. 7, are shown in Fig. 8. Here, since ($Req1, ?Req1rep),</p>
      <p>A
B
(D)
C</p>
      <p>Fig. 10. Finding one-to-one correspondence
($Req1, ?Answer) ∈⇒ccd for Service1, a relation (?Req1rep, ?Answer) is added</p>
      <p>Service1.
in ⇒cd</p>
      <p>MMGs are constructed by converting vertices into transitions, adding a place
for each edge, and adding source and sink places in Fig. 8.</p>
      <p>Cutting T-T bridges As shown in Lemma 1, since bridges are unnecessary in
CMMGs, they are cut. In the example in Fig. 8, (!Check1 !Check2 ?ReplyCheck2)
of Service2 is a bridge. After removing edges (!Check1, !Check2) and (!Check2,
?ReplyCheck2), edge (Service2-init, !Check2) and (!Check2, Service2-end) are
added. At that time, in order to avoid changing the behavior, the following
firing conditions are added.</p>
      <p>G(t) =
(!Check1 if A(t) = !Check2</p>
      <p>!Check2 if A(t) = ?ReplyCheck2</p>
      <p>
        Cutting all bridges is not always necessary. Let U be a set of bridges and
f : U 7→ 2U be a function such that f (u) is a set of bridges which will not
be bridges by cutting bridge u. Then, the problem to finding the set of bridges
results in the set cover problem[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>Separating fork and join transitions If there exists fork and join transition,
it is split into a fork transition and a join transition as shown in Fig. 9.
Finding one-to-one correspondence As shown in Fig. 10, dummy transition
D is added in order to find one-to-one correspondence between fork and join
transitions..</p>
      <p>Lemma 3. The MMG obtained by applying steps 1∼6 of CSCB method is a
CMMG.</p>
      <p>
        Conversion into state machines By performing Algorithm 1, state machines
shown in Fig.s 12, 14, 13, 15, 16, and 6 are obtained.
Service1-init
$Req1
Antonio et al. have experimentally evaluated the relationship between metrics
and intelligibility of the state machines by measuring time to understand state
machines[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. According to the result, state machines are intelligible the smaller
the following metrics: the number of simple states (NSS), the number of
transitions (NT), and the number of guards (NG). In this section, the CSCB method
/reply to Req1;
      </p>
      <p>Req1 /
/send Check1 to Service3;
fired_Check1=true;
Ack1 /
/send Check3 to Service5;
ReplyCheck2 [fired_Check2] /
/send Answer to Service1;
[fired_Check1] /
send Check2 to Service4;
fired_Check2=true;</p>
      <p>Fig. 14. State machine of Service2</p>
      <p>Check2 /
/Service6.Check5();</p>
      <p>Info1 /
/ send ReplyCheck2 to Service2;</p>
      <p>Check3 /
/send Info1 to Service4;</p>
      <p>
        Fig. 16. State machine of Service5
is evaluated by comparing with Bultan’s method[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], the state space generation
method[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] by using the above metric.
      </p>
      <p>
        The Bultan’s method[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] synthesize flat state machines from the dependency
relation. Suppose the number of events relating to object c to be |Σc|, then the
number of states of the state machine becomes 2|Σc|. This method, however,
generates plenty of unreachable state from the initial state. In this paper, state
machines after removing these unreachable states are used.
      </p>
      <p>
        The state space generation method[
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] generates a state space for each MMG
at first, and then converts the state spaces into state machines. The method,
however, tries to find “independent sequences” in the state space, and tries to reduce
the number of states by using composite states. Therefore, when no independent
sequence is found, the same result with the Bultan’s method is obtained.
      </p>
      <p>Table 1 shows values of the metrics of state machines which are obtained
from the communication diagram in Fig. 1. Note that in the Bultan’s method
and the state space generation method, the reply message to a synchronous
call is considered as an asynchronous message which is independent with the
synchronous call. On the other hand, in the proposed method, the state transition
relating to a synchronous call terminates only when it receives the reply message.
The proposed method adds relation at step2 so as each preparation event for
message sending has only the receive event of the reply message as an immediate
successor. Therefore, in the dependency relation for Service1, events ?Req1_rep
and ?Answer are in concurrent for the Bultan’s method and the state space
generation method, but they are in sequential for the CSCB method.</p>
      <p>As for Service2, since the state space generation method failed to find
independent sequences, the state space are converted into a state machine as is. In
contrast, the proposed method succeeds to significantly reduce the number of
states by cutting bridges.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>In this paper, we considered the approach to the choreography realization
problem considering intelligibility of synthesized state machines. We proposed a
method to synthesize state machines without generating state spaces from the
choreography defined by single communication diagram. We evaluated the
proposed method by using metrics about intelligibility of the generate state
machines.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Antonio</given-names>
            <surname>Cruz-Lemus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Genero</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Piattini</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          :
          <article-title>Metrics for UML Statechart Diagrams</article-title>
          . In: Genero,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Piattini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Calero</surname>
          </string-name>
          , C. (eds.)
          <source>Metrics for Software Conceptual Models</source>
          , pp.
          <fpage>237</fpage>
          -
          <lpage>272</lpage>
          . Imperial College Press, London (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bultan</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          :
          <article-title>Specification of realizable service conversations using collaboration diagrams</article-title>
          .
          <source>Service Oriented Computing and Applications</source>
          <volume>2</volume>
          (
          <issue>1</issue>
          ),
          <fpage>27</fpage>
          -
          <lpage>39</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Desel</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yakovlev</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . (eds.):
          <source>Proceedings of 2nd Workshop on Application of Region Theory (Jun</source>
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Esparza</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Silva</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Circuits</surname>
          </string-name>
          , Handles,
          <source>Bridges and Nets. Lecture Notes in Computer Science</source>
          <volume>483</volume>
          ,
          <fpage>209</fpage>
          -
          <lpage>242</lpage>
          (
          <year>1991</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Harel</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kugler</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pnueli</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Synthesis revisited: generating statechart models from scenario-based requirements</article-title>
          . In: Kreowski,
          <string-name>
            <given-names>H.J.</given-names>
            ,
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            ,
            <surname>Orejas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Rozenberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Taentzer</surname>
          </string-name>
          ,
          <string-name>
            <surname>G</surname>
          </string-name>
          . (eds.)
          <source>Formal Methods in Software and Systems Modeling</source>
          , pp.
          <fpage>309</fpage>
          -
          <lpage>324</lpage>
          . Springer (Jan
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Jungnickel</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          : Graphs,
          <source>Networks and Algorithms</source>
          . Springer, 3rd edn. (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Liang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dingel</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Diskin</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>A Comparative Survey of Scenario-based to Statebased Model Synthesis Approaches</article-title>
          . In: 2006 International workshop on Scenarios and
          <article-title>state machines: models, algorithms</article-title>
          , and tools. pp.
          <fpage>5</fpage>
          -
          <lpage>11</lpage>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Miyamoto</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurahata</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fujii</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hosokawa</surname>
          </string-name>
          , R.:
          <article-title>Synthesis of state machine diagrams from communication diagrams using petri nets</article-title>
          .
          <source>Innovations in Systems and Software Engineering</source>
          <volume>6</volume>
          ,
          <fpage>39</fpage>
          -
          <lpage>46</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Murata</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Petri nets: Properties, analysis and applications</article-title>
          .
          <source>Proc. IEEE</source>
          <volume>77</volume>
          (
          <issue>4</issue>
          ),
          <fpage>541</fpage>
          -
          <lpage>580</lpage>
          (
          <year>Apr 1989</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. OMG:
          <article-title>Unified modeling language</article-title>
          , http://www.uml.org/
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Su</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bultan</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          :
          <article-title>Towards a theory of web service choreographies</article-title>
          .
          <source>In: Proceedings of the 4th international conference on Web services and formal methods</source>
          . pp.
          <fpage>1</fpage>
          -
          <lpage>16</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Thomas</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Service-Oriented Architecture</surname>
          </string-name>
          .
          <source>Prentice Hall</source>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Whittle</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jayaraman</surname>
            ,
            <given-names>P.K.</given-names>
          </string-name>
          :
          <article-title>Synthesizing hierarchical state machines from expressive scenario descriptions</article-title>
          .
          <source>ACM Transactions on Software Engineering and Methodology</source>
          <volume>19</volume>
          (
          <issue>3</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>45</lpage>
          (
          <year>Jan 2010</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>