• Ingen resultater fundet

OpenMaps(at)Work BRICS

N/A
N/A
Info
Hent
Protected

Academic year: 2022

Del "OpenMaps(at)Work BRICS"

Copied!
36
0
0

Indlæser.... (se fuldtekst nu)

Hele teksten

(1)

BRI C S R S -95-23 Ch e n g & Nie ls e n : Op e n M a p s (at) W o r k

BRICS

Basic Research in Computer Science

Open Maps (at) Work

Allan Cheng Mogens Nielsen

BRICS Report Series RS-95-23

(2)

Copyright c 1995, BRICS, Department of Computer Science University of Aarhus. All rights reserved.

Reproduction of all or part of this work is permitted for educational or research use on condition that this copyright notice is included in any copy.

See back inner page for a list of recent publications in the BRICS Report Series. Copies may be obtained by contacting:

BRICS

Department of Computer Science University of Aarhus

Ny Munkegade, building 540 DK - 8000 Aarhus C

Denmark

Telephone: +45 8942 3360 Telefax: +45 8942 3255 Internet: BRICS@brics.dk

BRICS publications are in general accessible through WWW and anonymous FTP:

http://www.brics.dk/

ftp ftp.brics.dk (cd pub/BRICS)

(3)

Open Maps (at) Work

?

Allan Cheng1 and Mogens Nielsen2

1 Department of Computer Science, Cornell University, Ithaca NY 14853, USA visiting from University of Aarhus, Denmark

e-mail:acheng@cs.cornell.edu

2 BRICS, Department of Computer Science, University of Aarhus, Denmark e-mail:mn@daimi.aau.dk

Abstract. The notion of bisimilarity, as defined by Park and Milner, has turned out to be one of the most fundamental notions of operational equivalences in the field of process algebras. Not only does it induce a congruence (largest bisimulation) in CCS which have nice equational properties, it has also proven itself applicable for numerous models of parallel computation and settings such as Petri Nets and semantics of functional languages. In an attempt to understand the relationships and differences between the extensive amount of research within the field, Joyal, Nielsen, and Winskel recently presented an abstract category- theoretic definition of bisimulation. They identify spans of morphisms satisfying certain “path lifting” properties, so-called open maps, as a possible abstract definition of bisimilarity. In [JNW93] they show, that they can capture Park and Milner’s bisimulation. The aim of this pa- per is to show that the abstract definition of bisimilarity is applicable

“in practice” by showing how a representative selection of well-known bisimulations and equivalences, such as e.g. Hennessy’s testing equiva- lence, Milner and Sangiorgi’s barbed bisimulation, and Larsen and Skou’s probabilistic bisimulation, are captured in the setting of open maps and hence, that the proposed notion of open maps seems successful. Hence, we confirm that the treatment of strong bisimulation in [JNW93] is not a one-off application of open maps.

1 Introduction

As a response to some of the numerous models for concurrency proposed in the literature Winskel and Nielsen have used category theory as an attempt to understand the relationship between models like event structures, Petri nets, trace languages, and asynchronous transition systems [WN94]. From the alge- braic point of view many of the operators of CCS like process algebras have been recasted using category-theoretic concepts such as products, co-products. How- ever, a similar convincing category-theoretic way of adjoining abstract equiva- lences to a category of models had been missing until Joyal, Nielsen, and Winskel

?This work has been supported by The Danish Research Councils, The Danish Re- search Academy, and BRICS, Basic Research in Computer Science, Centre of the Danish National Research Foundation

(4)

proposed the notion of span of open maps [JNW93]. They show how these can capture Park and Milner’s strong bisimulation and identify anewbisimulation, strong history-preserving bisimulation, on models with independence like event structures and Petri nets.

As a measure of the applicability of open maps as an abstract definition of equivalences we show that it is possible to capture not only Park and Milner’s strong bisimulation but a representative selection of well-known bisimulations, such as e.g. Milner and Sangiorgi’s barbed bisimulation and Larsen and Skou’s probabilistic bisimulation. The presentation also serves as a tutorial on how open maps are applied. Although we do not identify new bisimulations, the reader should have no trouble using this setting on his or hers favourite model of computation. As an exercise, the reader is encouraged to prove the claims and proofs which are left out. Along, we make several observations clear which are either rather implicit in [JNW93, JNW94] or not mentioned at all.

The rest of the paper is structured as follows. In the next section we give a short stepwise introduction to open maps as presented in [JNW93, JNW94].

