<!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 Component Framework where Port Compatibility Implies Weak Termination</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Debjyoti Bera</string-name>
          <email>d.bera@tue.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kees M. van Hee</string-name>
          <email>k.m.v.hee@tue.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michiel van Osch</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jan Martijn van der Werf</string-name>
          <email>j.m.e.m.v.d.werf@tue.nl</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Mathematics and Computer Science, Technische Universiteit Eindhoven</institution>
          ,
          <addr-line>P.O. Box 513, 5600 MB Eindhoven</addr-line>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
      </contrib-group>
      <fpage>152</fpage>
      <lpage>166</lpage>
      <abstract>
        <p>The design and verification of an asynchronous communicating system can be very complex. In this paper we focus on weak termination: in each reachable state, the system has the option to eventually terminate. We present a component framework and construction method that guarantees weak termination. In the framework, communication between components is modeled by portnets, a special class of workflow nets. A basic component defines the orchestration of the portnets. For weak termination, the orchestration should accord to each of the portnets. A composite component is built from basic components that offer some service via a portnet. We provide sufficient conditions to guarantee weak termination for composite components. Furthermore, we present a refinement-based construction procedure to derive a weakly terminating composite from an architectural diagram of the system.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>The class of asynchronous communicating systems encompasses a wide range
of software systems that include information systems, embedded systems, grid
computing systems, etc. The distributed nature and growing complexity of these
systems warrant the need for a component based development (CBD) approach
with support for formal analysis techniques. The central idea in the design of such
systems involves the construction of complex systems by assembling components
while guaranteeing certain properties.</p>
      <p>
        Over the past years, different formal models supporting component based
