<!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>An e cient necessary condition for compatibility</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Olivia Oanea</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Karsten Wolf</string-name>
          <email>karsten.wolfg@uni-rostock.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universitat Rostock, Institut fur Informatik 18051 Rostock Germany</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Composing services makes sense only if they are compatible, i.e. composition does not lead to problems such as livelocks or deadlocks. In general, compatibility can be checked using state space explorations on any kind of formal models of services. Petri nets, one of the formal models in use, o er a rich theory for reasoning without exploring a state space. Among the techniques is the so-called state equation which forms a linear algebraic necessary condition for reachability of states. In this article, we show how the state equation can be applied for a necessary condition for compatibility. This way, the number of expensive state space based compatibility checks can be drastically reduced. The condition can be applied even if compatibility is achieved through the construction of a behavioral adapter (mediator).</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Service behaviors are compatible if their composition forms a closed system
(every outbound channel of a service is merged to an inbound channel of some
other service) and all involved services can execute their control ow completely.
Compatibility can be augmented with the requirement that all or certain activities
in the participating services can occur or other semantical constraints.</p>
      <p>
        In this paper we show an approach for alleviating the costs of the compatibility
check for services modeled with Petri nets using their state equation. The state
equation provides a necessary condition for reachability of the nal states of the
services in the composition under several constraints such as the enabling of
some events or choice covering. This result can be applied directly to adapter
synthesis [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Service adaptation (mediation) is a semi-automatic approach of
correcting incompatibilities between services in which transformation rules are
provided normally by hand to correct the message ow. The state equation
provides a necessary condition for the existence of such an adapter that uses the
speci ed rules.
      </p>
      <p>In the remainder of this article, we rst introduce notations for Petri net
models for services and the state equation. Section 3 gives the necessary
conditions for compatibility and derives other necessary conditions for compatibility
under some additional constraints. Section 4 presents a necessary condition to
adaptability. Section 5 concludes the paper.
b
c
d
e
a
b
c
d
e
t1
N
t3</p>
      <p>t5
p0
t4
p
t2
a
b
c
d
e</p>
      <p>N 0</p>
      <p>N 00</p>
    </sec>
    <sec id="sec-2">
      <title>Petri nets as models of services and the state equation</title>
      <p>Let = fa; b; c; : : : g be a nite message type set, ? = f?a; ?b; ?c : : : g a nite
set of receive events, and ! = f!a; !b; !c : : : g a nite set of send events. We also
write ? =! and ? =? .</p>
      <p>
        We consider services modeled as open nets. An open net [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] is a Petri net [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
with a special set of interface places which represent the communication channels
with other nets.
      </p>
      <p>De nition 1. An open net is a tuple N = (P [ Pi [ Po; T; F; m0; Mf ; l), where
{ P; Pi; Po are the pairwise disjunct nite sets of internal/input/output places;
{ T is the nite set of transitions so that (P [ Pi [ Po) \ T = ; which are
labeled by the partial function l : T !? [! ;
{ F : ((P [ Pi [ Po) T ) [ (T (P [ Pi [ Po)) ! N represents the ow function
so that F (p; t) = F (t0; p0) = 0, for all (p; t) 2 Po T and (t0; p0) 2 T Pi;
{ m0; Mf represent the initial state (marking) and the nite set of nal states,
respectively. We consider states as vectors over the set of places.</p>
      <p>
        An open net is called closed when its interface is empty, i.e. Pi [ Po = ;. The
projection of an open net on its transitions and internal places is a closed net
denoted by N . Open nets over ? [! are composed [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] by merging their interface
places (i.e. an input and with an output place denoting the same message channel)
and is denoted by , with the corresponding initial and nal markings. Figure 1
shows three open nets N; N 0; N 00, each with the nal marking with a token on
its double circled place.
      </p>
      <p>A transition t 2 T is enabled in a marking m if F (p; t) m(p) for all places
p. An enabled transition may re yielding a (reachable) marking m0 so that
m0(p) = m(p) F (p; t) + F (t; p) for all places p, which is denoted by m !t m0.
The reachability relation can be extended to sequences of transitions 2 T ,
which is denoted by !. Two open nets are called compatible if their composition
weakly terminates, i.e. from each state reachable from the initial state of the
composition, it is possible to reach a nal state of the composition. A weaker
notion of compatibility is deadlock-freedom, i.e. at each non- nal reachable state
(in the composition) it is possible to re a transition.</p>
      <p>
        Reachability analysis for Petri nets can be achieved by using typical structural
methods, e.g. methods which nd algebraic approximations of the state space
with nite representation. The state equation [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] relates the behavior of a net
(given by states and ring sequences) and its structure (incidence matrix) and
can be solved using standard linear programming [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>The incidence matrix CN 2 N(P [Pi[Po) T is de ned by CN (p; t) = F (t; p)
F (p; t) for all (p; t) 2 (P [ Pi [ Po) T . Let 2 T be transition sequence. The
Parikh vector of is a vector 2 NT whiPch assigns to each transition t 2 T
its number of occurrences in . Let (a) = t2T :l(t)=a (a) denote the number
of occurrences of all transitions labeled by a 2! [? . Given a ring sequence
m ! m0 of N , the ring equations for all places of N and all transitions in
can be written in matrix form m0 = m + C , which is called the state equation.
Proposition 1 (Necessary condition for reachability). For every nite
ring sequence m ! m0 of N , the state equation m0 = m + CN holds.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Necessary condition for compatibility</title>
      <p>We state now a necessary condition for compatibility as weak termination of two
composed open nets. The rst conditions represent the state equations of the
open nets without their interface places. The last condition means that in all
solutions to the equation the number of occurrences of receiving events should
be equal to the number of occurrences for sending events for each such event.
Corollary 1. If N and N 0 are compatible (w.r.t. weak termination), then the
system LP(CNb; CNb0 ; m0; m00; mf ; m0f ; x; x0) imsffea=simble0.+ CNb x x 2 NT
LP(CNb; CNb0 ; m0; m00; mf ; m0f ; x; x0) : m0f = m00 + CNb0 x0 x0 2 NT 0
x(a) = x0(a)</p>
      <p>If the equation does not have any solution then the nal marking will not be
reachable in the composition from the initial marking.</p>
      <p>Remark 1. In case services have more nal states, separate systems of equations
are solved for each possible combination. For the nets N and N 0 in Figure 1
LP(C b; CNb0 ; m0; m00; mf ; m0f ; x; x0) does not have any solution. Therefore, N</p>
      <p>N
and N 0 are incompatible. Note that the converse does not hold, e.g. the nets
N and N 00 in Figure 1, x00(?a) = x(!a) = 2, x(?b) = x00(!b) = 1, x(!d) =
x00(?d) = 1, x(!c) = x00(?c) = 0 and x(!e) = x00(?e) = 0 is a solution for
LP(C b; CNb00 ; m0; m000; mf ; m0f0; x; x00), however N and N 00 are incompatible as we</p>
      <p>N
shall see in the remainder.</p>
      <p>If N N 0 is deadlock-free then at each non- nal reachable marking in the
composition there is an enabled transition, i.e. adding the disabling condition for
each transition leads to an infeasible system.
Several variations for compatibility notions have been introduced [6{8] which
de ne behavioral constraints which can imposed on interacting services. Among
these settings we mention transition cover and place cover.</p>
      <p>Message and event cover
De nition 2. We call an action a in ? [! covered locally/globally i a
transition/all transitions labeled by a in the composition eventually becomes enabled
in the composition. A message place (channel) p 2 Pi [ Po is called covered if
m(p) &gt; 0, for some reachable marking m in the composition.</p>
      <p>Let N and N 0 be two open nets and a 2? [! . We state now conditions
which should be added to LP(CNb; CNb0 ; m0; m00; mf ; m0f ; x; x0) to enforce local,
global event cover, place and message cover.
local event cover x(t) &gt; 0 (t 2 T : l(t) = a) or x0(t0) &gt; 0 (t0 [ T 0 : l(t) = a);
place cover for p 2 P there exists a t 2 T so that F (p; t) &gt; 0 and x(t) &gt; 0
(similarly if p 2 P 0);
global event cover x(t) &gt; 0, for all t 2 T : l(t) = a or x0(a) &gt; 0;
message channel cover x(a) &gt; 0 and x0(a) &gt; 0.</p>
      <p>
        In N N 00 in Figure 1, a is locally covered but not globally covered (transition
t1). The message channel e is covered neither in N N 0 nor in N N 00.
Free-choice sending cover Here, we want to strengthen the previously stated
condition by taking into account that compatibility does not refer to a single
execution (as the state equation would suggest). If an execution passes an
internal decision of one service then its partner needs to be able to react to all
possible outcomes for this decision. With the following consideration, we want to
incorporate this observation into our condition at least for so-called free-choice
decisions [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>Let x 2 P [ T . The con ict cluster (x) of x is the smallest set satisfying
(1) : x 2 (x), (2) : 8q 2 T : q \ (x) 6= ; =) q 2 (x) and (3) : 8q 2
P : q \ (x) 6= ; =) q 2 (x). We write when x is clear from the context.
A con ict cluster (x) so that j (x)j &gt; 2 is called a sending free-choice con ict
cluster (SC) i for all t1; t2 2 \ T , t1 \ t2 6= ; implies t1 = t2 and l(t) 2!
for all t 2 T \ . In Figure 1 fp; t1; t2g represents such a SC in N . Note that a
SC in N is also a SC in N .</p>
      <p>A SC in the composition of two nets N and N 0 is called covered if each
transition of the SC is in some ring sequence from the initial marking to the
nal marking of the composition. For compatible partners, every reachable SC
in a service should be resolved by the partner.</p>
      <p>Corollary 3. Let be a SC with \ T = ft1; t2g in N . If N and N 0 are
compatible and is covered in N N 0, then CLP(CNb; CNb0 ; ) is feasible.</p>
      <p>LP(C b; CNb0 ; m0; m00; mf ; m0f ; x; x0)</p>
      <p>N
LP(C b; CNb0 ; m0; m00; mf ; m0f ; x; x0)</p>
      <p>N
CLP(CNb; CNb0 ; ) : x(t1) &gt; 0 ^ x0(t2) &gt; 0
f 0 SC in N 0j 0 \ T 0 = ft01; t02g ^ x(t01) &gt; 0 ^ x0(t02) &gt; 0^</p>
      <p>^l0(t01) = l(t1) ^ l0(t02) = l(t2)g</p>
      <p>The last condition checks for the existence of a con ict cluster 0 receiving
the messages sent by . The open nets N and N 00 in Figure 1 are incompatible
as CLP(C b; CNb0 ; ) has no solutions (the choice between the transitions labeled</p>
      <p>N
by !a and !d in N 00 is not covered) even if LP(C b; CNb00 ; m0; m000; mf ; m0f0; x; x00)
N
has solutions.</p>
      <p>Remark 2 (deadlock-freedom under constraints cover). We can relax the
deadlockfreedom condition in Corollary 2 to express a necessary condition for local event
(transition) cover and SC cover:</p>
      <p>W
t cover
SC cover
pW:FN N (p;t)&gt;0(m + m0 + m00)(p)
p:FN N (p;t)&gt;0(m + m0 + m00)(p)</p>
      <p>FN N0 (p; t), where t 2 T [ T 0;</p>
      <p>FN N0 (p; t) for all t 2 .</p>
      <p>Remark 3 (behavioral SC). The transition t4 of N in Figure 1 is dead and
removing it from N does not in uence compatibility of N with any other partner.
Hence we can consider \behavioral" SC's (e.g. fp0; t3; t5g) to be checked for
cover.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Necessary condition for adapter synthesis</title>
      <p>
        The open nets N1 and N2 in Figure 2 do not satisfy the necessary condition in
Corollary 1, hence they are incompatible. Adapters are used to solve
incompatibilities between interacting services. We consider here the approach in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] with
weak termination as compatibility notion, where adapters are partially speci ed
by transformation rules on messages called SEA (Speci cation of Elementary
Actions). A general rule is described by r : x 7! x0, where x 2 N! and x0 2 N? .
b
c
d
AE
tr1 r1: 7→?a
The example in Figure 2 shows typical transformation rules: creation of a message
(e.g. !d 7!), deletion of a message (7!?c), splitting a message into two messages
(!b 7!?b0+?b00). Each transformation rule is transformed into an open net which
communicates with the initial services and with an entity which controls the
application of these rules (e.g. the transition t1) and the sending/receiving of
r
messages (denoted by dashed arrows). The open net obtained from the
transformation rules is called partial adapter AE . The adapter synthesis procedure
computes a partner C which controls N1 AE N2 and the nal adapter is
C AE .
      </p>
      <p>A direct consequence of Corollary 1 is that compatible partners have a solution
to their own state equation. We state this condition for the adapter setting.
Corollary 4. If N1 and N2 are adaptable by the set of transformation rules R,
then the state equation for N1 \AE N2 with initial marking m10 + m20 and nal
marking mf1 + mf2 holds.</p>
      <p>The state equation for N1 \AE N2, where AE is the partial adapter for the
rules fr1; r3; r4g, does not yield any solution, thus N1 and N2 are not adaptable
by fr1; r3; r4g.</p>
      <p>In addition, we can formulate a necessary condition for transformation rule
cover. Let r : ! 0. We add to the state equation of N1 \A N2 the
constraint x(tr) &gt; 0, where tr is the transition corresponding to the application of
the rule. Thus, we can eliminate rules which will never be red in conjunction
with a proper terminating execution. In Figure 2, r3 and r4 are redundant rules.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>
        In this paper we stated some necessary conditions for service compatibility using
the state equation for Petri nets. The advantage of using this approach to state
space methods (e.g. [9{11]) is its lower computational complexity [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] (polynomial
for real solutions/exponential in the worst case for integer solutions). An area
of application for this approach is service discovery and service composition [
        <xref ref-type="bibr" rid="ref2 ref8">8,
2</xref>
        ], i.e. nding well-behaved partners for a particular service in a repository of
services. Service discovery and composition are inherently costly job (both from
time and space) w.r.t. the size of the repository and of the services themselves.
Using such a quick check can ease the task of a broker for discovering/adapting
potentially compatible partners for a service by disposing of those services which
do not satisfy the necessary criterion.
      </p>
      <p>
        The approach presented in this paper allows for (in)compatibility to be
analyzed in a compositional way (incorrectness of a component can be used to
derive the incorrectness of the composition). This is complementary to structural
methods used in soundness analysis [
        <xref ref-type="bibr" rid="ref12 ref13">12, 13</xref>
        ] of monolithic work ow. As future
work, we plan to implement the state equation approach as a preliminary check for
service composition and adaptability and evaluate the e ciency of this approach
in the large on a set of case studies provided by industry.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Gierds</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mooij</surname>
            ,
            <given-names>A.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Specifying and generating behavioral service adapter based on transformation rules</article-title>
          .
          <source>Technical Report CS-02-08</source>
          , Universitat Rostock, Rostock, Germany (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Does my service have partners? LNCS ToPNoC 5460(II) (</article-title>
          <year>2009</year>
          )
          <volume>152</volume>
          {171 Special Issue on Concurrency in
          <source>Process-Aware Information Systems.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Desel</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Esparza</surname>
          </string-name>
          , J.:
          <article-title>Free Choice Petri nets</article-title>
          . Volume
          <volume>40</volume>
          of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Narrowing Petri net state spaces using the state equation</article-title>
          .
          <source>Fundam. Inform</source>
          .
          <volume>47</volume>
          (
          <issue>3-4</issue>
          ) (
          <year>2001</year>
          )
          <volume>325</volume>
          {
          <fpage>335</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Schrijver</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Theory of Linear and Integer Programming</article-title>
          . Wiley-Interscience series in discrete mathematics. John Wiley &amp; Sons (
          <year>1986</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>On synthesizing behavior that is aware of semantical constraints</article-title>
          .
          <source>In: Proceedings of AWPN 2008. Volume 380 of CEUR Workshop Proceedings</source>
          ., CEURWS.org (
          <year>2008</year>
          )
          <volume>49</volume>
          {
          <fpage>54</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Massuthe</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Behavioral constraints for services</article-title>
          .
          <source>In: BPM 2007</source>
          .
          <article-title>Volume 4714 of LNCS</article-title>
          . (
          <year>2007</year>
          )
          <volume>271</volume>
          {
          <fpage>287</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Stahl</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wolf</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Deciding service composition and substitutability using extended operating guidelines</article-title>
          .
          <source>Data Knowl. Eng</source>
          . (
          <year>2008</year>
          )
          <article-title>(Accepted).</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Fu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bultan</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Su</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>Analysis of interacting BPEL web services</article-title>
          .
          <source>In: WWW '04</source>
          ,
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2004</year>
          )
          <volume>621</volume>
          {
          <fpage>630</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Schlinglo</surname>
            ,
            <given-names>B.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martens</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Modeling and model checking web services</article-title>
          .
          <source>Electr. Notes Theor. Comput. Sci</source>
          .
          <volume>126</volume>
          (
          <year>2005</year>
          )
          <volume>3</volume>
          {
          <fpage>26</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Mateescu</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Poizat</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Salaun, G.:
          <article-title>Adaptation of service protocols using process algebra and on-the- y reduction techniques</article-title>
          .
          <source>In: ICSOC. Volume 5364 of LNCS</source>
          . (
          <year>2008</year>
          )
          <volume>84</volume>
          {
          <fpage>99</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>K. van Hee</surname>
          </string-name>
          ,
          <string-name>
            <surname>Oanea</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sidorova</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Voorhoeve</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Verifying generalized soundness for work ow nets</article-title>
          .
          <source>In: PSI</source>
          . Volume
          <volume>4378</volume>
          of LNCS., Springer (
          <year>2007</year>
          )
          <volume>235</volume>
          {
          <fpage>247</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Verbeek</surname>
            , H.M.W., van der Aalst,
            <given-names>W.M.P.</given-names>
          </string-name>
          :
          <article-title>Wo an 2.0: A Petri-net-based work ow diagnosis tool</article-title>
          .
          <source>In: ATPN 2000</source>
          .
          <article-title>Volume 1825 of LNCS</article-title>
          ., Springer (
          <year>2000</year>
          )
          <volume>475</volume>
          {
          <fpage>484</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>