Then, in the subsequent sections, we apply the theory of open maps by instantiat- ing the definitions with different models and notions of (simulation) morphisms and characterise the obtained abstract notion of equivalence operationally. It turns out that our choices of categories, which are guided by our intuitive un- derstanding of what it means for a system to simulate another, yield well known notions of equivalence. More specifically, the following Sect. 3 to Sect. 7 are devoted to trace equivalence, weak bisimulation, testing equivalence, barbed bisimulation, and probabilistic bisimulation. In each of the sections we follow the steps presented in Sect. 2, the section recalling the general theory. Finally, in Sect. 8 we conclude with some remarks and hints for future research.

2 Open Maps, an Introduction

In this section we briefly recall the basic definitions from [JNW93].

As presented there, the general setting requires several steps. First, a category which represents a model of computation has to be identified. We denote this category M. A morphism m : X −→ Y in M should intuitively be thought of as a simulation of X in Y. Then, within M we choose a subcategory of

“observation objects” and “observation extension” morphisms between these objects. We denote this category of observations by P. Given an observation (object) P inP and a model X inM.P is said to be an observable behaviour ofX if there exists a morphismp:P −→X inM.

Next, we identify morphisms m : X −→ Y which have the property that whenever an observable behaviour of X can be extended viaf inY then that extension can be matched by an extension of the observable behaviour inX.

Definition 1. Open Maps

A morphismm:X−→Y inMis said to beP-openif wheneverf :O1−→O2

inP,p:O1−→X,q:O2−→Y inM, and the diagram

(5)

O1

f

//

p

X

m

O2 q //Y

(1)

commutes, i.e.mp=qf, there exists a morphismh:O2−→X inMsuch that the two triangles in the diagram

O1

f

//

p

X

m

O2

>>

~~ h~~~q ~~~ ~~~//Y

(2)

commute, i.e.p=hf and q=mh. When no confusion is possible, we refer toP-open morphisms asopen maps.

The abstract definition of bisimilarity is as follows.

Definition 2. P-bisimilarity

Two modelsX andY inMare said to beP-bisimilar, writtenXP Y, if there exists aspan of open mapsfrom a common objectZ:

Z



m

~ ~ ~ ~~ ~ ~ ~ ~ ~

m0

@@@@@@@@@@

X Y

(3)

Notice that ifMhas pullbacks, it can be shown that∼P is an equivalence rela- tion. The important observation is that pullbacks of open maps are themselves open maps. For more details, the reader is referred to [JNW93].

In the next sections, we proceed by following the above presented steps.

As a preliminary example of a category of models of computation M we present labelled transition systems.

Definition 3. Alabelled transition systemoverActis a tuple

(S, i, Act,−→) , (4)

where S is a set of states with initial state i, Act is a set of actions ranged over by α, β, . . . , and −→⊆ S ×Act×S is the transition relation. For the sake of readability we introduce the following notation. Whenever (s0, α1, s1), (s1, α2, s2),. . ., (sn1, αn, sn)∈−→ we denote this ass0

α1

−→s1 α2

−→ · · ·−→αn sn

ors0

−→v snwherev=α1α2· · ·αnAct. Also, we assume that all statessS are reachable fromi, i.e. there exists avAct such thati−→v s.

(6)

Let us briefly remind the reader about Park and Milner’s definition of strong bisimulation.

Definition 4. LetT1= (S1, i1, Act,−→1) andT2= (S2, i2, Act,−→2). Astrong bisimulation between T1 and T2 is a relationRS1×S2 such that

(i1, i2)∈R , (5)

((r, s)∈Rr−→α 1r0) ⇒ for somes0, (s−→α 2s0 ∧ (r0, s0)∈R) , (6) ((r, s)∈Rs−→α 2s0) ⇒ for somer0, (r−→α 1r0 ∧ (r0, s0)∈R) . (7) T1 andT2 are said to bestrongly bisimilarif there exists a strong bisimulation between them.

Henceforth, whenever no confusion is possible we drop the indexing subscripts on the transition relations and write−→instead.

By defining morphisms between labelled transition systems we can obtain a category of models of computation,LTS, labelled transition systems.

Definition 5. Let T1 = (S1, i1, Act,−→1) and T2 = (S2, i2, Act,−→2). A mor- phismm:T1−→T2 is a functionm:S1−→S2 such that

m(i1) =i2 , (8)

s−→α 1s0m(s)−→α 2m(s0) . (9) Composition of morphisms is defined as the usual composition of functions.

The intuition behind this specific choice of morphism is that anαlabelled tran- sition inT1 must be simulated by anαlabelled transition inT2.