development have been proposed, like Cadena [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and SaveCCM [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Many of
these techniques provide a model to specify the components and their
composition while relying on state space based explorations to verify the correctness
of the design. State space based explorations are generally time consuming and
do not scale well to the complexities of real world models. For this reason we
construct a framework to guarantee correctness properties by construction. We
focus on one property: weak termination.
      </p>
      <p>
        The weak termination property states that in each reachable state of the
system, the system always has the possibility to reach a final state.
Generalized soundness [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] is a generalization of weak termination for workflow nets.
A class of generalized sound workflow nets is the class of ST-nets [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] which
are constructed by successive refinements of state machines and acyclic marked
graphs [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Components are loosely coupled. As a consequence, their composition
introduces a high degree of concurrency, and thus a state space explosion. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]
a sufficient condition is presented to pairwise verify weak termination for tree
structured compositions. For a subclass of compositions of pairs of components,
called ATIS-nets, this condition is implied by their structure [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. ATIS-nets are
constructed from pairs of acyclic marked graphs and isomorphic state machines,
and the simultaneous refinement of pairs of places [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ].
      </p>
      <p>
        In this paper, we present a component framework to construct a network of
asynchronously communicating components that guarantees weak termination.
The framework supports a best practice in communication protocol design:
communication between two components is first modeled as a state machine. Then,
each transition is assigned to one of the components, such that if any two
transitions are in conflict, these transitions are designated to the same component.
Then, the state machine is duplicated for each of the components. If a transition
is assigned to that component, it sends a message; the corresponding transition
of the other component receives this message. Such a net is called a portnet. In
this way, a component consists of a set of portnets defining its behavior with
the environment. A component needs to orchestrate all its portnets, such that
for each component it communicates with, it acts as the corresponding portnet.
This requirement is similar to the condition imposed by choreography standards
like WS-CDL [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. A Component may be either basic or composite. A basic
component provides a service via a portnet. In order to do so, it consumes from other
components. In a composition, we allow more than one component to consume
a service from another component. Such a composition is a directed graph with
edges representing dependency relationships between basic components. If the
composition is acyclic, it is a composite component.
      </p>
      <p>
        The orchestration of a component may nest portnets. To resemble this in
the architecture, we introduce a simple architectural diagram. Furthermore, we
study the behavior of an arbitrary composition of components and give sufficient
conditions to guarantee weak termination. We also present a construction
procedure based on the rules of [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to derive a weakly terminating composition
of components.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>Let S be a set. We denote the powerset by P(S). A bag over some set S is a
function m : N → S, where N = {0, 1, 2, . . .} denotes the set of natural numbers.
For s ∈ S, m(s) denotes the number of occurrences of s in m. We enumerate
bags with square brackets, e.g. the bag m = [a2, b3] has an element a occurring
twice and element b occurring thrice and all other elements have multiplicity
zero. The set of all bags over S is denoted by B(S). We write [] for an empty
bag and we use + and − for the sum of two bags and =, &lt;, &gt;, ≤, ≥ to element
wise compare bags, which are defined in the standard way. A set can be seen as
a multiset in which each element of the set occurs exactly once.</p>
      <p>A Petri net is a tuple N = (P, T, F ), where P is the set of places; T is the set
of transitions such that P ∩T = ∅ and F is the flow relation F ⊆ (P ×T )∪(T ×P ).
We refer to elements from P ∪ T as nodes and elements from F as arcs. We
denote the places of net N by PN , transitions as TN and similarly for other
elements of the tuple. If the context is clear, we omit N in the subscript. We
define the preset of a node n as N•n = {m|(m, n) ∈ F } and the postset as
m•N = {n|(m, n) ∈ F }. We lift the notion of a preset and postset to sets:
N•S = ∪s∈S N•s and SN• = ∪s∈S s•N for some set S ⊆ (P ∪ T ). If the context is
clear, the subscript is omitted. A path ν in a Petri net N of length n ∈ N is a
function ν : 1, . . . , n → (P ∪T ) such that (ν(i), ν(i+1)) ∈ F for all 1 ≤ i &lt; n. We
denote a path of length n by ν = hx1, . . . , xni where xi = ν(i) for all q ≤ i ≤ n.
The set of all paths of a Petri net N is called the path space and denoted by
P S(N ). Two Petri nets N and M are disjoint if (PN ∪ TN ) ∩ (PM ∪ TM ) = ∅.
They are isomorphic, denoted by N ∼=ψ M if and only if a bijective function
ψ : PN ∪ TN → PM ∪ TM exists such that PM = ψ(PN ), TM = ψ(TN ) and
∀(x, y) ∈ FN ⇔ (ψ(x), ψ(y)) ∈ FM . We write N ∼= M if a bijective function ψ
exists such that N ∼=ψ M . The state of a Petri net N = (P, T, F ) is determined
by its marking which represents the distribution of tokens over places of the
net. A marking m of a Petri net N is a bag over its places P , i.e., m ∈ B(P ). A
transition t ∈ T is enabled in m if and only if •t ≤ m. An enabled transition may
fire which results in a new marking m0 = m − •t + t•, denoted by m →−t m0. We
define the set of reachable markings of a Petri net N with marking m inductively
by R(m) = {m} ∪ Sm→−tm0 R(m0). We define the net system of a Petri net N
as a 3-tuple M = (N, m0, mf ), where m0 ∈ B(PN ) is the initial marking and
mf ∈ B(PN ) is the final marking. The weak termination property for a net
system M states that ∀m ∈ R(N, m0) : mf ∈ R(N, m), i.e. for all reachable
markings from the initial marking the final marking is reachable. If a marking
does not enable any transition in the net, it is called a dead marking. A place is
called safe in a net system (N, m0, mf ) if ∀m ∈ R(N, m0), m(p) ≤ 1. Let N =
(P, T, F ) be a Petri net. Net N is a workflow net (WFN) if there exists exactly
one place i ∈ P with •i = ∅, called the initial place, one place f ∈ P with f • = ∅,
called the final place, and all nodes n ∈ P ∪ T are on a path from i to f . The
closure of a workflow net N is a net closure(N ) = (P, T ∪ {t¯}, F ∪ {(t¯, i), (f, t¯)})
such that t¯ ∈/ T and •i = f • = { }</p>
      <p>
        t¯ . A WFN N weakly terminates if its net
system (N, [i], [f ]) weakly terminates. Note that in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] this property is called
1-Soundness. For an overview of soundness, see [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Net N is a state machine
(S-net ) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] if and only if ∀t ∈ T : |•t| = |t•| = 1. In a state machine, a place p is
called a split if p• &gt; 1. Likewise, it is a join if •p &gt; 1. Net N is a marked graph
(T-net ) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] if and only if ∀p ∈ P : |•p| = |p•| = 1. A workflow net that is also
a state machine is called an S-WFN. If it is both a workflow net and a marked
graph, it is called a T-WFN. The class of ST-nets were introduced in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. These
nets allow both concurrency and choice. Note that the class of T-nets used in
[
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] has transitions as the initial and final nodes of the net. We extend such a
net to our definition of a T-WFN by adding one initial and one final place. The
class of ST-nets that we will use in this paper includes the class of S-nets, T-nets
and nets obtained after arbitrary successive refinement of places [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] within an
      </p>
      <sec id="sec-2-1">
        <title>ST-net by either an S-WFN or a T-WFN.</title>
        <p>3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Component Framework</title>
      <p>In this section, we introduce a compositional framework to describe component
based systems built of components that are cyclic in their execution and react to
inputs from their environment. The main concept of this framework is the notion
of a component. A component may be basic or composite. A basic component
provides a service and may in turn may use the services offered by other basic
components. The interfaces of a basic component are modeled as a portnet. A
portnet describes a communication protocol. Such a protocol describes all
possible sequences of messages that may be exchanged during a service negotiation.
A basic component is a closed ST-net providing some service by means of a
sell side portnet and consuming services using buy side portnets from
components that have a compatible sell side portnet. The sell side portnet of a basic
component encapsulates all of its buy side portnets. Furthermore, we allow buy
side portnets to be nested. A composite component is the composition of a set
of pairwise composable basic components such that their dependency graph is
acyclic.</p>
      <p>A component is modeled as a Petri net. An activity within such a component
is modeled by a transition. We distinguish between two types of places, namely
internal places and interface places. An interface place is either an input place
for one component or an output place for another component. An input place
has an empty preset and an output place has an empty postset. All other places
of a component are referred to as internal places. Tokens residing at interface
places represent messages, otherwise they are simply state markers. Transitions
are either internal transitions or interface transitions. An internal transition has
no interface places in its preset and postset, whereas an interface transition has
some interface places in its preset (then it is called a receive transition) or its
postset (then it is called a send transition), but never in both.
3.1</p>
      <sec id="sec-3-1">
        <title>Formalization</title>
        <p>Our component framework is based on open Petri nets (OPN) which are a
subclass of classical Petri nets. OPN are ideal to model communicating systems.
This is because they have a distinguished set of interface places that represent
the interfaces of the net. A direct consequence of the interaction of an OPN
with its environment results in tokens being exchanged between these places.
Furthermore, we add structural constraints to derive subclasses of an OPN. A
subworkflow net is a OWN that is a subnet of an OPN.</p>
      </sec>
      <sec id="sec-3-2">
        <title>Definition 1 (Open Petri net, subworkflow net). An open Petri net (OPN)</title>
        <p>is defined as N = (P, I, O, T, F, i, f ), where (1) P is the set of internal places;
(2) I is the set of input places with •I = ∅; (3) O is the set of output places
with O• = ∅; (4) T is the set of transitions; (5) the sets P , I, O and T are
pairwise disjoint; (6) i ⊆ P is the set of initial places; (7) f ⊆ P is the set of
final places ; (8) ∀t ∈ T : •t ∩ I 6= ∅ ⇒ t• ∩ O = ∅ ∧ t• ∩ O 6= ∅ ⇒ •t ∩ I = ∅;
and ((P ∪ I ∪ O, T, F ), i, f ) is the net system. We refer to the set I ∪ O as
the interface places of the net. The skeleton of N is a Petri net defined as
skeleton(N ) = (P, T, F 0), where F 0 = F ∩ ((P × T ) ∪ (T × P )). The skeleton
system is defined as (P, T, F 0, i, f ).</p>
        <p>If skeleton(N ) is a WFN then N is called a open workflow net (OWN) . If
skeleton(N ) is a S-WFN then N is called a state machine open workflow net
(S-OWN). If skeleton(N ) is a T-WFN then N is called a marked graph open
workflow net (T-OWN) . If skeleton(N ) is a ST-net then N is called a ST open
workflow net (ST-OWN) .</p>
        <sec id="sec-3-2-1">
          <title>Let N be an OPN and M be a OWN. We say that M is a subworkflow</title>
          <p>net of N denoted by M v N if and only if PM ⊆ PN , TM ⊆ TN , FM ⊆ FN ,
IM ⊆ IN , OM ⊆ ON , N•(TM ∪ OM ∪ PM \ {iM })∪(TM ∪ IM ∪ PM \ {fM })•N ⊆
(TM ∪ PM ∪ IM ∪ OM ).</p>
          <p>The transitions of an open Petri net are distinguished into three categories
depending on the direction of communication, namely send, receive and internal.
A send transition contains an output place in its postset. A receive transition
has an input place in its preset. A transition that does not send or receive is
called an internal transition.</p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>Definition 2 (Direction of communication). The direction of communica</title>
        <p>tion of a transition with respect to a place in an open Petri net N is a function
λ : T → {send, receive, τ } defined as λ(t) = send ⇔ t• ∩ O 6= ∅ ∧ •t ∩ I = ∅;
λ(t) = receive ⇔ •t ∩ I 6= ∅ ∧ t• ∩ O = ∅ and λ(t) = τ , otherwise, for all t ∈ T .
We call a transition t ∈ T a communicating transition if and only if λ(t) 6= τ .</p>
        <p>
          The refinement of safe places in a Petri net is a well known refinement step
and has been described in various contexts [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ]. We present here the refinement
of a safe place within an OPN by an ST-OWN.
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>Definition 3 (Place refinement and net reduction). Given an OPN N</title>
        <p>and an OWN M such that N and M are disjoint, a safe place p ∈ PN \ {n |
iN (n) = fN (n) = 0} can be refined by M , resulting in an OPN N 0 = N p M =
(P, I, O, T, F, i, f ) with P = (PN \ {p}) ∪ PM , I = IN ∪ IM , O = ON ∪ OM ,
T = TN ∪TM , F = (FN \((•p×{p})∪({p}×p•)))∪FM ∪(•p×{iM })∪({fM }×p•),
i = iN , f = fN . We define the reduction of net N 0 by the subworkflow net M by
reduce(N 0, M ) = N if and only if N 0 = N p M .</p>
        <p>An OPN N is said to be reducible to another open Petri net N 0 if and only
if successive applications of the reduce operation on net N results in the net N 0.
Note that we restrict the definition to reductions only by the class of ST-net,
since this is the inherent structure of all nets in this component framework. Note
that this relation is a preorder.</p>
      </sec>
      <sec id="sec-3-5">
        <title>Definition 4 (Reducible nets). Consider two OPN’s N and N 0. We say N</title>
        <p>is reducible to N 0 denoted by N N 0 if and only if N = N 0 ∨ ∃M : M is a
ST-OWN ∧ (M 6= N ) ∧ (M v N ) ∧ reduce(N, M ) N 0.</p>
        <p>Unlike in an OPN, interfaces in our component framework are more than just
a set of interface places acting as message buffers. An interface is determined by a
Petri net with a distinguished set of interface places, called the portnet. A portnet
defines the communication protocol which specifies all acceptable sequences of
messages that are permitted to be exchanged over the portnet.</p>
        <p>A portnet is an S-OWN with structural constraints on the relation between
transitions and interface places and paths through it. In a portnet, each interface
place is connected to exactly one transition, and each transition is connected to
exactly one interface place. Secondly, a portnet must satisfy the leg property. A
path in a portnet is called a leg if it is a path from a split to a join. We also
consider the initial place as a split and the final place as a join. The leg property
requires every leg in a portnet to have at least two transitions with different
directions of communication. Lastly, a portnet must satisfy the choice property,
which requires all transitions belonging to the postset of a place to have the
same direction of communication.</p>
      </sec>
      <sec id="sec-3-6">
        <title>Definition 5 (Portnet).</title>
        <sec id="sec-3-6-1">
          <title>A portnet C is a S-OWN such that</title>
          <p>– ∀t ∈ T : |(•t ∪ t•) ∩ (I ∪ O)| = 1;
– ∀x ∈ I ∪ O : |•x ∪ x•| = 1;
– (Leg property) ∀β = hp1, t1...tn−1, pni ∈ P S(C) : (|p1•| &gt; 1 ∨ p1 = iN ) ∧
(|•pn| &gt; 1 ∨ pn = fN ) : ∃t, t0 ∈ β : λ(t) 6= λ(t0).
– (Choice property) ∀t1, t2 ∈ T : •t1 ∩ •t2 6= ∅ ⇒ λ(t1) = λ(t2).</p>
          <p>We distinguish between two types of portnets: A sell side portnet advertises
a service and needs a startup message and terminates after sending a result
message. A buy side portnet consumes a service by sending a startup message
and terminates after receiving the result message.</p>
        </sec>
        <sec id="sec-3-6-2">
          <title>Definition 6 (Portnet types). Consider a portnet C. We call Portnet C a sell</title>
          <p>side portnet denoted by sell(C) if and only if ∀t ∈ iC • : λ(t) = receive ∧ ∀t ∈
•fC : λ(t) = send and we call Portnet C a buy side portnet denoted by buy(C)
if and only if ∀t ∈ iC • : λ(t) = send ∧ ∀t ∈ •fC : λ(t) = receive.</p>
          <p>Note that ¬sell(C) ⇔ buy(C). A component is an OPN with a set of portnets.
Every communicating transition in a component belongs to a portnet.
Furthermore, every portnet of a component is either already a subworkflow net or there
exists a subworkflow net that can be reduced to the corresponding portnet.</p>
        </sec>
      </sec>
      <sec id="sec-3-7">
        <title>Definition 7 (Component). A component is a pair (N, Γ ) where N is an</title>
        <sec id="sec-3-7-1">
          <title>OPN and Γ is a set of portnets, such that:</title>
          <p>– ∀t ∈ TN : λ(t) 6= τ ⇒ ∃C ∈ Γ : t ∈ TC
– ∀C ∈ Γ : ∃N 0 : N 0 is an OWN : N 0 v N ∧ N 0
The set of all sell side portnets of a component is defined as: sellside((N, Γ )) =
{C ∈ Γ | sell(C)} and the set of all buy side portnets of a component is defined
as: buyside((N, Γ )) = {C ∈ Γ | buy(C)}.</p>
        </sec>
      </sec>
      <sec id="sec-3-8">
        <title>Lemma 8 (Preservation of weak termination). Consider two OPN’s N</title>
        <p>and M such that N M . Then N is weakly terminating if and only if M is
weakly terminating.</p>
        <p>Portnets of a component may be nested in each other.</p>
        <sec id="sec-3-8-1">
          <title>Definition 9 (Nested portnets). Consider a component (N, Γ ) and two port</title>
          <p>nets C1, C2 ∈ Γ . We say portnet C2 is nested in portnet C1 denoted by C2 CN C1
if and only if ∃M1, M2 : M2 v M1 v N ∧ M1 C1 ∧ M2 C2.</p>
          <p>Two portnets are said to be compatible if their skeletons are isomorphic.
Furthermore, the set of input places of one portnet must match the set of output
places of the other portnet while preserving the relation with their associated
transitions. Note that a portnet is not compatible with itself.</p>
        </sec>
      </sec>
      <sec id="sec-3-9">
        <title>Definition 10 (Compatible portnets). Portnets C1 and C2 are compatible</title>
        <p>with respect to some bijective function φ : (PC1 ∪ TC1 ∪ IC1 ∪ OC1 ) → (PC2 ∪
TC2 ∪ IC2 ∪ OC2 ), denoted by C1 ,φ C2 if and only if :
– skeleton(C1) ∼=φ skeleton(C2),
– OC2 = φ(IC1 ), IC2 = φ(OC1 ),
– ∀x ∈ IC1 , t ∈ TC1 : (x, t) ∈ FC1 ⇔ (φ(t), φ(x)) ∈ FC2 ,
– ∀x ∈ OC1 , t ∈ TC1 : (t, x) ∈ FC1 ⇔ (φ(x), φ(t)) ∈ FC2</p>
        <sec id="sec-3-9-1">
          <title>We write C1 , C2 if a bijective function φ exists such that C1 ,φ C2.</title>
          <p>Basic components are the building blocks of this component framework. The
Petri net structure of a basic component is modeled as an ST-OWN with a
closure transition. A basic component has one sell side portnet by means of
which it provides a service. The sell side portnet may have zero or more nested
buy side portnets. Furthermore, each interface place belongs to a unique portnet.
Definition 11 (Basic component). A component B = (N, Γ ) is a basic
component if and only if |iN | = |fN | = 1, N is the closure of an ST-OWN and the
following conditions are met:
– ∀x ∈ IN ∪ ON , ∃!C ∈ Γ : x ∈ IC ∪ OC ;
– ∃C ∈ Γ : iC = iN ∧ fC = fN ∧ sellside(B) = {C}.</p>
          <p>Corollary 12. Consider a basic component B = (N, Γ ) and a portnet C ∈ Γ :
sell(C). Then N closure(C).</p>
          <p>Note that the closure transition allows the basic component to handle more
than one service request. Fig. 1 gives an example of a basic component M =
(N, Γ ), where Γ = {S1, B1, B2} and S1 is a sell side portnet. The sell side
portnet has two nested buy side portnets: B1 CN S1 and B2 CN S1. Net N contains a
subworkflow net with initial place q and final place q0. This subworkflow net can
be reduced by nets B1 and B2. We refer to the resulting net as an orchestration
net. Such a net provides the logic behind the order of invocation of the different
buy side portnets within a basic component.</p>
          <p>Two components are said to be composable if and only if the only set of
nodes they share are interface places and if this set is not empty, then either
they have compatible portnets or they have identical buy side portnets. Note
that we require unique sell side portnets.</p>
          <p>Definition 13 (Composable components). Two components X = (N, ΓN )
and Y = (M, ΓM ) are composable denoted by composable(X, Y ) if and only if
– (PN ∪ IN ∪ ON ∪ TN ) ∩ (PM ∪ IM ∪ OM ∪ TM ) = (ON ∪ IN ) ∩ (OM ∪ IM );
– ∀C1 ∈ ΓN , C2 ∈ ΓM : ((OC2 ∩ IC1 ) ∪ (OC1 ∩ IC2 ) 6= ∅ ⇒ C1 , C2) ∧
((IC1 ∩ IC2 ) ∪ (OC1 ∩ OC2 ) 6= ∅ ⇒ C1 =∼ C2 ∧ buy(C1)).</p>
          <p>A composition of a set of pairwise composable components is almost a
pairwise union of the tuples of this set, except that the interface places belonging to
pairs of compatible portnets, now become the internal places of this composition.
Furthermore, the set of portnets of this composition is the set of all incompatible
portnets. We extend the composition operation to portnets by treating portnets
as components. This is possible in the following way: Consider a portnet C, then
this portnet is also a component (C, {C}).</p>
        </sec>
      </sec>
      <sec id="sec-3-10">
        <title>Definition 14 (Composition of components). The composition of a set S</title>
        <p>of pairwise composable components is denoted by comp(S) = (N, Γ ), where N =
(PN , IN , ON , TN , FN , iN , fN ) such that
– PN = (S(X,Γ 0)∈S PX ) ∪ (S(X,Γ 0)∈S IX ∩ S(X,Γ 0)∈S OX ),
– IN = S(X,Γ 0)∈S IX \ S(X,Γ 0)∈S OX , ON = S(X,Γ 0)∈S OX \ S(X,Γ 0)∈S IX ,
– TN = S(X,Γ 0)∈S TX , FN = S(X,Γ 0)∈S FX ,
– iN = S(X,Γ 0)∈S iX , fN = S(X,Γ 0)∈S fX , and
– Γ = {C ∈ S(X,Γ 0)∈S Γ 0|∀C0 ∈ S(X,Γ 0)∈S Γ 0 : ¬(C , C0)}.</p>
        <sec id="sec-3-10-1">
          <title>Corollary 15. The composition of a set of pairwise composable components is again a component.</title>
          <p>Note that the composition of one basic component is in fact the basic component
itself. Furthermore, comp(S1 ∪ S2) 6= comp(S1 ∪ {comp(S2)}), where S1 and S2
are sets of pairwise composable basic components.
3.2</p>
        </sec>
      </sec>
      <sec id="sec-3-11">
        <title>Architectural Diagram</title>
        <p>
          We now present a graphical notation to represent a composition of components
as an architectural diagram of the system. The diagram abstracts away from the
underlying control flow and focuses on the relationships between components and
the relationships between the portnets of a component. Components are depicted
by a rounded rectangle. The portnets of a basic component are represented by
a square. All entities are labeled. The dependency relation between a pair of
portnets belonging to different components is represented by a directed arrow
indicating the direction of communication initiation, i.e. from a buy side portnet
to a sell side portnet. A buy side portnet may have at most one outgoing directed
edge while a sell side portnet may have zero or more incoming directed edges. The
sell side portnet with zero incoming directed edges becomes the portnet of the
composition. The portnets of the composition are represented by extending the
portnet with a dotted line to the boundary of the composition. By the structure
of a component, we know that all the buy side portnets of a basic component
are nested within the sell side portnet. Furthermore, a buy side portnet may
nest one or more buy side portnets. We represent the nesting of portnets by a
dotted directed edge leading from the child to its parent. Note that the Service
Component Architecture assembly diagram [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] notation is similar but does not
consider nested portnets. We present an architecture diagram of a navigation
system in Fig. 2.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Behavior</title>
      <p>In this section, we study the behavior of a composition of components. In
particular, we are interested in weak termination of components, which we define
on the skeleton system of the component.</p>
      <sec id="sec-4-1">
        <title>Definition 16 (Weak termination of a component).</title>
        <p>weakly terminating if its skeleton system weakly terminates.</p>
        <sec id="sec-4-1-1">
          <title>A component N is</title>
          <p>
            To prove weak termination for an arbitrary composition of components we
first show that the composition of a sell side portnet with a set of compatible
buy side portnets is weakly terminating. The crux of the proof relies on both the
leg property and the choice property. These properties ensure that every choice
and loop is properly communicated to the other compatible portnet, and once
the choice to provide a service to a buy side portnet has been made no other
buy side portnet can influence the service negotiation. The proof of the following
theorem can be found in [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ].
          </p>
        </sec>
        <sec id="sec-4-1-2">
          <title>Theorem 17. Let A, B1, ..., Bk be portnets such that sell(A) and Bi , A for</title>
          <p>all 1 ≤ i ≤ k, then comp({closure(A), B1, ..., Bk}) weakly terminates.</p>
          <p>Weak termination for an arbitrary composition of portnets is not sufficient
to guarantee weak termination for an arbitrary composition of components. To
guarantee weak termination for a composition of components, we require the
graph of the composition to be acyclic. This is because a cycle indicates a
deadlock in the composition. In our framework, we call an acyclic composition of
pairwise composable basic components a composite component. Note that we
will use the shorthand D instead of D = (N, Γ ), D0 instead of D0 = (N 0, Γ 0)
and so on, to denote a component without explicitly labeling the tuples. We first
introduce the notion of a partner for a buy side portnet in a component, which
is the component that provides the compatible sell side portnet.</p>
        </sec>
        <sec id="sec-4-1-3">
          <title>Definition 18 (Partner). For a non-empty set S of composable basic compo</title>
          <p>nents, and the set B consisting of all buy-side portnets of the components of S,
we define the function partner : S × B 9 S by ∀D, D0 ∈ S, ∀C ∈ B : D0 =
partner(D, C) ⇔ ∃C0 ∈ Γ 0 : sell(C0) ∧ C , C0.</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>Definition 19 (Acyclic composition, composite component). Consider a</title>
        <p>set of S of pairwise composable basic components. Let R ⊆ S × S be the relation
such that ∀D, D0 ∈ S : (D, D0) ∈ R ⇒ ∃C ∈ Γ : D0 = partner(D, C). The
composition is a composite component if and only if the transitive closure R∗ is
irreflexive.</p>
        <p>
          The result on weakly terminating composition of portnets in conjunction
with Lemma 8 allows us to prove that an arbitrary composite component weakly
terminates. Both the proof and an example of a deadlock in a cyclic composition
can be found in [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
        </p>
        <sec id="sec-4-2-1">
          <title>Theorem 20. A composite component weakly terminates.</title>
          <p>5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Construction Method</title>
      <p>This section presents a construction method that derives a composition of basic
components from an architectural diagram and ensures that the derived
composition is weakly terminating. The construction method is based on place refinement
and composition as defined in the previous sections.</p>
      <p>The construction method starts with an architecture diagram of a composite
component, like the one depicted in Fig. 2. To construct a basic component
we require the three ingredients, namely a sell side portnet, a set of buy side
portnets and a set of orchestration nets (ST-WFN). An orchestration net is
used to elaborate the activities of a basic component by being able to introduce
internal activities, concurrency and choice in a structured way. Furthermore,
the places introduced by an orchestration net, may be refined with buy side
portnets during construction, thereby allowing us to model both the choice of
service invocations and concurrency in service invocations.</p>
      <p>First, for each basic component in the diagram, design the sell side portnet.
Next, for each basic component in the diagram, derive all its buy side portnets
from existing compatible sell side portnets. Note that a buy side portnet may
be derived from a sell side portnet by changing the direction of communication
associated with each transition in the corresponding sell side portnet. Lastly, for
each basic component in the diagram, design the necessary orchestration nets
that will be required during the construction.</p>
      <p>We may now convert all the sell side portnets into a basic component by
introducing the closure transition. For each basic component, the architecture
diagram gives the order of nesting of its portnets. Using this information, we
may now start designing the control flow of a basic component by successive
refinements of an existing internal place with either an orchestration net or a
buy side portnet, until all the buy side portnets of the basic component have
been added in the right order of nesting and the desired basic component has
been constructed.</p>
      <p>Construction method
1. Design an architecture diagram for an acyclic composition of basic
components using the techniques of Sec. 3.
2. Design all the portnets and orchestration nets that we will need for this
composition.
3. For each node in this architecture diagram select the corresponding sell side
portnet and apply the closure operation.
4. For each basic component, repeat the following steps until in each basic
component all the buy side portnets have been added in the right order of
nesting, and the desired orchestration has been constructed:
(a) If an orchestration needs to be added first, then choose an internal place
and refine with the right orchestration net;
(b) Otherwise, choose an internal place and refine with a buy side portnet
in the order defined by the architectural diagram;
5. Compose the set of basic component using the composition operation.</p>
      <sec id="sec-5-1">
        <title>Theorem 21. The construction method always results in a composite component that weakly terminates.</title>
        <p>5.1</p>
        <sec id="sec-5-1-1">
          <title>Construction of Orchestration Nets and Portnets</title>
          <p>For the construction of portnets, we extend the Jackson refinement rules R0,
R1, R2, and R3 with interface places as depicted in Fig. 3. Note that rule R0 is
a special case of the refinement rule of Def. 3. Rule R00 and R000 extend rule R0
such that the refined transition can have either the communication direction send
or receive. The extensions of rule R3 maintains the leg property by only adding
loops with different directions of communication. Similarly, Rule R2, which adds
a choice to the net is extended such that the choice property is maintained. Rule
R1 is extended to allow two way communication.</p>
          <p>
            The construction of an orchestration net starts with a single place. By
applying the refinement rules of [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ], we obtain larger nets that are guaranteed to be
weakly terminating. We limit ourselves by applying the Jackson refinement rules
R0, R1, R2, R3, R4 such that the result remains an ST-net. The construction of
a portnet starts with the choice of the sell side portnet or buy side portnet. A sell
side portnet is obtained by the sequence of refinements: R0; R1; R10. A buy side
portnet is obtained by the sequence of refinements: R0; R1; R100. We may now
further elaborate these portnets by arbitrary applications of the refinement rules
R0; R00, R0; R000, R1; R10, R1; R100, R2; R20, R2; R200, R3; R30, R3; R300, while
ensuring that the structure of the portnet remains a S-OWN by not allowing
for place duplication (rule R4). Note that the choice of the place to apply the
refinement sequence R3; R30 or R3; R300 must be such that the newly introduced
legs do not violate the leg property.
          </p>
        </sec>
      </sec>
      <sec id="sec-5-2">
        <title>Theorem 22. The renfiement rules for portnets preserve a portnet.</title>
        <p>6</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>The Control Flow of an Autonomous Mobile Robot</title>
      <p>We will model the control flow of the navigation system on a mobile robot.
The software system comprises of four main components: The user interface,
the navigation system, the platform controller and the laser scan controller. The
robot perceives its environment by means of a planar laser scanner. The laser
scan controller provides the latest scan as a service. The platform controller is a
composite component and provides two services (a) to set a desired velocity (b)
queries on the latest odometry. The navigation system is capable of creating a
map of its environment and localizing itself on this map using the current laser
scan and odometry services. Furthermore, the navigation system can accept a
waypoint and generate a sequence of velocity commands that drive the
platform to this waypoint while avoiding obstacles. The user interface at the remote
location allows an operator to visualize this map and give waypoint to the
navigation system. While a waypoint is in progress an operator receives feedback on
the progress of this goal. Once the robot has reached its waypoint, the operator
is notified. An architecture of the system is presented in Fig. 2.</p>
      <p>The navigation system is a composite component comprising of the
navigation manager and planning. The latter is again a composite component and
comprises of the global planner, the local planner and the mapping and
localization system. The mapping and localization system is capable of generating a
map and localizing itself using the services offered by the laser scan controller
and platform controller. The global planner accepts a map and a waypoint goal
and generates a global plan (trajectory) from the robot’s current location to the
waypoint goal. The local planner accepts a map and a global plan and
generates a collision free sequence of velocity commands that drive the robot to the
desired waypoint goal. The local planner generates these sequence of velocity
commands in a loop until the destination is reached or a valid plan could not
be found. In each cycle, the local planner makes use of the mapping and
localization system to check its current location and generates feedback on the
progress of this goal. If the destination has arrived then this is notified and the
planner terminates. If at any moment, a valid velocity command could not be
found then this situation is notified and the planner terminates. The
navigation manager provides the waypoint navigation as a service to the user interface
by orchestrating the components of the navigation system in the right order.
The Fig. 4 presents five portents and one orchestration net. From the
architecture diagram in Fig. 2, we know portnet P 5 is nested in P 12 and all other
buy side portnets are nested in the sell side portnet P 4. We may now apply
the construction method to derive the navigation manager in the following way:
(((closure(P 4) r2 O1) r4 P 11) r5 P 13) r1 (P 12 r3 P 5).
7</p>
    </sec>
    <sec id="sec-7">
      <title>Conclusions</title>
      <p>In this paper, we introduced a compositional component framework and a
construction method to design the control flow of a network of components, while
guaranteeing weak termination. The two main concepts of this framework are
portnet and basic component. A portnet models the interface of a basic
component as a state machine which describes the communication protocol underlying
a service negotiation. A basic component provides a service by orchestrating
its portnets in the right way. The weak termination property was then
investigated by first considering compositions of portnets. It turns out that any pair of
compatible portnets that satisfy the leg property and the choice property always
weakly terminate. Furthermore, we prove that an acyclic composition of basic
components also known as a composite component weakly terminates.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref13 ref7">7, 13</xref>
        ], the authors focus on constructing deadlock free systems using
labeled transition systems, i.e., each component is a state machine, which after
composition guarantee deadlock freedom. On the other hand, Petri nets offer a
natural way to make formal models of the control flow of a software system. The
Petri net based construction method provides a structured way to design these
control flows and guarantee weak termination by construction. In this way they
can focus more on the design of each component without having to worry about
deadlocks that could be introduced by a composition of components. The
designers of software systems can use the guiding principles defined by the construction
method during system design .
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>W.M.P. van der Aalst</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.M. van Hee</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.H.M. ter Hofstede</surname>
          </string-name>
          , et al.
          <article-title>Soundness of workflow nets: classification, decidability, and analysis</article-title>
          .
          <source>Formal Aspects of Computing</source>
          ,
          <volume>23</volume>
          (
          <issue>3</issue>
          ):
          <fpage>333</fpage>
          -
          <lpage>363</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>W.M.P. van der Aalst</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.M. van Hee</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Massuthe</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Sidorova</surname>
          </string-name>
          , and
          <string-name>
            <surname>J.M.E.M. van der Werf</surname>
          </string-name>
          .
          <article-title>Compositional Service Trees</article-title>
          .
          <source>In ICATPN</source>
          <year>2009</year>
          , volume
          <volume>5606</volume>
          <source>of LNCS</source>
          , pages
          <fpage>283</fpage>
          -
          <lpage>302</lpage>
          . Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Beisiegel</surname>
          </string-name>
          et al.
          <source>Service Component Architecture - Assembly Model Specification, SCA Version 1.00</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>D.</given-names>
            <surname>Bera</surname>
          </string-name>
          ,
          <string-name>
            <surname>K.M. van Hee</surname>
            ,
            <given-names>M.P.W.J. van Osch</given-names>
          </string-name>
          , and
          <string-name>
            <surname>J.M.E.M van der Werf</surname>
          </string-name>
          .
          <article-title>A Component Framework where Port Compatibility Implies Weak Termination</article-title>
          .
          <source>Technical Report CSR 11-08</source>
          , Technische Universiteit Eindhoven,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>J.</given-names>
            <surname>Carlson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hakansson</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Pettersson. SaveCCM</surname>
          </string-name>
          :
          <article-title>An Analysable Component Model for Real-Time Systems</article-title>
          . Electronic Notes in Theoretical Computer Science,
          <volume>160</volume>
          (
          <issue>1</issue>
          ):
          <fpage>127</fpage>
          -
          <lpage>140</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>J.</given-names>
            <surname>Desel</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Esparza</surname>
          </string-name>
          .
          <source>Free Choice Petri Nets</source>
          , volume
          <volume>40</volume>
          of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>G.</given-names>
            <surname>Gossler</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Sifakis</surname>
          </string-name>
          .
          <article-title>Component-based construction of deadlock-free systems</article-title>
          .
          <source>In FSTTCS</source>
          <year>2003</year>
          , volume
          <volume>2914</volume>
          <source>of LNCS</source>
          , pages
          <fpage>420</fpage>
          -
          <lpage>433</lpage>
          . Springer,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Hatcliff</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Deng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Dwyer</surname>
          </string-name>
          , G. Jung, and
          <string-name>
            <given-names>V.</given-names>
            <surname>Prasad</surname>
          </string-name>
          .
          <article-title>Cadena: An Integrated Development, Analysis, and Verification Environment for Componentbased Systems</article-title>
          .
          <source>In ICSE</source>
          <year>2003</year>
          ,
          <article-title>page 160</article-title>
          . IEEE Press,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>K.M. van Hee</surname>
            ,
            <given-names>A.J.H.</given-names>
          </string-name>
          <string-name>
            <surname>Hidders</surname>
            ,
            <given-names>G.J.P.M.</given-names>
          </string-name>
          <string-name>
            <surname>Houben</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Paredaens</surname>
            , and
            <given-names>P.A.P.</given-names>
          </string-name>
          <string-name>
            <surname>Thiran</surname>
          </string-name>
          .
          <article-title>On the relationship between workflow models and document types</article-title>
          .
          <source>Information Systems</source>
          ,
          <volume>34</volume>
          (
          <issue>1</issue>
          ):
          <fpage>178</fpage>
          -
          <lpage>208</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>K.M. van Hee</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Sidorova</surname>
            , and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Voorhoeve</surname>
          </string-name>
          .
          <article-title>Soundness and Separability of Workflow Nets in the Stepwise Refinement Approach</article-title>
          .
          <source>In ICATPN</source>
          <year>2003</year>
          , volume
          <volume>2679</volume>
          <source>of LNCS</source>
          , pages
          <fpage>337</fpage>
          -
          <lpage>356</lpage>
          . Springer,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>K.M. van Hee</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Sidorova</surname>
          </string-name>
          , and
          <string-name>
            <surname>J.M.E.M. van der Werf</surname>
          </string-name>
          .
          <article-title>Construction of asynchronous communicating systems: Weak termination guaranteed! In Software Composition</article-title>
          , volume
          <volume>6144</volume>
          <source>of LNCS</source>
          , pages
          <fpage>106</fpage>
          -
          <lpage>121</lpage>
          . Springer,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>N.</given-names>
            <surname>Kavantzas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Burdett</surname>
          </string-name>
          , G. Ritzinger,
          <string-name>
            <given-names>T.</given-names>
            <surname>Fletcher</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Lafon</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Barreto</surname>
          </string-name>
          .
          <source>Web Services Choreography Description Language Version</source>
          <volume>1</volume>
          .0. http://www.w3.org/TR/ws-cdl-
          <volume>10</volume>
          /,
          <year>November 2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>K.</given-names>
            <surname>Klai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Tata</surname>
          </string-name>
          , and
          <string-name>
            <given-names>J.</given-names>
            <surname>Desel</surname>
          </string-name>
          .
          <article-title>Symbolic Abstraction and Deadlock-Freeness Verification of Inter-enterprise Processes</article-title>
          .
          <source>In Business Process Management</source>
          , volume
          <volume>5701</volume>
          <source>of LNCS</source>
          , pages
          <fpage>294</fpage>
          -
          <lpage>309</lpage>
          . Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>T.</given-names>
            <surname>Murata</surname>
          </string-name>
          .
          <article-title>Petri nets: Properties, analysis and applications</article-title>
          .
          <source>Proceedings of the IEEE</source>
          ,
          <volume>77</volume>
          (
          <issue>4</issue>
          ):
          <fpage>541</fpage>
          -
          <lpage>580</lpage>
          ,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>J.M.E.M. van der Werf</surname>
          </string-name>
          .
          <article-title>Compositional design and verification of component-based information systems</article-title>
          .
          <source>PhD thesis</source>
          , Technische Universiteit Eindhoven,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>