If, as done in [JNW93], one choosesP as the full subcategory ofM whose objects are finite synchronisation trees with at most one maximal branch, i.e.

labelled transition systems of the form i−→α1 s1

α2

−→ · · ·−→αn sn ,

P-bisimilarity corresponds to Park and Milner’s strong bisimulation. This follows from the following characterisation ofP-open maps [JNW93].

Lemma 6. A morphism m :T1 −→T2 is P-open if and only if it satisfies the following “zig-zag” property:

If m(r)−→α sthen there exists an r0 such thatr−→α r0 and m(r0) =s.

In the following sections we shall “rediscover” well-known behavioural equiv- alences by varyingMandP. In the following, whenever we write e.g.M,P, or P-bisimilarity they refer to the specific choices of categories made in the section they appear.

(7)

3 Trace Equivalence

In this section we show how trace equivalence between two labelled transition systems can be captured by open maps. Trace equivalence is perhaps the first and simplest equivalence between labelled transition systems that one can think of. The result is based on the following important fact: Two labelled transi- tion systems are trace equivalent if and only if their underlying deterministic transition systems are bisimilar.

First, we present the categoryLTS1 oflabelled transition systems, which will corresponds toM. Then, we identify a subcategory,P, of observations. Finally, we show thatP-bisimilarity corresponds to trace equivalence.

The object ofLTS1are the labelled transition systems (lts) from Definition 3. The following definition is needed in the definition of the morphisms inLTS1. Definition 7. Given an lts T = (S, i, Act,−→). For nonempty sets X, YS, we defineX −→α Y ifY ={r0S| ∃rX. r−→α r0}. Notice that this transition relation is deterministic. As before, the transition relation can be generalised to a relation X −→v Y, where vAct. Furthermore, we define RS(T), the reachability set of T, to be the least subset of 2S/{∅}, such that

{i} ∈RS(T) , (10) XRS(T) andX −→α Y impliesYRS(T) . (11) Next, we define morphisms between twolts’s.

Definition 8. Given two lts’s,Tj = (Sj, ij, Act,−→j), j= 1,2. A morphism m between T1andT2 is a functionmfromRS(T1) toRS(T2), such that

m({i1}) ={i2} , (12) X −→α Y impliesm(X)−→α m(Y) . (13) Composition of morphisms is defined as the usual composition of functions.

This defines the categoryLTS1.

The intuition behind this definition of (simulating) morphism is that one is only interested in what action sequences anlts can perform. After performing a sequence σ=α1· · ·αn of actions from the initial stateione may in general end up in several different states ofT, i.e. a setX of states ofT. These sets of states are exactly the elements of RS(T). Extending the sequence σ by performing another actionαthen corresponds to performing an αtransition fromX.

Next step is to defineP.

Definition 9. Let P be the full subcategory ofLTS1 whose objects are of the form

i−→α1 r1 α2

−→ · · ·−→αn rn , (14) where all states are distinct.

(8)

Apart from showing that LTS1 has pullbacks, the construction in the fol- lowing lemma will be referred to in the main theorem of this section. Also, it follows at once from the remarks in Sect. 2 thatP-bisimilarity is an equivalence relation. We will also be able to conclude this after proving the main theorem of this section; it states thatP-bisimilarity coincides with trace equivalence, which is know to be an equivalence relation. However, in general one cannot expect thatP-bisimilarity coincides with a known equivalence relation. Lemmas as the following are sufficient forP-bisimilarity to be an equivalence relation.

Lemma 10. LTS1 has pullbacks.

Proof. Given a diagram

T1

m1

<<<<<<<<< T2

m2

T

Define an lts T0 = (S0, i0, Act,−→0) as follows. S0RS(T1RS(T2) and

−→0⊆ (RS(T1RS(T2))×Act×(RS(T1RS(T2)) are the least sets such that

i0= ({i1},{i2})∈S0

If (X, Y)∈S0,X −→α X0,Y −→α Y0

then (X0, Y0)∈S0 and ((X, Y), α,(X0, Y0))∈−→0.

Notice that because the transition relations on the reachability sets are deter- ministic it is the case that m1(X) = m2(Y) for any (X, Y) ∈ S0 and RS(T0) contains only singletons. Letπ1:T0 −→T1 be defined as π1({(X, Y)}) =X. It can be shown thatπ1 is well defined and is a morphism fromT0 to T1. We can defineπ2:T0−→T2 in a similar way.

Given an lts T00 and two morphisms f1 : T00 −→ T1 and f2 : T00 −→ T2

such that m1f1 = m2f2. Define h: T00 −→ T0 byh(Z) = (f1(Z), f2(Z)) for ZRS(T00). From the definition ofT0 is should be easy to see that his a morphism; the initial state of T00 is mapped to that of T0 and transitions are preserved. Furthermore we also havef1=π1handf2=π2h. This is trivial, since there is at most one morphism between any two objects inLTS1. Hence, his also unique. This gives us the desired pullback. ut

The next lemma characterises the open maps inLTS1.

Lemma 11. A morphismm:T1−→T2isP-open if and only ifm:RS(T1)−→

RS(T2)has the following ”zig-zag” property

If m(X)−→α Y0, then there exists an X0 such thatX −→α X0 and m(X0) =Y0. Proof. Assume m isP-open andm(X) −→α Y0. Then it must be the case that X0

α1

−→X1 α2

−→ · · ·−→αn Xnfor someX0, . . . , XnRS(T1), whereX0 ={i1}and

(9)

Xn=X. Also, we haveY0 α1

−→Y1 α2

−→ · · ·−→αn Yn

−→α Y0, whereYj=m(Xj) for 0≤jn. LetO1be the observation

i−→α1 s1 α2

−→ · · ·−→αn sn , andO2be the observation

i0−→α1 s01−→ · · ·α2 −→αn s0n −→α s0n+1 .

Now let f denote the unique morphism fromO1to O2,pdenote the morphism that maps{i}to{i1}and{sj}toXj for 1≤jn, andqdenote the morphism that maps {i0} to {i2},{s0j} to Yj for 1 ≤jn, and {s0n+1}to Y0. We then have mp = qf. From our assumptions it then follows that there exists a morphism h : O2 −→ T1 such that p = hf and q = mh. We now conclude h({s0n}) = h(f({sn})) = p({sn}) = X, h({s0n}) −→α h({s0n+1}), and m(h({s0n+1})) =q({s0n+1}) =Y0. Now chooseX0 ash({s0n+1}).

Conversely, assumem has the “zig-zag” property and we are given a com- muting diagram

O1

f

//

p

X

m

O2 q //Y

where O1 is an observations of the form i−→α1 s1

α2

−→ · · ·−→αn sn , andO2an observation of the form

i0−→α1 s01−→ · · ·α2 −→αm s0m ,

andnm. Noticef is uniquely determined (maps{sj}to{s0j}for 1≤jn).

We will show how to define a morphism h : O2 −→ T1 such that p = hf and q=mh. We start by defining h({i0}) ={i1}and h({s0j}) =p({sj}) for 1≤jn. Notice that we now already havep=hf for the partially definedh.

Consequently,q=mhon{i0},{s01}, . . . ,{s0n}because of the wayf is defined and mp = qf. Now assume n < m. Since m(p({sn})) = q(f({sn})) = q({s0n})α−→n+1q({s0n+1}) we know there must exist anX0 such thatp({sn})α−→n+1 X0andm(X0) =q({s0n+1}). Now defineh({s0n+1}) =X0. Thenm(h({s0n+1})) = q({s0n+1}). Continuing this way for the remaining {s0n+2}, . . . ,{s0m}we obtain

the desired morphism. ut

(10)

Definition 12. Given anltsT = (S, i, Act,−→). Thetraces/language ofT, de- noted L(T), is defined as

L(T) ={vAct|i−→v rfor somerS} . (15) Twolts’s,T1andT2, are said to betrace equivalentifL(T1) =L(T2).

Theorem 13. Given twolts’sT1 and T2. Then:

T1 and T2 are trace equivalent if and only if they areP-bisimilar.

Proof. The “if” direction follows from Lemma 11. For the “only if” direction, let F1 be the functor from LTS1to LTS which sends an object T to (RS(T),{i}, Act,−→), where−→was defined in Definition 7, and an morphismm:T −→T0 to the obvious morphism between F1(T) andF1(T0) defined bym:RS(T)−→

RS(T0). Let F2 be the functor from LTS to LTS1 which maps an object to itself and a morphism m : T −→ T0 to the morphism determined uniquely by the induced functionm:RS(T)−→RS(T0). Since all observations ofLTS1are isomorphic to their image underF1and there is at most one morphism between any two objects in LTS1, we conclude, using Lemma 6, thatF2preserves open maps. So assume thatT1andT2are trace equivalent. We then know thatF1(T1) andF1(T2) are strong bisimilar. From Sect. 2 this implies that there exists a span of open maps in LTS,m1 : T −→ F1(T1) andm2 :T −→ F1(T2). Also, there clearly exist isomorphismsp1 :F2(F1(T1))−→ T1 and p2 :F2(F1(T2))−→T2. Since isomorphisms are always open maps we have the following span of open maps:

F2(T)

zz

F2(m1)

t t t t t t t t t t t

$$

F2(m2)

JJJJJJJJJJJ

F2(F1(T1))

{{

p1

w w ww w w w w ww w F2(F1(T2))

##

p2

GGGGGGGGGGG

T1 T2

We conclude that T1 and T2 are P-bisimilar. Observe that a construction similar to the one used in Lemma 10 would also have provided a span of open

maps. ut

Having identified trace equivalence we now continue by exploring other pos- sibilities. In the next section we try to take “invisible” or “silent” actions into account.

4 Weak Bisimulation (Milner)

In this section we show that Milner’s weak bisimulation[Mil89] can be charac- terised using the general setting of Sect. 2.

(11)

Weak bisimulation differs from strong bisimulation in at least two respects.

First, a special “invisible” action, usually denotedτ, is required to be a member of the set of labels. Second, an αlabelled transition in one labelled transition system is no longer required to be simulated exactly by anαlabelled transition in the other system. It may be preceded and succeeded by several τ transition.

We write r =⇒t r0 if r −→τ r1 α1

−→ r01 −→ · · ·τ −→τ rn αn

−→ r0n −→τ r0 for some r1,· · ·, r0n. Furthermore, aτ transition needn’t be simulated by any transitions at all.

We start by defining a category LTS2, labelled transition systems, and a subcategory of observations, P, in LTS2. Then, we show that P-bisimilarity corresponds to Milner’s weak bisimulation.

The objects ofLTS2 are the same as those fromLTS. However, we assume that the set of actions Act contains a special “invisible” action τ. Guided by our intuitive understanding of how an action may be simulated, we define the morphisms between twolts’s as follows.

Definition 14. Given two lts’s, Tj = (Sj, ij,Act,−→j), j = 1,2. A morphism between T1andT2,m:T1−→T2, is a functionmfromS1 to S2, such that

m(i1) =i2 , (16)

r−→α r0impliesm(r)=bαm(r0) . (17) The functionb:Act−→Act removes allτ’s from its argument [Mil90].

Composition of morphisms is defined as the usual composition of functions.

This defines the category LTS2. P, the category of observations, is defined as follows.

Definition 15. LetPbe the subcategory ofLTS2whose objects are of the form i−→α1 r1

α2

−→ · · ·−→αn rn , (18) where all the states are distinct. Moreover, there will be a morphismf from an observation

i−→α1 r1 α2

−→ · · ·−→αn rn (19) to another observation

i0 −→α1 r01−→ · · ·α2 −→αn rn0 α−→ · · ·n+1 α−→n+krn+k0 , (20) iff(i) =i0,f(rj) =rj0 for 1≤jn, andk≥0.

Notice that morphisms between observations are required to simulate action in the “strong” sense — e.g. no additionalτ’s may be added. In the conclusion, Sect. 8, we will comment on this interesting choice. Allowing any morphism between two observations will in fact make P-bisimilarity stronger than weak bisimulation; the reader should have no major difficulties in going through the proofs. Lemma 17 will no longer be true, neither will the “only if” in Theorem 19.

Having definedMasLTS2 andP we now show thatLTS2 has pullbacks.

(12)

Lemma 16. The categoryLTS2 has pullbacks.

Proof. Given a diagram

T1

m1

<<<<<<<<< T2

m2

T

Define T0 = (S0, i0,Act,−→0) as follows.S0S1×S2 and −→0⊆ (S1×S2Act×(S1×S2) are the least sets such that

i0= (i1, i2)∈S0

If (r, s)∈S0, r=bαr0,s=bαs0, and m1(r0) =m2(s0) then (r0, s0)∈S0 and ((r, s), α,(r0, s0))∈−→0.

Defineπ1:T0 −→T1andπ2:T0−→T2 asπ1((r, s)) =randπ2((r, s)) =s.

We now show that this defines a pullback. Clearly,π1andπ2are morphisms.

Assume we have a commuting diagram T00

f

//

g T2

m2

T1 m //

1 T

Define h : S00 −→ S1×S2 as h(v) = (f(v), g(v)) for vS00. It should be easy to see, using the commutativity of the diagram and the definition of T0, that h(v)S0, since v is reachable fromi00, and that v −→α v0 in T00 implies h(v) −→α h(v0) inT0. h is then a well defined morphism from T00 to T0. Also, f =π1hand g=π2hand moreover these equations determinehuniquely.

Hence, T0,π1, andπ2constitute a pullback. ut Next, we characterise the open maps.

Lemma 17. A morphismm:T1 −→T2 isP-open if and only if it satisfies the following “zig-zag” property:

If m(r)−→α sthen there exists an r0 such thatr=bαr0 and m(r0) =s.

Proof. Assume m is open and i1 α1

−→ r1 α2

−→ · · · −→αn rn = r. Let O1 be the observation

i−→α1 r01−→ · · ·α2 −→αn r0n , O2be the observation

i0 −→α1 r001 −→ · · ·α2 −→αn r00n−→α s00 ,

(13)

andf the unique morphism fromO1toO2. Letp:O1−→T1 be the morphism which sendsr0j to rj for 1≤jn, andq:O2−→T2 the morphism that sends rj00 to m(rj) for 1≤jn and s00 to s. Then mp=qf and since m is an open map there exists a morphismh:O2−→T1 such that the two triangles in the diagram

O1

f

//

p T1

m

O2

>>

}} h}}}q}}} }}}//T2

commutes. Since h(rn00) =bαh(s00), h(r00n) = h(f(r0n)) = p(rn0) = rn, and s = q(s00) =m(h(s00)), we conclude thath(r00n) =rn =r=bαh(s00) andm(h(s00)) =s.

Hence, there exists a r0=h(s00) such thatr=bαr0 andm(r0) =s.

For the other direction, assume m has the “zig-zag” property and we are given a commuting diagram of the form

O1

f

//

p T1

m

O2 q //T2 where O1 is an observation of the form

i−→α1 r1 α2

−→ · · ·−→αn rn , O2is an observation of the form

i0 −→α1 r01−→ · · ·α2 −→αn rn0 α−→ · · ·n+1 α−→n+krn+k0 ,

and f : O1 −→ O2 is the uniquely determined morphism which sends rj to r0j for 1≤jn.

We show that there exists a morphism h: O2 −→ T1 such that p= hf andq =mh. Apart from definingh(r0j) =p(rj) for 1≤jn, and of course h(i0) =i1, let us consider which value we should giveh(r0n+1). Assumeq(r0n)α=dn+1q(r0n+1) because q(rn0) −→β1 v1

β2

−→ · · ·β−→l−1 vl1 βl

−→ q(r0n+1), where l ≥0 and d

αn+1=β1d· · ·βl. By commutativity we havem(p(rn)) =q(rn0) and by repeated use of the “zig-zag” property we conclude that there exist states wj such that p(rn)=βb⇒1 w1 =βb⇒ · · ·2 =βb⇒l wl, m(wj) =vj for 1≤j < l, andm(wl) = q(r0n+1).

Define h(r0n+1) = wl. Then h(r0n) α=dn+1h(r0n+1) and m(h(rn+10 )) = m(wl) = q(r0n+1). Continuing this process for the remaining rn+20 , . . . , r0n+k it is easy to see that we obtain a morphismh:O2−→T1 such thatp=hf andq=mh.

Hence, mis an open map. ut

(14)

For the sake of completeness we give Milner’s definition of weak bisimulation [Mil89], here adapted to the case where we consider initial states oflts’s.

Definition 18. Given twolts’sT1 andT2. A relationRS1×S2 is said to be aweak bisimulationoverT1 and T2 if

(i1, i2)∈R , (21)

((r, s)∈Rr−→α r0) ⇒ for somes0, (s=bαs0 ∧ (r0, s0)∈R) , (22) ((r, s)∈Rs−→α s0) ⇒ for somer0, (r=bαr0 ∧ (r0, s0)∈R) . (23) T1 andT2are said to be weakly bisimilarif there exists a weak bisimulation as defined above.

We now show thatP-bisimilarity coincides with weak bisimulation.

Theorem 19. Given twolts’sT1 and T2. Then,

T1 and T2 are weakly bisimilar if and only if T1 and T2 areP-bisimilar.

Proof. AssumeRis a weak bisimulation overT1andT2. DefineT0= (S0, i0,Act,

−→0), whereS0S1×S2, as follows. LetS0 and−→0 be the least sets such that i0= (i1, i2)∈S0

If (r, s)∈S0,r=bαr0, s=bαs0, and (r0, s0)∈R, then (r0, s0)∈S0 and ((r, s), α,(r0, s0))∈−→0.

Notice that S0R. Now definep:T0 −→T1 as p((r, s)) =rand q:T0 −→T2 asq((r, s)) =s. From the definitions and the above observation it should be easy to see thatpand qare open maps, i.e.T1 andT2 areP-bisimilar.

AssumeT1andT2 areP-bisimilar, i.e. there exist a span of open maps T



m1

~ ~ ~ ~~ ~ ~ ~ ~ ~

m2

@@@@@@@@@@

T1 T2

It is enough to show thatT andT1are weakly bisimilar since weak bisimulation is an equivalence relation. DefineRto be the least relation inS×S1 such that

(i, i1)∈R,

If (r, s)∈R andr−→α r0 then (r0, m1(r0))∈R, and

If (r, s)∈ R and s−→α s0 then (r0, s0)∈R where r0 is any state such that r=bαr0 andm1(r0) =s0. Such a state exists by Lemma 17.

Notice that (r, s)∈R impliesm1(r) =s. Hence, in the last items=m1(r)=bαm1(r0). It is now easy to show thatRis a weak bisimulation overT andT1. ut

(15)

5 Testing Equivalence (Hennessy)

In this section we modify the category from Sect. 3 (basically) only with respect to the morphisms. We then choose a new subcategory P of observations. This time the elements ofP will reflect a special type of branching structure. Then we show that the obtained P-bisimilarity coincides with Hennessy’s testing equiv- alence [Hen88]. Testing equivalence is slightly stronger than trace equivalence, due to an extra requirement on the set of possible actions, so-called acceptance sets, from states reached by performing a sequence of actions/labels.

We continue by defining a new category LTS3 of transition systems. The objects are those fromLTS1 which are finitely branching, i.e. from every state only finitely many actions can be taken. Before defining the morphisms we need some definitions, inspired by [Hen88].

Definition 20. LetT = (S, i, Act,−→) be anlts. LetRS(T) denote the reach- ability set ofT. ForrS,XRS(T), andsActlet

ST(r) ={αAct| ∃r0. r−→α r0} , (24) AT(r, s) ={ST(r0)|r−→s r0} , (25) ST(X) ={ST(r)|rS} . (26) Notice that if {i}−→s X for sAct then{ST(X)}=AT(i, s). ST(X) is the acceptance set of X.

The morphisms are now defined as follows.

Definition 21. Given twolts’s,Tj = (Sj, ij, Act,−→j), j= 1,2. A morphismm between T1andT2 is a functionmfromRS(T1) toRS(T2), such that

m({i1}) ={i2} , (27) X −→α X0impliesm(X)−→α m(X0) , (28) m(X) =Y ⇒ ∀A0ST2(Y).∃AST1(X). A⊆A0 . (29) Notice how the definition of morphisms intuitively simulates Hennessy’s<<MAY

and <<M UST pre-orders. Being guided by the definitions in [Hen88] and our results from Sect. 3, (27) and (28) reflect that we want traces to be simulated, and (29) reflects how acceptance sets are to be matched. Composition of morphisms is defined as the usual composition of functions. This defines the categoryLTS3. The subcategory P of observations will not consist of finite paths, but of trees consisting of a “trunk” and “branches” of length one, except for the “top”

of the tree, where a more general branching structure is allowed.

(16)

Definition 22. LetP be the full subcategory ofLTS3whose objects are of the form

·

i α1,1 //##

α1,m1

FFFFFFFFFFFF · //α2,1 ##

α2,m2

FFFFFFFFFFFF · · //αn,1 ##

αn,mn

FFFFFFFFFFFF ·

<<

βxxx 1,1xxx xxx xxx //

β1,k1 ·

· · β·mn ,kmnGG GGβmn,1GG GG GG GG //##·

·

where 0≤m1, . . . , mn, k1, . . . , kmn and all states are distinct.

Intuitively, the “trunk” corresponds to the observations in Sect. 3, i.e. it will ensure the existence of certain traces. The “top” of the the tree will ensure the existence of acceptance sets. The branches along the trunk are merely there for technical reasons. Think of a tree that has a trunk and only branches (of length one) at the top. Then allow branches of length one (“acceptance sets”) to “grow”

at any node. This will produce an observation inP. Lemma 23. The categoryLTS3 has pullbacks.

Proof. Assume we are given a diagram T1

m1 AAAAAAAA T2

~~ m2

} } }} } }} }

T0

where Tj = (Sj, ij, Act,−→j),j = 0,1,2.

We start be defining an lts T = (S, i, Act,−→) as follows. S will consist of triples whose first, second, and third components are elements from RS(T1), RS(T2), and subsets ofAct, respectively. S and−→are defined to be the least set such that

i= ({i1},{i2}, ST1(i1)∩ST2(i2))∈S

If (X, Y, C)∈S, αC,X −→α X0, andY −→α Y0 then (X0, Y0, C0)∈S for allC0M(X0, Y0), whereM(X0, Y0) ={A0∩(S

ST2(Y0))|A0ST1(X0)} ∪ {B0 ∩(S

ST1(X0))|B0ST2(Y0)}. Also, (X, Y, C) −→α (X0, Y0, C0) for all C0M(X0, Y0).

It should be easy to see that T is an lts. For later use we notice the following facts.

(17)

For (X, Y, C)∈S it is the case that ST((X, Y, C)) =C. This follows from the definition ofC.

It is the case thatL(T) =L(T1)∩L(T2). To see this note thatL(T)⊆L(T1)∩ L(T2) clearly holds. So choose anyvL(T1)∩L(T2), where v =α1· · ·αn, n≥0. Then there exists X0−→ · · ·α1 −→αn Xn inT1 andY0−→ · · ·α1 −→αn Yn in T2, where X0 ={i1}and Y0 ={i2}. Also, there must existsAjST1(Xj) such thatαj+1Aj for 0≤j < nand clearly we haveαj+1∈S

ST2(Yj) for 0≤j < n. So (X0, Y0, A0∩S

ST2(Y0))−→ · · ·α1 −→αn (Xn, Yn, An∩S

ST2(Yn)).

Hence,vL(T).

GivenZRS(T). Then there exist anXRS(T1) and aYRS(T2) such that Z = {(X, Y, C)|CM(X, Y)}. This follows from that fact that the transitions are deterministic onRS(T1) andRS(T2).

Let us define π1 : T −→ T1 as follows (π2 is defined in a similar fashion).

GivenZRS(T) letπ1(Z) =X, whereX is the unique first component of the elements ofZ. We now show thatπ1is a morphism.

Clearlyπ1({i}) ={i1}.

AssumeZ−→α Z0, forZ, Z0RS(T). Then by definitionπ1(Z)−→α π1(Z0).

AssumeAST1(X), whereX =π1(Z). By definition (X, Y, A∩S

ST2(Y))∈ Z, whereπ2(Z) = Y. Also,ST((X, Y, A∩S

ST2(Y)) =A∩S

ST2(Y)⊆A.

Hence, there exists anCST(Z) such thatCA.

Having argued for thatπ1andπ2are morphisms it trivially follows thatm1π1= m2π2.

Now assume that we are given a commuting square of the form T00

~~

f1

| | || | || |

f2

BBBBBBBB

T1

m1 AAAAAAAA T2

~~ m2

} } }} } }} }

T0

We will show that there exists a morphismh:T00−→T. We then necessarily have f1 = π1f1 and f2 =π2f2. Hence, we will have the desired pullback.

Define h: T00 −→T byh(V) ={(X, Y, C)|CM(X, Y)}, where X =f1(V) andY =f2(V).

Clearlyh({i00}) =i.

IfV −→α V0 inT00 thenf1(V)−→α f1(V0) andf2(V)−→α f2(V0), and hence, by previous facts we conclude thath(V)−→α h(V0).

AssumeCST(Z), whereZ=h(V). By the previous facts we conclude that (X, Y, C)∈Z, wheref1(V) =X andf2(V) =Y. Without loss of generality we may assumeC is of the formA∩S

ST2(Y) forAST1(X). Since f1 is a morphism we know there exists a DST00(V) such that DA. Also,

Referencer

RELATEREDE DOKUMENTER

This means that we shall prove a subject reduction lemma, which states that the analysis ρ, κ | = P captures any behavior of the process P, and use this result to show that the

The first component of P(g) denotes the set of template constants with open g gaps, and the second and third components describe the presence of template gaps and attribute

We define a category of timed transition systems, and show how to characterize standard timed bisimulation in terms of spans of open maps with a natural choice of a path category..

We extend and modify this theory to work in a context of imperative programming languages, and characterise complexity classes like P , linspace , pspace and the classes in

In Proc. A completeness theorem for open maps. Bisimulation from open maps. Basic concepts of enriched category theory. Lambda-Calculus Models of Programming Languages. The typed

Now assume p is not the zero polynomial. We will prove by induction on the number of variables that p is not identically zero. If b is nonzero, then we.. Then since p is not the

Thus, although we acknowledge that “the nature of the collective beliefs remains confused and portrays a diffused perception” (Dumas &amp; Louche, 2016, p. 450), we do not

agricultural amendments - plays in sediment and colloidal P loss, and 4) the need for improved integration between field observations and modelling to better understand