This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
C^ with p' \= cpg' but ^' ^ (^^' (use negation if necessary). Now p^a Aq'eQ' ^9' ^ C^^^ and therefore ^y |= a Aq'eQ' ^q'- ^^ ^^^^^ "^^^^ be a ^' G P with q - ^ <7' and q' ^ 2 ^ which had to be shown. D Comparing their modal characterizations ( = ^ of 1± and = ^ of '^) one finds p ^ q
=» p--q
=^
P='B^'
Theorem 2.1 in Hennessy and Milner [27,28] says, essentially, that for image finite processes the relation ^ satisfies the defining properties of a bisimulation (cf. Definition 12). Inspired by this insight. Park [41] proposed the concise formulation of bisimulation equivalence employed in Definition 12. It follows immediately that if p, ^ G P are image finite, then p<±q ^ p^ q. The following strengthening of this result is due to Hollenberg [32]. PROPOSITION
12.6. Let p,q eF and p is image finite. Then pt± q O p=~Bq'
PROOF. Write pBq iff p =~^ q and p is image finite. It suffices to establish that 5 is a bisimulation. - Suppose pBq and q - % q\l have to show that 3r G P with p - % r and HM{r) = HM(q'). Lei R he
{reF\p-^rA
HM(r) ^ HM{q) \.
54
RJ. van Glabbeek As p is image finite, R is finite. For every r e R take a formula (pr € HM{q') - HM(r) (note that if i/r € HM(r) - HM{q) then ^^ e HM{q) - //M(r)). Now
a
/\(preHM{q)=HM{p), reR
SO there must be a r G P with p - ^ r and r [= Are/? ^f- The latter implies r ^ /?, i.e., HM{r) = HM{q'), which had to be shown. - Suppose pBq and p - ^ p'. I have to show that 3q' e P with q - % ^' and HM(p') = //M(^0.Let5be {5 6 P I /? - ^ ^ A //M(5) 7«^HMip)}. As /? is image finite, S is finite. For every s e S take a formula (ps e HM(p) - HM(s). Now a / \ (^, €//M(p) = f/M(^),
so there must be a ^' € P with q - ^ q' and ^' [= AVGS^^- ^^ ^^^ previous item in this proof, 3r € P with /? - ^ r and HMir) = HM{q), hence r \= /\^^^ (ps. The latter implies r^S, so HM(r) = HM{p'). Thus HM{p') = HM{q'), which had to be shown. D By Counterexample 12, a result like the one above does not hold for (ready) simulation semantics. For the sake of completeness, two more variants of bisimulation equivalence can be conside£ed. Let FB* be characterized by the Hennessy-Milner logic augmented with formulas X, and /?B* by the Hennessy-Milner logic augmented with formulas X, for X c Act. Then B~ < FB* < RB* < B^ < B, and for image finite processes all five equivalences coincide. The strictness of these inclusions is given by Counterexamples 4, 11,9 and 1: PROPOSITION
12.7. CT:^B-,
and hence FB"" 2^ B'.
PROOF. Counterexample 4 shows two processes with CT{left) i^ CT{right). It remains to be shown that HM(left) = HM(right), i.e., that for all cp € CHM' left ^ cp <^ right \= cp. Using Definition 12.5 it is sufficient to restrict attention to formulas (p which are of the form a(A/e/ ^i~^ ^ /\jeJ """^i^) ^^^h ^ ^^^ ^ ^^^^^ ^^^^ ^^ indices. It is not difficuh to see that each such formula that is satisfied on one side is also satisfied on the other side. D PROPOSITION
12.8. R:^ FB\ and hence RB* i FB"".
PROOF. Counterexample 11, shows two processes with R{with) ^ R(without). It remains to be shown that FB*(with) = FB* (without). The argument is the same as in the previous proof, but this time focusing on formulas of the form a(X A A / e / ' T A Ayey "^7~'") ^^^^ / and J finite sets of numbers and X a possibly infinite set of numbers (= actions). D
The linear time - branching time spectrum I
55
PROPOSITION 12.9. 5^ ^^ /?5*, and hence RB^ i, RB*. PROOF. Counterexample 9 shows two processes with S^{with) :^ S^(without). It remains to be shown that RB*(with) = RB* (without). The argument is the same as in the previous proofs - this time using formulas
a({b} A /\biT /€/
A
/\-^bjTj jeJ
'
with / and / finite sets of numbers.
D
PROPOSITION 12.10. T^ i.B'^, and hence B 2< B"^, In addition, PF i, 5^. Counterexample 1 shows two processes with T^(left) ^ T^(right). As remarked at the end of Section 7, also PF(left) / PF (right). It remains to be shown that left = ^ right, i.e., that for all n eN: left --„ right. In order to establish p ^n (1 for two trees p and q, the parts of p and q that are further than n edges away from the root play no role, and can just as well be omitted. As the cut versions of left and right are isomorphic, by Corollary 12.1 surely left --„ right. U PROOF.
In addition one has IS' < B~, F2S* < FB\ R2S* < RB*, 25^ < B"^ and
2S
13. Tree semantics 13. Let ^ e G. The unfolding ofg is the graph U(g) e G defined by • N0DES(i7(^)) = PATHS(^), • ROOT(U(g)) = ROOT(^), i.e., the empty path, starting and ending at the root of g, • (n, a, 7t^) e EDGES(L^(^)) iff TT' extends TT by one edge, which is labelled a. Two processes p and q are tree equivalent, notation p =ij q/\i their unfoldings are isomorphic, i.e., if U(G(p)) = U(G(p)). In tree semantics (U) two processes are identified iff they are tree equivalent. DEFINITION
It is easy to see that the unfolding of any process graph is a tree, and the unfolding of a tree is isomorphic to itself. It follows that up to isomorphism every tree equivalence class of process graphs contains exactly one tree, which can be obtained from an arbitrary member of the class by means of unfolding. PROPOSITION PROOF. AS
U(g)mdg.
13.1. Let g eG. Then U(g)t> g. Hence g=u h=^
gi±h.
is easily verified, {(7T,end(7T)) \ n € PATHS(g)} is a bisimulation between D
Tree semantics is employed in Winskel [50]. No plausible testing scenario or modal characterization is known for it. Proposition 13.1 shows that B
56
/ ? . / van Glabbeek
a -\- a
a
Counterexample 15. Bisimulation equivalent, but not tree equivalent.
Although above tree equivalence is defined entirely in terms of action relations, such a definition is in fact misleading, as action relations abstract from an aspect of system behaviour that tree semantics tries to capture. The problem can best be explained by cona
sidering the process ^cT that can proceed from its initial to its final state by performing one of two different a-transitions. In tree semantics, such a process should be considered equivalent to the leftmost process of Counterexample 15, and hence different from the rightmost one. However, action relations only tell whether a process p can evolve into q by performing an ^-action; they do not tell in how many ways this can happen. So in labelled transition systems as defined in this paper the mentioned process is represented as c^-^ and hence considered tree equivalent to the rightmost process of Counterexample 15. The mishap that ensues this way will be illustrated in Section 17. Tree semantics on labelled transitions systems as in Section 1.1 is a sensible notion only if one knows that each transition in the system can be taken in only one way. In general, more satisfactory domains for defining tree equivalence are labelled transition systems in which the transitions (p,a,q) are equipped with a multiplicity, telling in how many different ways this transition can be taken, or process graphs g = (NODES(^), ROOT(g), EDGES(^), begin, end, label) in which NODES(g) and EDGES(^) are sets, ROOT(^) € NODES(^), begin, end: EDGES{g) -^ NODES(g) and label :EDGES(g) -^ Act. The functions begin, end and label associate with every edge a triple (s, a, t) G NODES(^) X Act x NODES(^), but contrary to the situation in Definition 1.3 the identity of an edge is not completely determined by such a triple. On such process graphs, the notions PATHS, unfolding and tree equivalence are defined exacdy as for the process graphs of Definition 1.3.
14. Possible worlds semantics In Veglioni and De Nicola [49], a nondeterministic process is viewed as a set of deterministic ones: its possible worlds. Two processes are said to be possible worlds equivalent iff they have the same possible worlds. Two different approaches by which a nondeterministic process can be resolved into a set of deterministic ones need to be distinguished; I call them the state-based and the path-based approach. In the state-based approach a deterministic process h is obtained out of a nondeterministic process g e G by choosing, for every state s oi g and every action a e I(s) a single edge s —% s'. Now h is the reachable part of the subgraph of g consisting of the chosen edges. In the path-based approach on the other hand, one chooses for every path n e PATHS(g) and every action a e I{end{n)) a single edge end{iz) - ^ s' to continue with. The chosen edges may now be different for different
57
The linear time - branching time spectrum I
paths ending in the same state. The difference between the two approaches is illustrated in Counterexample 16. In the state-based approach, the process in the middle has two possible worlds, depending on which of the two Z^-edges is chosen. These worlds are essentially abc and ab^. In the path-based approach, the process in the middle has countably many possible worlds, namely ab^c for n ^ 1 and ab^. In [49], Veglioni and De Nicola take the state-based approach: *'once we have resolved the underspecification present in a state s by saying, for example, s - ^ s, then, we cannot choose s —% 0 in the same possible world". However, they provide a denotational characterization of possible worlds semantics on finite processes, namely by inductively allocating sets of deterministic trees to BCCSP expressions (cf. Section 17), which can be regarded as path-based. In addition, they give an operational characterization of possible world semantics, essentially following the state-based approach outlined above. They claim that both characterizations agree. This, however, is not the case, as Counterexample 17 reveals a difference between the two approaches even on finite processes. In the path-based approach the process displayed has a possible world acd -\- bee (i.e., a process with branches acd and bee), which it has not in the state-based approach. As it turns out, the complete axiomatization they provide w.r.t. BCCSP is correct for the path-based, denotational characterization, but is unsound for the state-based, operational characterization. To be precise: their operational semantics fails to be compositional w.r.t. BCCSP. Counterexample 16 shows that a suitable formulation^ of the state-based approach to possible worlds semantics is incomparable with any of the semantics encountered so far. The processes left and middle are state-based possible worlds equivalent, yet
state
bi
—pw
/path
Tpw
f b _I)ath -pw
Counterexample 16. State-based versus path-based possible worlds equivalence.
Counterexample 17. State-based versus path-based possible worlds equivalence for finite processes. Let two processes be possible worlds equivalent iff each possible world of the one is ~-equivalent to a possible world of the other, where ~ is any of the equivalences treated in this paper. Theorem 6 will imply that the choice of ~ is immaterial.
58
/?./ van Glabbeek
abbe G T{middle) — T(left). Furthermore, the processes right and middle are tree equivalent, yet in the state-based approach one has abbe e PW(right) - PW(middle). Below I propose a formalization of the path-based approach to possible worlds semantics that, on finite processes, agrees with the denotational characterization of [49]. DEFINITION 14. A process p is a possible world of a process q if p is deterministic and P ^RS q- Let PW(q) denote the class of possible worlds of q. Two processes q and r Sire possible worlds equivalent, notation q =pw r, if PW(q) = PVy(r). Impossible worlds semantics (PW) two processes are identified iff they are possible worlds equivalent. Write q ^PW r iff PW(q) C PW(r). It can be argued that the philosophy underlying possible worlds semantics is incompatible with the view on labelled transition systems taken in this paper. The informal explanation of the action relations in Section 1.1 implies for instance that the right-hand process graph of Counterexample 8 has a state in which a has happened already and both be and bd are possible continuations. In the possible worlds philosophy on the other hand, this process graph is just a compact representation of the set of deterministic processes [abc,abd}. None of the two processes in this set has such a state. This could be a reason not to treat possible worlds semantics on the same footing as the other semantics of this paper. However, one can give up on thinking of non-deterministic processes as sets of deterministic ones, and justify possible worlds semantics - at least the path-based version of Definition 14 - by an appropriate testing scenario. This makes it fit in the present paper. Testing scenario. A testing scenario for possible worlds semantics can be obtained by making one change in the reactive testing scenario of failure simulation semantics. Namely in each state only as many copies of the process can be made as there are actions in Act, and, for a e Act, the first test on copy pa of p is pressing the «-button. If it goes down, one goes on testing that copy, but is has already changed its state; if it does not go down, the test on Pa ends. Modal characterization. On well-founded processes, a modal characterization of possible worlds semantics can be obtained out of the modal characterization of ready simulation semantics by changing the modality /\i^f (pi into AC/GX ^^« ^^^^ ^ — ^^^' Possible worlds of a well-founded process p can be simply encoded as modal formulas in the resulting language. Probably, this modal characterization applies to image finite processes as well. For processes that are neither well-founded nor image finite this characterization is not exact, as it fails to distinguish the two processes of Counterexample 1. Classification. RT < PW < RS. PW is independent of 5, CS and PF. PROOF. 'TW
< RS'""^ follows by the transitivity of
^RS.
^ The counterexample against ""PW < /?5" given in [49] is incorrect. The two processes displayed there are not ready simulation equivalent.
The linear time - branching time spectrum I
a{bd-\-ce) -\-a{cf + bg)
59
a{bd -^ ce -^ cf -\-by)
Counterexample 18. Ready trace equivalent, but not possible worlds equivalent.
"/?r :< PW" holds as a is a ready trace of /? G P iff it is a ready trace of a possible world of p. "5 7^ PW" (and hence ''RS :^ PW) follows from Counterexample 8. There S(left) i^ S{right), but PW(left) = PW(right) = {abc, abd). "PF i, PW' follows since PF ^ RS. ''CS t PW follows since CS ^ RT, and 'TF t PW since PF ^ RT. Finally, ''RT ^ PW follows from Counterexample 18, taken from [49]. There the first process denotes two possible worlds, whereas the second one denotes four. D Infinite processes. The version of possible worlds semantics defined above is the infinitary one. Note that RT^ < PW. Exactly as above one even establishes p ^Rs q=^ p ^pw q=^ p ^fr ^' i.e., RT^ <* PW <* RS. Finitary versions could be defined by means of the modal characterization given above. I will not pursue this here.
15. Summary In Sections 2-14 fifteen semantics were defined that are different for finitely branching processes. These are abbreviated by 7, Cr, F ' , F, /?, FT, RT, PF, S, CS, RS, PW, IS, B and U. For each of these semantics O, except U, a modal language CQ (a set of modal formulas (p) has been defined: CT
(p ::= T | a(p\(p' € CT)
the (partial) trace formulas CcT ^'•'•=^\ aip'{(p' e CCT) I 0 the completed trace formulas Cp\ (p:\=T \ a(p\(p' € Cf\) | a{a € Act) the singleton-failure formulas CF (^ ::= T I a(p\(p' e CF) I X{X c Act) the failure formulas
60
R.J. van Glabbeek CR
(p ::= T I acp'icp' e £/?) | X(X c Act)
the readiness formulas CFT
(f ::= T | a(p\(p' e CFT) I X(p\X c Act. ip' e CFT)
iht failure trace formulas CRT
(p::=T\ acp^cp' e CRT) I X(p\X c Act,
DOM. An element x e DOM is called difixedpoint of (p'\f4>{x)=x. Let F/X be the set of all fixed points of 0 . An element x e DOM is called the least fixed point of
: DOM -^ DOM be a ^-monotonic mapping. Then
iff 3F.E - ^ F A F |= 0. We may also add some notion of variable or atomic proposition to the logic, in which case we provide a valuation which maps a variable to the set of states at which it holds. The expressive power of HML in this form is quite weak: obviously a given HML formula can only make statements about a given finite number of steps into the future. HML was introduced not so much as a language to express properties, but rather as an aid to understanding process equivalence: two (image-finite) processes are equivalent iff they satisfy exactly the same HML formulae. To obtain the expressivity desired in practice, we need stronger logics. The logic PDL, Prepositional Dynamic Logic [56,26], as mentioned above, is both a development of Floyd-Hoare style logics, and a development of modal logics. It is not widely used these days, but for historical reasons it is worth presenting it briefly. PDL is an extension of HML in the circumstance that the action set has some structure. There is room for variation in the meaning of action, but in the standard logic, a program is considered to have a number of atomic actions, which in process algebraic terms are just process actions, and a is allowed to be a regular expression over the atomic actions: a,a; p.aUfi, or a*. We may consider atomic actions to be uninterpreted atoms; but in the development from Royd-Hoare logics, one would see the atomic actions as, for example, assignment statements in a while program. PDL enriches the labels in the modalities of HML. An alternative extension of HML is to include further modalities. The branching time logic CTL, Computation Tree Logic Computation Tree Logic [17], can be described in this way as an extension of HML, with some extra 'temporal' operators which permit expression of liveness and safety properties. For the semantics we need to consider 'runs' of a process. A run of EQ is a sequence £"0 - ^ E\ -%• • • • which may have finite or infinite length; if it has finite length then its final process is a 'sink' process which has no transitions. A run EQ -%• E\ - ^ • • • has the property 0 U T/^, '0 until i/r', if there is an / ^ 0 such that £/ |= x// and for all 7: 0 ^ y < /, }; end; end; Fig. 12. Initialization of ToDelete and /?. in ToDelete is processed. is processed. in ToDelete is processed. is processed. to be inserted into ToDelete only if (p, <7, <2> is in 0\. LowCount is employed analogously. Figure 15 contains the code for the iteration phase of the algorithm. We now remark on the time complexity of the preorder-checking algorithm given in Figures 12 and 15. If £ = (5, A, -^) is an LTS, let \C\ = | 5 | -h K | . Also let rinit be the time spent on computing TJ, 0\ and 02- We also assume that sets are implemented using hash tables and thus that insertion, deletion and set membership may be computed in 0(1) time. THEOREM ^ ^ and low^'^pa- Intuitively, high^' ^ ^ is the index of the state in [q - ^ •} that is currently matched to p and lowq'pa is the index of the state in [p -^ •} that is currently matched to ^'. By using these pointers we ensure that p ' will be compared to each «-transition of q at most once and similarly q' will be compared to each a-transition of p at most once. • A set A which records the pairs that need to be re-examined. It contains tuples of the sort (r - ^ r\ s, type), r, r\ and s are states, and type indicates which condition needs to be rechecked. If type is equal to 1 then r and s are candidates for being related by r £ ^ ^ 5 and / needs to be matched to some 6f-derivative of s using the high pointers, namely high^' s^. Dually, if type is equal to 2 then r and s are supposed to be related by 5 £ ^ ^ r and low pointers will be used to find a match for r'. The algorithm consists of three procedures. Given a transition p - ^ p' and state q, procedure SEARCH JilGH tries to match p' to some «-derivative of ^, under the assump- ^^. *} status := PREORDER(p\ (q - ^ •}[highp'.^ a^)', i f 5ra/M5 = related t h e n e? := (V(a), £ ( e ) u {{{p\ [q -^ •Khighp'^^J), ai, (p, ^»}); else {* A match is not found. Process the next candidate. *} hi8hp',g^a-=highp^ ^^^ + 1; end; r e t u r n (status); e n d SEARCH JilGH; SEARCH ±OW{q - % q', p) -> {result .{related, not .related]) status := not.related; i f {p,q,a) ^02 t h e n ^mm^ := related; w h i l e 5ra/M5 = not.related a n d low^' p^ ^\[p —^ •}! do {* Start searching beginning from the first potential candidate referenced by low^' p^. *} status := PREORDER{[p - ^ •}[/^vv^'.p,^], ^ ' ) ; i f 5rarM5 = related t h e n e := (V(g), E{G) U {{({/7 - ^ •}[/^w^'.;,. J , q). ai. {p, q))}); else {* i4 match is not found. Process the next candidate. *} end; r e t u r n {status); end SEARCH±OW; Yv(PA(a)X)€lonno, ^Y.({a>Yv(PA(a)X))GIl, ^X.(^Y.((a>Y V (P A (a)X))) € 0 2 . The fragment of formulae with alternation depth one, called the alternation-free modal \i-calculus, has stirred up some greater interest. It captures a good deal of the desired system properties (in particular, the whole of CTL), while permitting efficient model checking: e.g., for finite-state systems model checking is linear in both the system and the formula size [45] (cf. Section 3.2). On the other hand, Bradfield [16] (and, independently, Lenzi [101]) showed that alternation depth induces an infinite sequence of sublogics of strictly increasing expressive power. This, and other interesting details about the modal |x-calculus and its associated theory can be found in Chapter 4 in this Handbook [17]. Presburger Computation Tree Logic (PCTL). It is well known that many relevant properties of reactive systems involve constraints on the numbers of occurrences of events. However, traditional temporal logics, like the ones we have considered so far, can only express regular properties of processes. This means that the set of models satisfying a given property form regular sets, and in particular in the branching-time setting are a regular set of trees. To overcome this limitation, Bouajjani, Echahed, and Robbana [11] introduced ?o = ^ • • • =^ §// = ? ^ = > ?o = ^ • • • = ^ ?// = ? such that (1)
£,N0. Eo-^ 'U
N (t>
E,^
•
N
• • •
£ ,
N ^
The formula F0 = (tt U 0) means '0 eventually holds' and G0 = --(tt U --0): '0 always holds'. For each 'temporal' operator such as U there are two modal variants, a strong variant ranging over all runs of a process and a weak variant ranging over some run of a process. We preface a strong version with V and a weak version with 3. If HML is extended with the two kinds of until operator the resulting logic is a slight but inessential variant of
Modal logics and mu-calculi: An introduction
299
CTL. The formal semantics is given by inductively defining when a state (process) has a property. For instance E |= V[0 U x//] iff every run of E has the property (pV \{/. CTL has variants and enrichments such as CTL* [25] and ECTL* [72]. These allow free mixing of path operators and quantifiers: for example, the CTL* formula V[F U 3FQ] is also a CTL formula, but V[P U ¥Q] is not, because the F is not immediately governed by a quantifier. Hence extensions also cover traditional temporal logics - that is, literally logics of time - as advocated by Manna and Pnueli and others. In this view, time is a Unear sequence of instants, corresponding to the states of just one execution path through the program. One can define a logic on paths which has operators O 0 'i" ^he next instant (on this path) 0 is true', and 0 U i/r '0 holds until i/ holds (on this path)'; and then a system satisfies a formula if all execution paths satisfy the formula - in CTL* terms, the specification is a path formula with a single outermost universal quantifier. One can also extend PDL with temporal operators, as in process logic. There are extensions of all these logics to cover issues such as time and probability. The introduction of real-valued quantities such as times and probabilities poses a number of problems, and such logics are still under active development.
2.1. The small model property A general result about many modal logics is that they have the small model property; that is if a formula is satisfiable, then it is satisfiable by a model of some bounded size. Provided that model-checking is decidable, which is the case for almost all temporal logics, this inmiediately gives decidability of satisfiability for the logic, as one need simply check every transition system up to the size bound. The technique used to establish the small model property for PDL (and therefore HML) is a classical technique in modal logic, that of filtration. Let £" be a possibly infinite-state process with the property 0, and let T be its transition system. Let F be the set of all subformulas of 0 and their negations: in the case of PDL one also counts {a)\lr and ()S)V^ as subformulas of {a U ^)T/r, {fi)}// as a subformula of (a; P)\lr and (a; Qf*)i/r, and {a)\l/ as subformulas of {a*)\l/. The size of F is proportional to |0| (the length of 0). One then filters T through F by defining an equivalence relation on the states of T, £ = F iff W^ e F.E \=\l/
[F]-%[F]
iff 3E' e[ElF'
e[FlE' -^
F\
The number of equivalence classes is at most 2'^' and so is 0(2'"^'). The rest of the proof shows that the filtered model is indeed a model, in that [E] \= x// iff E \= ir for xlr e F. For PDL the only case requiring comment is the case (a*)iA, which proceeds by an induction on the length of the witnessing sequence of c^'s. Consequently if 0 is a satisfiable PDL formula, then it has a model with size 0(2l^'), and in fact 2>^l suffices - see [26] for full details. In order to obtain an upper bound for satisfiability from the small model property, we also need to know the complexity of model-checking, that is, determining whether F f= 0.
300
/ Bradfield, C. Stirling
It is straightforward to define an inductive procedure for this, which is polynomial in the size of the formula and of the system. For example, to determine the truth of (a*)0, one computes the *-closure of the a relation, and then checks for an Q?*-successor satisfying 0. These results give an NTIME(c'0 upper bound for the satisfiability problem. By a reduction to alternating Turing machines, [26] also gave a lower bound of DTIME(c''/'^"). A closer to optimal technique for satisfiability due to Pratt uses tableaux [57]. Although CTL, CTL* and modal mu-calculus all have the finite model property, the filtration technique does not apply. If one filters T through a finite set F containing VF|2 unintended loops may be added. For instance if T is £/ - ^ £",+1 for 1 < / < « and Q is only true at state E,^ then £"/ |= VFQ for each /. But when n is large enough the filtered model will have at least one transition [Ej] —^ [£"/] when i ^ j
2.2. CTL model-checking CTL has some obvious differences from PDL. Firstly, although it is a state-based logic, in the sense that the formulae one writes are defined on states, it uses path operators internally: evaluating the formula V[0 U i/r] at a state involves considering all paths from that state. Thus, at first sight, one might expect to lose the obvious exponential upper bound on modelchecking. However, this turns out not to happen, and in fact CTL is very easy to modelcheck. This was shown by a direct construction in [18]; it also follows from the fact that, as we shall see later, CTL is a particularly simple fragment of the modal mu-calculus. The model-checking procedure of [18] is an example of an apparently global technique. It proceeds by model-checking subformulae from the bottom up, doing a full pass over the state space for subformulae before considering the superformula. In the original paper, the algorithm is presented as imperative pseudo-code, and it takes a little thought to see why it works. Here is an EngHsh outline, which extracts the idea of the code: • to check tt, -"0,01 A 02, check the subformulae and perform the Boolean operation; • to check (fl>0, [fl]0, check 0, and then apply the semantic definitions; • to check 3[0 U V^], check the subformulae, then find the states at which V^ holds, and trace backwards along paths on which 0 holds; these states satisfy 3[0 U ^]\ • to check V[0 U V^], check the subformulae; then make a depth-first traversal of the system, applying the following: if a state satisfies i/^, mark it as satisfying V[0 U i/r]; otherwise, if it fails 0, mark it as failing V[0 U i/^]; otherwise, after processing the successors, mark it as satisfying V[0 U V^] iff all its successors do. In following sections, we shall see CTL translated into modal mu-calculus, and we shall see global, backward-looking model-checking algorithms, and local, forward-looking algorithms. It is interesting, from today's perspective, to see that this early CTL algorithm has elements of both: the code for 3[0 U xj/] is doing exactly the computation by approximants (see Section 4.4) of the mu-calculus translation; but the code for V[0 U V^] is doing tableau model-checking (see Section 5.1).
Modal logics and mu-calculi: An introduction
301
3. Introduction to mu-calculi The defining feature of mu-calculi is the use of fixpoint operators.' The use of fixpoint operators in program logics goes back at least to De Bakker, Park and Scott [52]. However, their use in modal logics of programs dates from work of Pratt, Emerson and Clarke and Kozen. Pratt's version [58] used a fixpoint operator like the minimization operator of recursion theory, and this has not been further studied. Emerson and Clarke added fixed points to a temporal logic to capture fairness and other correctness properties [22]. Kozen's [37] paper introduced the modal mu-calculus as we use it today, and established a number of basic results.^ Fixpoint logics are notorious for being incomprehensible. Indeed, it has been known for several reasonably expert people to spend an hour or two trying to work out whether a one line formula means what it was intended to mean. Furthermore, a full understanding of the mathematical intricacies of the modal mu-calculus requires familiarity with mathematics that, although not difficult, is not covered in most undergraduate mathematics or computer science programmes; this can be a source of irritation for the practitioner new to the area. Fortunately, one can get a very good intuitive understanding, which is even provably equivalent to the formal semantics, without knowing the full details. Moreover, this intuition is all but essential for understanding the deep theory as well. In this section, therefore, we shall give an introduction to the modal mu-calculus that avoids the harder and more technical details, and concentrates rather on developing the intuition. In the first two subsections, we shall be so informal as to use notation and terminology well in advance of their definitions. In the following section, the semantics of the logic is examined in a little more detail, and the intuitions given a precise mathematical meaning.
3.1. Fixpoints as recursion Suppose that S is the state space of some system. For example S could be the set of all processes reachable from by arbitrary length sequences of transitions from some initial process E, One way to provide semantics of a state-based modal logic is to map formulae 0 to sets of states, that is to elements of pS. For any formula 0 this mapping is given by 110II ? The idea is that this mapping tells us at which states each formula holds. If we allow our logic to contain variables with interpretations ranging over pS, then we can view the semantics of a formula with a free variable, 0(Z), as a function / : pS -^ pS. If we take the usual lattice structure on pS, given by set inclusion, and if / is a monotonic function, then by the Knaster-Tarski theorem we know that / has fixed points, and indeed has a ' Whether one should say 'fixpoint', 'fix-point', or 'fixed point' is one of the most controversial questions in the theory of mu-calcuh. One of us (Bradfield) takes the view that one has 'fixpoint operators', which generate 'fixed points' of functions. Fortunately, few people enunciate with sufficient clarity to distinguish the two in conversation. ^ Kozen called the logic 'propositional mu-calculus' but this would be more appropriate for propositional logic + fixpoint operators, a logic we shall comment on later. The mapping can be either given directly (inductively) or indirectly as the set {5 G 5 : s\=(t>].
302
J. Bradfield, C. Stirling
unique maximal and a unique minimal fixed point. So we could extend our basic logic with a minimal fixpoint operator /x, so that /xZ.(/)(Z) is a formula whose semantics is the least fixed point of / ; and similarly a maximal fixpoint operator v, so that vZ.(p(Z) is a formula whose semantics is the greatest fixed point of / . The reason we might want to do this is that, as in domain theory for example, it provides a semantics for recursion. Writing recursive modal logic formulae may not be an immediately obvious thing to do, but it provides a neat way of expressing all the usual operators of temporal logics. For example, consider the CTL formula VG), 'always 0'. Another way of expressing this is to say that it is a property X such that if X is true, then 0 is true, and wherever we go next, X remains true; so X satisfies the modal equation X = 0A[-]X where = is logical (truth-table) equivalence,"^ and [—]X means that X is true at every immediate successor (see Section 3.3). So we could write this formula as?X.0A[—]X. But what is '?'? Which fixed point is the right solution of the equation - least, greatest, or something in between? We may argue thus: if a state satisfies any solution X' of the equation, then surely it satisfies VG(/>. Hence the meaning of the formula is the largest solution, vX.cf) A [—]Z. On the other hand, consider the CTL property 3F0, 'there exists a path on which 0 eventually holds'. We could write this recursively as T holds if either 0 holds now, or there's some successor on which Y is true': y = 0v{-)r. This time, it is perhaps less obvious which solution is correct. However, we can argue that if a state satisfies 3F0, then it surely satisfies any solution Y' of the equation; and so we want the least such solution. The astute reader will by now have noticed that the equations do not capture the meaning of the English recursive definitions - we should have written X=>(t)A[-]X and y^0v{-)y, or in terms of the semantic function, ||X|| c ||0 A [-]X\\ and ||y|| 2 110 v {-}Y\\. So we are not really interested in fixed points, but rather in respectively post-fixed points and pre-fixed points of the functions defined by the formulae on the right of the (in)equations; and since there is only one canonical post-fixed point and one canonical pre-fixed point, it becomes obvious which is required. It is an easy fact that the greatest post-fixed point and the least pre-fixed point of a monotonic function are also the greatest and least fixed points. We use double arrows =>, ^ for logical implication; single arrows -> are used for transition relations, as well as with their normal mathematical use.
Modal logics and mu-calculi: An introduction
303
and so we may continue to use the notation /x and y, and work with fixpoints. However, it is usual to emphasize this point when writing the semantics of fixpoint logics by writing, for example, ||/xZ.0(Z)|| = f ^ { ^ I 5 2 110(5)11} with inclusion rather than equality. At this point, the reader who does not already know the answer might like to apply a similar argument to produce the fixpoint translation of the CTL formula V[(/> U yfr].
3.2. Approximating fixpoints and ^i as finitely' The other key idea is that of approximants and unfolding. The standard theory tells us that if / is a monotonic function on a lattice, we can construct the least fixed point of / by iterating / on the bottom element ± of the lattice to form an increasing chain whose limit is the fixed point. The length of the iteration is in general transfinite, but is bounded at worst by the cardinal after cardinality of the lattice, and in the special case of a powerset lattice p<S, by the cardinal after the cardinality of S. So if / is monotonic on pS, we have
a
and similarly
Oi
- or in terms of a infinitary logic, ixZ.cpi^Z) = \Ja
304
/ Bradfield, C Stirling
one follows a chain of dependencies, the chain terminates. This is the strict meaning behind the slogan "/z means 'finite looping'", which, with a little refinement, is sufficient to understand the mu-calculus. On the other hand, for a maximal fixpoint vZ.(j)(Z), there is no such decreasing chain: def
s \= vZ.(f){Z) iff ^ 1= (l){vZ,(j)(Z)), and we may loop for ever, as in the CCS process P = a.P, which satisfies vZ.{a)Z. (However, if a state fails a maximal fixpoint, then there is a descending chain of failures.) Instead, we have the somewhat mystical principle of fixpoint induction: if by assuming that a set 5" |= Z, we can show that 5 ^= 0(Z), then we have shown that S \= vZ.cf) (compare the recursive formulation of VG0 in the previous section). So in summary, one may understand fixpoints by the slogan 'y means looping, and /x means finite looping'. This slogan provides an alternative means of explaining why a minimal fixpoint is required in the translation of 3F(/). This formula means that there is a path on which 0 eventually holds: that is, on the chosen path, 0 holds within finite time. Hence the 'equation' F = 0 v (—) 7 must only be applied a finite number of times, and so by the slogan we should use a minimal fixpoint. In the case of formulae with alternating fixpoints (which we shall examine a little later), the slogan remains valid, but requires a little more care in application. It is essential to almost all proofs about modal mu-calculus: the notion of 'well-founded premodel' with which Streett and Emerson [68] proved the finite model property, is an example of the slogan; so are the tableau model-checking approaches of Stirling and Walker [66], and Bradfield and Stirling [13]. 3.3. Syntax of modal mu-calculus Let Var be an (infinite) set of variable names, typically indicated by Z, F , . . . ; let Prop be a set of atomic propositions, typically indicated by P, Q , . . . ; and let £ be a set of labels, typically indicated by a,b, The set of modal mu-calculus formulae (with respect to Var, Prop, C) is defined in parsimonious form as follows: • P is a. formula. • Z is a formula. • If 01 and 02 are formulae, so is 0i A 02. • If 0 is a formula, so is [a]0. • If 0 is a formula, so is -•0. • If 0 is a formula, then vZ.cf) is a formula, provided that every free occurrence of Z in 0 occurs positively, i.e., within the scope of an even number of negations. (The notions of free and bound variables are as usual, where v is the only binding operator.) If a formula is written as 0(Z), it is to be understood that the subsequent writing of 0(V^) means 0 with ^r substituted for all free occurrences of Z. There is no suggestion that Z is the only free variable of 0; and variable capture is not avoided. The positivity requirement on the fixpoint operator is a syntactic means of ensuring that 0(Z) denotes a functional monotonic in Z, and so has unique minimal and maximal fixpoint. This requires irritating book-keeping, and it is usually more convenient to introduce derived operators defined by de Morgan duality, and work in positive form:
Modal logics and mu-calculi: An introduction
305
• 01 V 02 means -"(-^01 A --^02). • {a)(j) means -^[a]-^^. • fxZ.(j)(Z) means -iyZ.-'0(-^Z). Note the triple use of negation in /x, which is required to maintain the positivity. A formula is said to be in positive form if it is written with the derived operators so that -^ only occurs applied to atomic propositions. It is in positive normal form if in addition all bound variables are distinct. Any formula can be put into positive normal form by use of de Morgan laws and a-conversion. So we shall often assume positive normal form, and when doing structural induction on formulae will often take the derived operators as primitives. For the concrete syntax, we shall assume that modal operators have higher precedence than Boolean, and that fixpoint operators have lowest precedence, so that the scope of a fixpoint extends as far to the right as possible. There are a few extensions to the syntax which are convenient in presenting examples, and in practice. The most useful is to allow modalities to refer not just to single actions, but to sets of actions. The most useful set is 'all actions except«'. So: . s\= [K](t) iff Vfl G K.s f= [a]0, and [«,/?,.. .]0 is short for [[a, b,.. .}]0. • [—K](p means [C — K](p, and set braces may be omitted. Thus [—10 means just [£]0.^
3.4. Semantics of modal mu-calculus A modal mu-calculus structure T (over Prop, C) is a labelled transition system, namely a set 5 of states and a transition relation -> c 5 x £ x 5 (as usual we write s —> r), together with an interpretation Vprop : Prop -^ pS for the atomic propositions. Given a structure T and an interpretation V: Var -^ pS of the variables, the set ||0||y of states satisfying a formula 0 is defined as follows: \\P\\V = Vprop(P), \\Z\\l = V(Z), Ih0llv=<5-11011^, ll0iA02||^ = 110111^ n 110211^, IIW0llv =
{^|Vr.^-^r=^r€||0||^},
IvZ.cPWv = U I ^ ^ ^ I ^ ^ I I ^ I I V I Z : :--s\i where V[Z := S] is the valuation which maps Z to 5 and otherwise agrees with V. If we are working in positive normal form, we may add definitions for the derived operators by duality: ^ Beware that many authors use '[]0' to mean *[£]0\ rather than the (vacuous) *[0]0" that it means in our notation.
306
/ Bradfield. C. Stirling
Ui^Mv
^ ll'AillvUII'/'all^,
\\{aml =
[s\Jt.s^tAte\ml},
\\HZ4\\1 ^f][SQS\So
\mv[z:^s]]-
We drop ^ and y whenever possible; and write 5 ^= 0 for 5 G ||(/>||. We have discussed informally the importance of approximants; let us now define them. If iiZ.(t){Z) is a formula, then for a € On, let fiZ".(f) and /xZ*^".0 be formulae, with semantics given, with simultaneous induction on a, by:
\\fiz<\4>\\l=
[j\\nz'^.
The approximants of a maximal fixpoint are defined dually:
ivz<«.0|i; = nii-2^-
T
v
Note that iiZ^^.(f) <<=^ ff and vZ^^.cp <=> tt. By abuse of notation, we write Z" or 0^ to mean ^Z^.cf); of course this only makes sense when one knows which fixpoint and variable is meant. We should remark here that most literature on the modal mu-calculus uses a slightly different definition, putting /xZ^.0 = ff, /xZ^+' .0 = 0(/xZ^.>), and /iZ^.0 = U^<;, /xZ^.0 for limit k - which in effect is writing a for our
Modal logics and mu-calculi: An introduction
307
is a relativized 'always' formula: 'P is true along every cr-path'. Slightly more complex is the relativized 'while' formula vZ.Qv(PA[a]Z) 'on every a-path, P holds while Q fails'. Both formulae can be understood directly via the fixpoint construction, or via the idea of 'y as looping': for example the second formula is true if either Q holds, or if P holds and wherever we go next (via a), the formula is true, and . . . , and because the fixpoint is maximal, we can repeat forever. So in particular, if P is always true, and Q never holds, the formula is true. fx formulae, in contrast, require something to happen, and thus are liveness properties. For example fjiZ.Pv[a]Z is 'on all infinite length a-paths, P eventually holds'; and fjiZ.Q\/(PA{a)Z) is 'on some a-path, P holds until Q holds (and Q does eventually hold)'. Again, these can be understood by '/x as finite looping': in the second case, we are no longer allowed to repeat the unfolding forever, so we must eventually 'bottom out' in the Q disjunct. This level of complexity suffices to translate CTL, since we have /xZ.Q v (F A {—)Z) as a translation of 3[P U Q], and fxZ.Qv (P A [ - ] Z A (-)tt) as a translation of V[P U Q]; and obviously we can nest formulae inside one another, such as yZ.(/xF.Pv(->r)A[-]Z 'it is always possible that P will hold', or VG(3FP). Equally obviously, we can write formulae with no CTL translation, such as luiZ.[a]ffv {a){a)Z which asserts the existence of a maximal a-path of even length; a formula which is, incidentally, expressible in PDL. This is, however, a fairly simple extension; much more interesting is the power one gets from mixing fixpoints that depend on one another. Consider the formula /jiY.vZ.iP A [a]Y) V ( - P A [a]Z), This formula is likely to stymie the average newcomer to the modal mu-calculus, but it has a simple meaning, which can be seen by using the slogans. fiY— is true if vZ— is true if (P A [a]Y) V (--F A [fl]Z), which is true if either P holds and at the next («)-states we loop back to JJLY , or P fails, and at the next states we loop back to vZ By the slogan '/x means finitely', we can only loop through fiY finitely many times on any path, and hence P is true only finitely often on any path.
308
/ Bradfield, C. Stirling
A variant on this theme illustrates the ease with which the modal mu-calculus can talk about actions, which from a traditional process calculus viewpoint are all that one can observe. By similar reasoning to the above, one can see that fiY.vZ.[a]Y
A[-a]Z
asserts that a process does only finitely many a actions, whatever else it does: it may even diverge. For example, consider the divergent value-passing CCS process def
A(n) = T.A(n + 1) -h T.B{n)
B(n) =ifn>0
then a.B(n - 1).
A(0) satisfies the formula. To see that this really is true, as the slogans suggest it is, we can examine the semantics. As this is an example of a nested fixpoint, let us consider the approximants. The first approximant of the outer minimal fixpoint is fiY^....
= vZ.[a]{fjiY''^....)
A [-a]Z = yZ.[^]ff A [-a]Z.
We may also calculate this maximal fixpoint by approximants. Its first approximant is vZ^— = [a]ff A [—«]tt, which is, by inspection, the processes A(i) (/ ^ 0) and B(0). The next approximant is vZ^ = [a]ffA [—a](vZ'^^ ), which again by inspection is just B(0); and here we stabilize. So we are now in a position to calculate the next outer approximant: /xF^ ... = vZ.[a]{fjiY''\ ...) A [-a]Z = vZ.[a]{B(0)} A [-a]Z. The reader may compute this by approximants to obtain ^(0), ^(1). Continuing, we obtain fiY^ — = {B(j) I j < /}. The next approximant is where everything happens: /xF^.... = vZ.[a]{iiY^'^....)
A [-a]Z = vZ.[a]{B(i)} A [-a]Z.
A further calculation shows that here vZ^ is all processes, and so we stabilize; now the outer approximant chain has also converged at all processes. It is also worth briefly considering the negative of this, namely 'infinitely often', as it illustrates the finite unfolding of /x within an outer v. Consider the formula vY.fiZ.(a)Yv
(r)Z.
Applying the slogans, we see that this is true if either we can do an a and loop to 7, or do a r, and loop to Z. We can only loop to Z finitely often, so we can only do finitely many consecutive rs; but if we do an a and loop back out to F, we then re-enter the inner fixpoint, free to do another independent finitely many rs. The really enthusiastic reader might like to evaluate this formula by approximants on the modified set of processes given by putting B{n) = T.A(2n) -h if n > 0 then a.B(n-\). We shall see in a later section that this so-called alternation of fixpoint operators does indeed give ever more expressive power as the number of alternations increases. It also
Modal logics and mu-calculi: An introduction
309
appears to increase the complexity of model-checking: all known algorithms are exponential in the alternation, but whether this is necessarily the case is the main remaining open problem about the modal mu-calculus. (See Section 4.4 for more on the complexity of model-checking.) However, the practitioner who is alarmed by the thought of even more complex formulae, can take comfort in the widely asserted proposition that one never actually needs more than two alternating fixpoints, and even two is a bit unusual. In fact, many would go further and say that in real life we are only interested in safety properties. There are two main reasons why alternating formulae might appear. The first is if one has a front end working in CTL* (or another complex logic), and is translating into modal mucalculus for the main engine. This is theoretically possible, by work of Mads Dam [19], but the translation is sufficiently complex that it would be surprising to find a tool doing this. The second is if one needs to express fairness. Fairness properties, whether weak (an event continuously enabled must happen) or strong (an event enabled infinitely often must happen), can be written in the modal mu-calculus, and require mixing fixpoints. For example, to say that an action a is fairly treated means that there are no paths on which a is enabled infinitely often, but occurs only finitely often; this can be written as vX.fiY.vZ.[a]X
A ({a)ti => [-a]Y) A [-a]Z,
Of course, we may be in a situation where the system is inherently unfair - e.g., it is a normal interleaving of concurrent components - and in that case we can use a similar idea to express properties such as ' P eventually holds on all paths, provided that a is fairly treated', which is left as an exercise for the reader. However, fairness can also be handled by other means, such as defining the set of fair paths 'outside' the logic, and adapting algorithms to apply only to fair paths. 3.6. Modal mu-calculus as a process logic So far, we have described the modal mu-calculus as a logic on labelled transition systems; but this is a handbook of process algebra. Of course, process algebras, or at least simple traditional process algebras, are equipped with an operational semantics that defines a labelled transition system, in which the states are usually pieces of syntax. The easy way to interpret any modal logic on a process algebra is just to use this generated transition system. However, in theory one's notion of process is not just a piece of syntax, but some behaviour, and one wishes to treat identically 'processes' that are behaviourally equivalent. In the CCS world view, we believe that processes that are strongly bisimilar are equivalent for all practical purposes - and most non-practical purposes - and in many situations we might treat observational congruence or weak bisimulation similarly. In more exotic situations we might view any of the hundreds of known equivalences as process equality. This raises the obvious question of how our logic behaves with respect to such equivalences, and what should we do if it behaves badly. The first answer is that the logic behaves well: If two processes (i.e., states in transition systems) are strongly bisimilar, then they satisfy exactly the same modal mu-calculus formulae. This is proved by an easy induction. In fact, for finite-branching systems (more precisely, image-finite systems) the converse is also true provided the atomic propositions respect
310
/ Bradfield, C. Stirling
bisimulation, so that modal mu-calculus (or indeed its small subset HML) characterizes strong bisimulation; this fails for arbitrary systems. An inductive proof of this result is presented in [64]. However, if we prefer, as we usually do, to work with a weaker equivalence, this of course is no longer true, since the modal mu-calculus as we have defined it treats r just as any other action. There are several ways to deal with this. One is just to accept it, and when writing properties in the mu-calculus to be very careful to write explicitly a formula that does the desired thing with silent actions; this has obvious drawbacks. A more natural option, provided that whatever tool one is using supports it, is to work with the weak transition system, namely the transition system defined by"^ s ^=^ t if s - ^ - ^ - ^ t. A compromise is to stick with the strong transition system, but to define derived modalities which take account of r. For example, one can define {{tz))0 to mean /zZ.(r)Z v {a)/jiZ.(t) v (r>Z, which captures in the strong logic the diamond modality in the weak transition system. Another issue that affects practice is the atomic propositions. We have presented the logic with arbitrary valuations for atomic propositions, but this is neither possible nor desirable in practice. Typically there will be some small language of atomic propositions; for example, in value-passing CCS one wants to have basic expressions over the parameters of a process. One might imagine that by restricting this language one could obtain better results on decidability etc.; although this is, loosely speaking, true in practice, in the sense that 'sensible' properties of 'sensible' systems can be expressed and often proved entirely within a 'sensible' language, it is not generally true in a mathematical sense, since the basic mu-calculus operators are sufficient to expose any undecidability that may be lurking in a system - for example, the halting property is just /xZ.[-]Z.
3.7. Linear time mu-calculus The modal mu-calculus is a pure branching time logic, although as we have seen in the examples it can express properties that are usually found in mixed branching/linear logics such as CTL*. One may also add fixpoint operators to linear time logic, to get a pure linear time mu-calculus. The modality in this case is a 'next' operator (g), and the logic is interpreted not over states of a system, but over runs or maximal paths. The formula @0 is satisfied by the runs cr = SQ -%• s\ -%- • • • such that a\ =a and s\ -^ • • • satisfies >. Adding negation, conjunction and maximal fixpoint to this operator gives the linear time mu-calculus. Just as in the modal case, the linear mu-calculus encompasses most other linear time logics. The linear 'until' operator (/> U i/^ is just /jiZ.x// v ((/> A QZ), and linear fairness operators can be expressed in a similar manner to their branching counterparts. At first sight, the linear mu-calculus is much harder to handle than the modal logic: we are interpreting over runs, and even a finite-state system generates continuum-many runs. So we are taking fixpoints in a lattice of size 2^"^, and our approximants may, at first sight, not close until (2^)+! Of course, this doesn't actually happen, and in fact for a finite-state system fixpoints close at a finite approximant. However, this approximant may ^ This double arrow is not logical implication!
Modal logics and mu-calculi: An introduction
311
be large, and model-checking is exponential [71]. It is possible to give a direct procedure, and even a direct local procedure, to model-check the linear time mu-calculus [66,12], but they are complicated, and for all but the smallest examples, automata-theoretic techniques are superior. On the other hand, the linear time mu-calculus is in some ways simpler than the modal mu-calculus. In particular, increasing alternation does not give increasing expressive power: any formula is equivalent to one of alternation depth two. Indeed, any formula is equivalent to an a>-regular expression. An elegant direct proof of this result is contained in [53] (which doesn't mention temporal logic and uses fixpoints of linear systems of equations^). An alternative proof uses automata. Biichi automata and linear time mu-calculus are equi-expressive, and a Biichi automaton is easily transformed into a formula whose alternation depth is at most two, see for example [51]. Generally speaking, the linear time mu-calculus has not offered the same advantages as the modal mu-calculus, and those who use a linear time logic use the traditional logic of 'next' and 'until', and its fragments.
4. Theory of modal mu-calculus 4.1. Fixpoint regeneration and the 'fundamental semantic theorem * In the informal description of the meaning of fixpoints, we used the idea of the dependency of 5 at 0 on / at i/r. We now make this precise. Assume a structure T, and a formula >. Suppose that we annotate the states with sets of subformulae, such that the sets are locally consistent: that is, s is annotated with a conjunction iff it is annotated with both conjuncts; s is annotated with a disjunction iff it is annotated with at least one disjunct; if s is annotated with [a]\lr (respectively, («)^), then all (respectively at least one) ^-successor is annotated with yl/\if s is annotated with a fixpoint or fixpoint variable, it is annotated with the body of the fixpoint. We call such an annotated structure a quasi-model. A choice function / is a function which for every disjunctive subformula ^\V\l/2 and every state annotated with \lr\ v 1/^2 chooses one disjunct f(s,\l/\ v 1/^2); and for every subformula (a)}// and every state s annotated with (a)}// chooses one ^-successor t = f(s, (a)}//) annotated with i/r. A pre-model is a quasi-model equipped with a choice function. Given a pre-model with choice function / , the dependencies of a state s that satisfies a subformula x/r are defined thus: s@'ilr\ A x/rz > s@\l/i for / = 1, 2; s@[a]\lr > t@\// for every t such that s - ^ t; s@\l/\ w \j/2> s@f(s, f\ v 1/^2); s@{a)^ > f(s, {a)xlr)@\l/; s@^Z.\lr > s@\lf; s@Z > s@\l/ where Z is bound by ^ Z. 1/^. A trail is a maximal chain of dependencies. If every trail has the property that the highest (i.e., with the outermost binding fixpoint) variable occurring infinitely often is a y-variable, the pre-model is well-founded. (Equivalently: in any trail, a /x-variable can only occur finitely often unless a higher variable is encountered.) The fundamental theorem on the semantics of the modal mu-calculus can now be stated: This is the same paper where bisimulationfirstappears.
312
J. Bradfield, C Stirling
THEOREM 1. A well-founded pre-model is a model: in a well-founded pre-model, if s is annotated with i/r, then indeed s |= i/r.
The theorem in this form is due to Streett and Emerson in [68], from which the term 'well-founded pre-model' is taken. Stirling and Walker [65] presented a tableau system for model-checking on finite structures, and the soundness theorem for this is essentially a finite version of the fundamental theorem with a more relaxed notion of choice; the later infinite-state version of [13,8] is the fundamental theorem, again with a slight relaxation on choice. A converse is also true: 2. If in some structure s \= (f), then there is a locally consistent annotation of the structure and a choice function which make the structure a well-founded pre-model. THEOREM
The fundamental theorem, in its various guises, is the precise statement of the slogan '/x means finite looping'. To explain why it is true, we need to make a finer analysis of approximants. Assume a structure T, valuation V, and formula 0 in positive normal form. Let Y\, ...,Yn be the /x-variables of 0, in an order compatible with formula inclusion: that is, if fiYj.-il/j is a subformula of ^lYi.ijri, then / ^ 7 . If K, is some inner fixpoint, then its denotation depends on the meaning of the fixpoints enclosing it: for example, in the formula ijiY\.{a)iJiY2.(P V Y{)v (b)Y2, to calculate the inner fixpoint 11Y2 we need to know the denotation of Y\. We may ask: what is the least approximant of Y\ that could be plugged in to make the formula true? Having fixed that, we can then ask what approximant of Y2 is required. This idea is the notion of signature. A signature is a sequence a = a i , . . . , a,, of ordinals, such that the / least fixpoint will be interpreted by its of/th approximant (calculated relative to the outer approximants). The definition and use of signatures inevitably involves some slightly irritating bookkeeping, and they appear in several forms in the literature. In [68], the Fischer-Ladner closure of 0 was used, rather than the set of subformulae. The closure is defined as for PDL (see Section 2.1), with the addition of the rule that if ^ Z. if{Z) e cl(0), then iA(^ Z. x//) € cl(0). The signatures were defined by syntactically unfolding fixpoints, rather than by semantic approximants. In [65] and following work, a notion of constant was used, which allows some of the book-keeping to be moved into the logic. Although all the notions and proofs using them are interconvertible, the 'constant' variant is perhaps easier to follow, and has the advantage that it adapts easily to the modal equation system presentation of modal mu-calculus, which we shall see below. Indeed, it arises more naturally from that system. Add to the language a countable set of constants U,V, Constants will be defined to stand for maximal fixpoints or approximants of minimal fixpoints. Specifically, given a formula 0, let Ki,..., Y,j be the /x-variables as above, let Z i , . . . , Z,„ be the y-variables, let a = a i , . . . , a„ be a signature, and let f/i,..., L^„, Vi,..., V,„ be constants, which will be associated with the corresponding variables. They are given semantics thus: if Yi is bound by /xF/.V^/, then \\Ui \\a is W/JLY"' .i/r/||^, where x//'. is obtained from x/fi by substituting the corresponding constants for the free fixpoint variables of /xYi.x/fi. If Z, is bound by
Modal logics and mu-calculi: An introduction
313
vZi.yj/i, its semantics is WvZi.f'-Wa. Given an arbitrary subformula yj; of 0, we say a state s satisfies i/r with signature cr, written s \=^o i^/^^s e W^I/'Wo^ where ^' is i/r with its free fixpoint variables substituted by the corresponding constants. Order signatures lexicographically. Now, given a pre-model for 0, extend the annotations so that each subformula at s is accompanied by a signature - write s@\lf[(T]. Such an extended annotation is said to be locally consistent if the signature is unchanged or decreases by passing through Boolean, modal, or y-variable dependencies, and when passing through s@Yi it strictly decreases in the /th component and is unchanged in the 1,...,(/ — l)th components. It can now be shown, by a slightly delicate but not too difficult induction, that if 5@V^[a], then ^ |=^ i/r. Furthermore, given a well-founded pre-model, one can construct a locally consistent signature annotation - essentially, the K, component of cr in 5@i/r[a] is the maximum 'number' (in the transfinite sense) of F, occurrences without meeting a higher variable in trails from s@-4r, and so on; the well-foundedness of the pre-model guarantees that this is well-defined. This gives the fundamental theorem. (A little care is required to get the details of this argument correct, as will be seen from an inspection of the proofs in [68,65,8].) The converse is quite easy: given a model, annotate the states by the subformulae they satisfy; for ^@V^ assign the least a such that s \=o '^\ and choose a choice function that always chooses the successor with least signature. It is easy to show that this is a wellfounded pre-model and signature assignment.
4.2. The finite model property and decidability The notion of well-founded pre-model was introduced by Streett and Emerson in order to estabhsh the 3. The modal mu-calculus is decidable; that is, it is decidable whether a formula has some model. THEOREM
As a corollary of this proof, they obtained the small model property 4. If a modal mu-calculus formula has a model it has a finite model of size exponential in the size of the formula. THEOREM
These results were obtained by appealing to automata theory. First of all, one can easily show that if a formula has a model, it has a model that is a tree (just unravel the original model), and has bounded branching degree (just cut off all the branches that are not actually required by some diamond subformula; this leaves at most (number of diamond subformulae) branches at each node). We can now construct an automaton that accepts such bounded-branching tree models, by combining a finite-state automaton to check the local consistency (i.e., to check that the putative model is a pre-model), and a Rabin automaton (see Section 6) to check that the pre-model is well-founded. Thus the formula is satisfiable if this product automaton accepts some tree. Now established automata theory tells us that (a) this question is decidable (b) if such an automaton accepts some tree, it
314
J.Bradfield, C.Stirling
accepts a regular tree, that is, one that is the unravelling of a finite system; this gives the results. One can, however, obtain a small model property, and thence decidability, by a more direct argument on models. Take a pruned tree model as above, and equip it with an annotation and choice function to make it a well-founded pre-model. Consider an outermost maximal fixpoint vZ.xj/, say. Look at the first occurrence of a state s labelled by Z; let F be the set of formula annotating s. Now, if there is a state t below s that is also annotated by F, prune the tree at /, and identify t with s. Repeat for all Z labelled states with repetitions below them. On the remaining infinite branches of the tree, Z does not occur infinitely often; and by the well-foundedness of the pre-model, no immediately inferior least fix-point occurs infinitely often either; so we still have a well-founded pre-model. Now repeat the procedure with the next maximal fixpoint in, and so on. When all fixpoints have been processed, the result is a finite graph that is still a well-founded pre-model. The repetition detection is reminiscent of the filtration technique we saw for PDL. Unfortunately, filtration is not sound for minimal fixpoints, so we have this less constructive procedure. It generates, naively, a model of triply exponential size; but it is intuitively easy, and of course the existence of even a triply exponential model is enough to give decidability. One can improve the complexity somewhat by being less simple-minded, but to obtain the exponential upper bound of [68], which is in fact also the lower bound, one needs the more sophisticated techniques of automata or games. A different method for obtaining the small model property proceeds via a normal form result for modal-mu calculus. A formula is in "automaton normal form", anf, if it belongs to the following sublogic. • P, --P and Z are anfs. • If 01 and 02 are anfs, so is 0i v 02. • If 0 is an anf, then so are vZ.
(a)r= /\{a)(t>A[a]\/ (per
(p.
(per
Walukiewicz in [74] (and see also [33]) proved that every (closed) modal mu-calculus formula is equivalent to an anf formula. Walukiewicz calls anfs "disjunctive formulae". However they are very close to characteristic automata (and in fact games). The proof of the normal form result uses automata. What is interesting is that an anf formula is satisfiable iff all its fixed point subformulae fxZ.cpiZ) are replaced with 0(fO and all subformulae vZ.(t>{Z) are replaced with 0(tt). The result of these substitutions is a modal mu-calculus formula without fixed points, for which proof of the finite model property is easy. 4.3. Axiomatization A related problem to decidability is the question of providing an axiomatization of the theory of the modal mu-calculus. In his original paper, Kozen presented the following
Modal logics and mu-calculi: An introduction
315
axiomatization of the equational theory, where 0 ^ i^ means > v T/^ = i/r, taking () and /x as primitives and defining [] and v by duality: (1) axioms for Boolean algebras; (2) (a)0v(a)iA = (fl)(0vVr); (3) {a)(t)A[a]xlr^{a)((l)Axlr); (4) (a)ff=ff; (5) (t){iuiX,(f>(X))^fxX.(t>iX); (6)
^W ^ ^ fiX.(t>(X)^if' Axiom (5) is the axiom of fixed point induction, in dual form; rule (6) says that /x is indeed the least pre-fixed point. (An equivalent presentation of the axiom system is as an extension of minimal multi-modal logic K, with the additional axiom 0(/>6X.(/)(X)) =» fiX.cpiX) and the additional inference rule if 0(i/^) => xj/ then /xX.0(X) =>• xfr.) However, despite the naturalness of this axiomatization, Kozen was unable to show that it was complete. He was, however, able to show completeness for a restricted language, the language of aconjunctive formulae, in which (roughly) fixpoint variables are not allowed to occur in both branches of a conjunction. Completeness for the full language remained open for more than a decade, until it was finally solved by Igor Walukiewicz in [74], who established that Kozen's axiomatization is indeed complete. The proof is very involved and utilises automata normal form described above (which generalises the aconjunctive fragment). It is reasonably straightforward to show using tableaux that if an anf formula 0 is consistent^ then it has a model. Much harder to prove is that every (closed) formula is provably equivalent within the axiom system to an anf formula. Walukiewicz utilises automata and games to show this. More information can also be found in the notes [75].
4.4. Model-checking Decidability and axiomatization are standard questions for logicians; but for the practioner, the important question is model-checking: given a system T with some initial state s and a formula 0, is it the case that ^ f= 0? For the modal mu-calculus, the decidability of this question is obvious, for finite systems; the problem is, what is its complexity? There have been great technological advances in the model-checking of finite-state systems by the use of clever data structures such as BDDs. There have also been useful advances for fragments of the modal mu-calculus. However, there has been only one notable improvement in our knowledge of the complexity of the general problem, and a full answer to the question remains something that haunts our dreams - literally, for at least one of the authors! To discuss the complexity of model-checking, we need to introduce the notion of alternation depth of a formula. We shall define this more precisely in the following subsection, which examines alternation. For the moment, it is sufficient to define it loosely as the maximum number of /JL/V alternations in a chain of nested fixpoints. In fact we usually add the ^ A formula (f) is consistent with respect to an axiom system if 0 =^ ff is not derivable within the axiom system. Completeness of an axiom system is equivalent to the statement that every consistent formula has a model (is satisfiable).
316
/ Bradfield, C Stirling
proviso that the nesting is genuine interdependence of the 'infinitely often' kind rather than mere inclusion of closed subformulae of the 'always eventually' kind (see Section 3.5); but the proviso may be ignored without changing the essentials of the arguments. Suppose that we simply 'model-check' by brute force calculation of the approximants. Let the size (number of states plus number of transitions) of the system be n, the length of the formula be m. Every fixpoint closes at, at worst, the nth approximant. Calculating the booleans takes time 0(n); calculating modalities takes time 0(n). For an innermost fixpoint, given a valuation of the free variables, we may need to evaluate the body n times to close. So the innermost fixpoint takes time 0(n • (mn)). Now the next fixpoint out may also need to be evaluated n times, each of which involves evaluating the inner fixpoint (and some non-fixpoint operators); and so that takes 0(M • n • (mn)). And so on: so we end up with 0(m • n^"^'), where d is the depth of fixpoint operators. It turns out that by general results on fixpoints in lattices [7], adjacent fixpoints of the same type, such as /xy./xZ.0(y, Z) are not much worse than one, for the following reason: since ||/xZ.0(y""^\ Z)|| 2 ||/xZ.0(y^, Z)||, and the formulae are monotone, when one evaluates the ith outer approximant, one need not start evaluating the inner fixpoint from 0, but from wherever one had reached on finishing the (/ — l)th outer approximant. Alternatively, one can turn /xF./xZ.^ into a single fixpoint over a vector: /x(X, Y).(t). Thus we obtain the theorem of Emerson and Lei [25]: THEOREM 5. The model-checking problem for a formula of size m and alternation depth d ona system of size n is 0(m • n^'^^).
This theorem holds for the simple-minded notion of alternation, for the somewhat more refined version that Emerson and Lei used, and for the stronger notion of Niwinski [50]. So model-checking appears to be exponential in alternation depth. If, in the usual way, one defines the size of the problem to be the size of the system plus the size of the formula, this means that the problem seems to be exponential. Of course, it is a very well-behaved exponential, both theoretically, as by stratifying the formulae according to alternation depth one gets a chain of polynomial problems of increasing degree; and practically, because systems are typically large, formulae are typically small, and alternation depths are typically 1 or 2. However, it does not appear that the model-checking problem is polynomial. On the other hand, it is readily apparent that the problem is in NP. This was first remarked by Emerson, Jutla and Sistla in [24], who used an automata-theoretic argument. However, it can be seen directly [63]: take a model, and guess the right choice function and annotation to make it a well-founded pre-model. Now to check that it really is a well-founded pre-model, we need to check local consistency of the annotation, which is polynomial (and in fact quadratic); and we need to check well-foundedness. But to check well-foundedness on a finite pre-model, it suffices to show that there are no bad loops in the dependencies: if a minimal fixpoint occurs infinitely often without a higher fixpoint appearing, then there must be some state that occurs twice (and indeed infinitely often) labelled with that fixpoint. To check this, we can do strongly connected component analysis: starting from the bottom up, for each minimal fixpoint, cut the dependency graph at all higher fixpoints, and then look for a strongly connected component involving the said minimal fixpoint. This analysis is polynomial, of low degree; and we do it for each fixpoint; so the whole check is polynomial.
Modal logics and mu-calculi: An introduction
317
Since model-checking is trivially closed under complementation, the problem is in NP n co-NP. This places it in the very small class of such problems that are not known to be polynomial. Opinion is divided on the likely true complexity; some believe it to be polynomial, but although the P faction includes some most accomplished complexity theorists, no polynomial algorithm has yet been found, either for the mu-calculus itself, or for the stochastic pay-off games to which it can be reduced and which the complexity theorists are really interested in. Others, including exactly one of the authors, believe it to be nonpolynomial; although this would make the world a more interesting place, this belief has the obvious disadvantage of being impossible to confirm definitely without a resolution of P = NP. Of course, even a proof of non-polynomiality subject to P 7^ NP would be highly interesting. We mentioned that there has been one advance in the complexity of global modelchecking. This is due to Long et al. [43]. Essentially, they observed that the monotonicity argument that we applied above to adjacent least fixpoints, can also be applied to a formula of shape /xy.yZ.0(y, Z); by a careful and quite subtle analysis, it can be shown that actually this requires quadratic, not cubic, time to compute. Unfortunately, this does not allow all alternation to be collapsed, but they showed that it generalizes to the extent of proving THEOREM
6. Model-checking is 0(m • «l^^/^^+^).
4.5. Alternation We now look at the notion of alternation in more detail. As we have said, the idea is to count alternations of minimal and maximal fixpoint operators, but to do so in a way that only counts real dependency. The paradigm is 'always eventually' versus 'infinitely often': the 'always eventually' formula
vY.(fiZ.Pv{a)Z)A{a)Y is, using the brute-force model-checker above, really no worse to compute than two disjoint fixpoints, since the inner fixpoint can be computed once and for all, rather than separately on each outer approximant; on the other hand, the 'infinitely often' formula
vY.fiZXPv{a)Z)A{a)Y really does need the full double induction on approximants. The definition of Emerson and Lei takes care of this by observing that the 'eventually' subformula is a closed subformula, and giving a definition that ignores closed subformulae when counting alternations. The stronger notion of Niwifiski, which also has the advantage of being robust under translation to modal equation systems, also observes that, for example, ^JiX.vY.[-]Y A /iZ.[-](X V Z) although it looks like a /x/y//x formula, is morally a /x/y formula, since the inner fixpoint does not refer to the middle fixpoint. The alternation depth referred to in the complexity of model-checking is a measure of alternation that is symmetric in /x and y. It is possible to give algorithms that compute
318
J. Bradfield, C. Stirling
the alternation depth of a formula [25,1,36], and this is how the notion was presented by Emerson and Lei. However, for our purposes it is easier to start from a definition of classes for formula, formalizing the idea of *a /x/v//x formula' etc.; such a definition is analogous to the usual definition of quantifier alternation for predicate logic, an analogy which will be exploited later. This was how Niwinski [50] presented the notion of alternation, and we follow his presentation. Assuming positive form, a formula > is said to be in the classes EQ ^ and IIQ^ iff it contains no fixpoint operators. To form the class D^^^j (respectively n^:{^,, take E,^ ^ ^ Tin ^, and close under the following rules: (1) if 01, >2 € E^^^j (respectively 0,^^,), then 0i v 02,0i A 02, (a)0i, [^]0i € E^^^^j (respectively O,^^,); (2) if 0 G Ef^i (respectively n,^^j), then //Z.0 € E,f^i (respectively vZ.(p e n,^^,); (3) if 0(Z), if € E;^^, (respectively O,^^,), then 0(TA) e E,^^, (respectively O,^^,), provided that no free variable of ^ is captured by a fixpoint operator in 0. If we omit the last clause, we get the definition of 'simple-minded' alternation E„^, that just counts syntactic alternation; if we modify the last clause to read ' . . . provided that xfr is a closed formula', we obtain the Emerson-Lei notion E,f^^. (We write just E^ when the distinctions are not important, or when we are making a statement that applies to all versions.) To get the symmetrical notion of alternation depth of 0, we can define it be the least n such that 0 € E^^j n n^_^,. To make these definitions clear, consider the following examples: • The 'always eventually' formula is 02^, but not ^^2'^, and so its simple alternation depth is 2. However, in the Emerson-Lei notion, it is also E2 ^, since vY.W A {a)Y is n f ^^ and so E2^^^, and by substituting the closed E2^^^ (and in fact Ef ^^) formula /xZ.P V {a)Z for W we get 'always eventually' in E^^^; hence its Emerson-Lei (and Niwinski) alternation depth is 1. • The 'infinitely often' formula is E2 but not 112, in all three definitions, and so has alternation depth 2. • The formula fiX.vY.[~]Y A /iZ.[-](X v Z) is E^^, but not H^^; it is also 11^^^ but not 113 ^, since there are no closed subformulae to bring the substitution clause into play. However, in the Niwinski definition, it is actually E2 ^: vY.[-]Y A M^ is fl, ^ and so E^'^; we can substitute the E|^^ formula /xZ.[-](X v Z) for W without variable capture, and so vy.[-]y A / X Z . [ - ] ( X V Z ) is E^^; and now we can add the outer fixpoint, still remaining in E2 ^. We have already discussed the role alternation depth plays in the complexity of modelchecking. A natural question is whether the hierarchy of properties definable by E,^ formulae is actually a strict hierarchy, or whether the hierarchy collapses at some point so that no further alternation is needed. This problem remained open for a while; by 1990, it was known that E^^ ^ fl^^ [3]. No further advance was made until 1996, when the strictness of the hierarchy was estabhshed by Bradfield [10].
Modal logics and mu-calculi: An introduction
319
THEOREM 7. For every n, there is a formula
formula. Bradfield established this for E,f^, which impHes the result for the other two notions. At the same time, Giacomo Lenzi [41] independently established a slightly weaker hierarchy theorem for E„ ^. Lenzi's proof is technically complex, and the underlying stratagem is not easy. Bradfield's proof appears technically complex, but most of the complexity is really just routine recursion-theoretic coding; the underlying stratagem is quite simple, and in some ways surprising. If one takes first-order arithmetic, one can add fixpoint operators to it, and one can then define a fixpoint alternation hierarchy in arithmetic. A standard coding and diagonalization argument shows that this hierarchy is strict [11]. The trick now is to transfer this hierarchy to the modal mu-calculus. Simply by writing down the semantics, it is clear (give or take some work to deal with the more complex notions of alternation) that if one takes a recursively presented transition system and codes it into the integers, then for a modal formula0 G E ^ , its denotation 1101| is describableby an arithmetic E,^ formula. However, it is also possible, given any arithmetic fixpoint formula x, to build a transition system and a modal formula 0, of the same alternation depth as x. such that ||(/) || is characterized by x • If we take x to be a strict E,^ arithmetic formula, then no n,^ arithmetic formula is equivalent to it, and therefore no n ^ modal formula can be equivalent to 0. The transition system that is constructed is infinite, but by the finite model property, the hierarchy transfers down to the class of finite models. Both proof techniques construct explicit examples of hard formulae. Bradfield's examples are: THEOREMS.
The
H^
^.Xn.vXn-\..
formula ..^lX\ .[c]X\ V (ai)Xi V • • • V (fl,,)A:„
is not equivalent to any Wn formula.
5. More on model-checking In the last section, we saw the approximant approach to model-checking finite systems. In this section, we shall look at some other techniques that have been proposed, and at some of the extensions to deal with classes of infinite processes.
5.1. Local model-checking... The approximant calculation of model-checking is inherently global; calculating a fixpoint approximant involves applying a function over the state space. A variant approach is to use local techniques [65], that is, techniques where to determine the truth of ^ |= 0, one looks at the immediate neighbourhood of s as required by the formula; if there are fixpoints, one
320
/ Bradfield, C. Stirling
will of course move further and further away from s, but one can stop as soon as the truth or falsity of 0 at 5* is established, rather than working with the whole state space. This is attractive when a state is a process expression E belonging to a process calculus, and one doesn't want to build its transition graph explicitly. The formulation adopted was inspired by tableau methods in logic. In outline, suppose we want to check £" [= 0. We start with a sequent E h (p, and then apply rules according to the structure of 0. For example, if 0 = 01 A 02, there is an A-rule which is: £1-01 A 02 £ h 01 £ h 02 and if we get to a sequent ^ h (^)i/^, we apply the ()-rule E —> F. Fhx// The transition E - ^ F is derived from the transition rules for the particular process calculus that E belongs to. If we reach a fixpoint formula, or a variable Z which is bound by ^ Z. T/T, we apply the appropriate fixpoint rule'^
^h^z.yr E\-Z
Ehz Ehf
Thus we build up (or rather down, since the rules grow downwards) a goal-directed tree of sequents to be established. The question is, when do we stop? and how do we know we've succeeded? Obviously we stop on an tz-modality if the process has no a-transitions, in which case E h [«]t/r succeeds and E \- {a)\lr fails; and we stop at £ h P, when we look E up in the proposition valuation to determine success. The key is the treatment of fixpoints. If we get to £ h 0, and we have already seen the same sequent higher up in the tree, then we stop and examine the highest fixed point variable Z between these repeat sequents; the leaf sequent is successful if Z is bound by v and unsuccessful if it is bound by /x. Once we have a finite tree, we propagate success and failure back up to the root via the rules. This proof technique is sound and complete for finite systems. The proof of this fact was another development of the fundamental semantic theorem, for finite models. Indeed, it is probably obvious to the reader (at least the reader who has read Section 4.1) that the construction of a successful tableau gives a well-founded pre-model, and that a wellfounded pre-model is a tableau. This statement needs to be interpreted carefully. In the basic tableau construction, sequents E \- {a)\l/ and E h (pv \lr may occur many times on different branches, with different successors; however this could easily be outlawed, and indeed should be outlawed if one wishes to develop an algorithm from the proof method. A variant perspective on tableau is provided by games [63]. Consider two players Verifier and Refuter. A sequent is now a game position. At £ h 0 A V^ Refuter chooses £ 1 - 0 This is a variant presentation. In the original [65] system, fixpoints were first replaced by constants, and then unfolded. This allowed the termination condition to be expressed simply, but at the expense of efficiency.
Modal logics and mu-calculi: An introduction
321
or EY- \j/ and similarly at £" h [«]> Refuter chooses a possible next position F h- 0 when E - % F. Verifier chooses when the main connective of the sequent is v or {a). A play of a game is just a sequence of sequents. The winning conditions are as for tableaux. For instance Refuter wins E h {a)(t> if E has no «-transitions. A play halts if a position is repeated, and the winner is determined by the highest fixpoint variable. From the fundamental theorem it follows that F |= 0 (£ ^ 0) iff Verifier (Refuter) has a history-free winning strategy for the game which starts at F h 0 . ' ' Model checking games are instances of parity games (which are briefly mentioned later). A history-free winning strategy, unlike a tableau, is linear in the size of the model checking problem. Games provide a basis for efficient model checking when one asks, is it the case ^ |= 0? and why? If the answer is returned with a winning strategy, a user can be the opponent and play against the machine which always wins! This can be helpful in understanding why the property holds - or more importantly, perhaps, in understanding why a desired property fails. The proof rules for tableau mentioned above are guided by the structure of the formulae. However when F is a process expression it also has structure, built from the combinators of the particular process calculus. It is possible, for instance [2], to have rules which are guided by process structure. A simple example is to inductively define the effect of the CCS restriction operator \a on modal mu-calculus formulas. For instance, (0 v •\lf)\a is 0\a V i/r\a and (vZ.(t))\a is vZ.(t)\a. More important is the effect on modalities ([K](l))\a is [K - {a, 'a](l)\a (where ^ is ^'s partner). The idea is that \^ on formulas is an inverse of its application to processes. Parallel composition is more problematic. However one can define a "slicing" operator / F , where F is a process expression operator, on formulae which is an inverse of parallel composition [2]. Tableau rules as follows are thereby justified E\aV-(t) E\-(l)\a
E\F\-(t) E\-(t)/F'
5.2. ... for infinite systems Apart from its locality, another feature of the goal-directed tableau approach is that it can be generalized to use symbolic methods, so allowing the proof of properties of infinite systems (or just large systems). The idea is to use sets of states in sequents, rather than single states; then in the v and ()-rules, an explicit choice function is given; termination happens when we construct a sequent S h Z such that we have already seen a sequent 5" h Z for S' 5 S, with no higher fixpoint intervening; and success involves giving a proof that all the dependency trails are well-founded. This latter is typically done by defining some well-founded measure on processes, and showing that it decreases as one passes through minimal fixpoints, and doesn't increase elsewhere. The canonical such measure is the signature, as described in Section 4.1, but simpler measures may suffice. Thus an infinite state tableau constructs a finite presentation of a well-founded quasi- or pre-model. Details may be found in [8,13], and an example of a Petri net implementation in [9]. ^ ^ A winning strategy is a set of rules which tell a player how to move. A player uses a strategy in a play if all her moves obey the rules in it. A history-free strategy is one which is independent of previous positions in a play. A strategy is winning for a player if she wins every play in which she uses it.
322
/ Bradfield, C. Stirling
5.3. Decidable model-checking for infinite processes The infinite-state tableau system just described makes no claims for decidability: it allows arbitrary mathematical reasoning to be used in establishing the termination and success conditions. An obvious question is to ask what can be done for infinite processes while retaining decidability; the answer is quite limited. Clearly model-checking is undecidable for any Turing-powerful class of processes, since lJiZ,[—]Z expresses the halting property. It turns out to be easy to code halting in the modal mu-calculus, or even in small fragments of linear temporal logic, for many classes that are not Turing-powerful by themselves. For example, if we try to model a register machine as a Petri net, we need to test for zero, which nets cannot do; but if 6^ is a transition that can fire when a particular place is non-empty, then [^]ff expresses the emptiness of that place, and so one can write a mu-calculus formula which says 'the net halts, if we look at those "honest" computations where a branch-on-zero is only taken when the corresponding counter really is zero'. Similarly, it is unnecessary for the registers actually to synchronize with the finite-state control, as we can encode the synchronization into the formula. The upshot of this is that model-checking, even with just one fixpoint, is undecidable for BPP, Basic Parallel Processes - a result which might be surprising, given the decidability of bisimulation for BPP. On the other hand, for BPA, Basic Process Algebra, and for its generalization pushdown processes, model-checking is decidable. This follows from a classical result of Muller and Schupp [48] on the monadic second-order theory of pushdown graphs; but it has been shown by a direct and elegant argument by Burkart and Steffen [16]. They view pushdown processes as 'higher-order' transition graphs. For example, the BPA process system given by A = aBA-\- c and B = bB A-\- c is viewed as a system where the A process does an a transition followed by a ^ transition, understood as a recursive call to B, and returns to its initial state (if B terminates), or does a c to terminate. Now, if we are interested in a particular formula 0, each transition, including the 'higher-order' transitions, is viewed as a predicate transformer on the subformulae of 0: assuming that some subformula hold at the terminal state of the process, which formulae hold at the initial state? Obviously there are only finitely many possibilities, and the result can be calculated by an approximantstyle procedure. If one now plugs into the A transformer the formulae that are true at a real terminal state, one obtains the formulae true of A. Further detail on all these results can be found in the chapter by Burkart et al. later in this Handbook [15].
5.4. Equation systems and efficient local model-checking Recall that in Section 3.1 we presented fixpoints as modal equations. We have also seen mention of vectorial fixpoints, allowing the collapse of adjacent fixpoints of the same sign into one. Combining these ideas, we say a modal equation system is a set {X/y = 0/y | 1 ^ / < m, 1 ^ 7 ^ «/} of equations, where each 0,^ is a modal (no fixpoints) formula in the variables Xij; for each /, the set [Xij = (pij | 1 ^ 7 ^ n,} is a block, and each block is either maximal or minimal; say, wlog, that odd blocks are minimal and even blocks are maximal.
Modal logics and mu-calculi: An introduction
323
There is no semantic ordering within a block, but the set of blocks is partially ordered; the ordering 1 , . . . , w of block indices is a linearization of this partial order. The semantics of such a system is given by treating each block as a vectorial fixpoint of the appropriate sign, with the nesting of fixpoints given by the partial ordering on blocks. By the obvious replacement of higher-numbered right-hand side variables by their defining equations, a modal equation system can be turned into a modal mu-calculus formula defining Xi i. Modal equation systems are a concise way of representing properties, as the direct use of variables referring to equations instead of explicit fixpoint formulae allows sharing between equations. For example, \iX\\ =(t>\\ and X12 = 012 both refer to X21 = 021. then to write the system in linear form we have to write the text of 021 twice, once in each 0i/; and so one can obtain an exponential (in the number of blocks) blowup by going from equation systems to normal modal mu-calculus. However, results about the modal mu-calculus in its linear form normally transfer without cost (save in intellectual effort) to equation systems. A Boolean equation system (BES) is similar, except that the variables are just booleans, not states, and the equations contain only Boolean operators. Thus a BES stands to a formula of Boolean logic with fixpoints*^ as a modal equation system stands to a modal mucalculus formula. A modal equation system together with a modal structure can be turned into a Boolean equation system, by treating a (state, modal variable) pair as a Boolean variable. Perhaps surprisingly, this is sometimes worth doing: BES's have the advantage that they strip away the modal operators and the artificial linearization imposed by text, laying bare the problem of computing alternating fixpoints. BES's have been studied by, among others, Andersen [I], Vergauwen and Lewi [73] and Mader [44]. Lui, Ramakrishnan and Smolka [42] presented a BES-based local model-checking algorithm that is quite short, relatively simple, and of similar efficiency to global model-checking.
6. Automata, games and logic There are other formalisms that are intimately related to fixpoint logics, and in this section we shall give an overview of automata and games, which are the main examples. The relationship benefits both parties: the modal mu-calculus provides simple proofs of some automata-theoretic results, and automata theory is used in the proof of modal mu-calculus results.
6.1. Automata The history of automata-theoretic approaches to verification and associated fields has involved ever more invention of new types of automata, as it becomes apparent that some particular restriction is technically inconvenient and can be lifted without harm. In order to explain the main results, we shall need to introduce several of these varieties; let us start at the beginning. A deterministic automaton on finite words is the usual deterministic finite state machine, accepting finite words over its input alphabet; a run of such an automaton is a path A suitable candidate for the title prepositional mu-calculus.
324
/ Bradfield, C Stirling
through the machine matching the input, and it accepts if the final state is accepting. A nondeterministic automaton on finite words is the usual notion, namely that the transition function may specify more than one successor state for a given state and input letter; a run of such an automaton requires choosing one successor at each non-deterministic choice, and the automaton accepts its input if some run accepts that input. There are now several orthogonal generalizations of this idea. Firstly, we may allow infinite words as well as finite words. In this case, we must specify acceptance conditions which determine when an infinite run is successful. There are many of these; the most important are as follows. A BUchi acceptance condition specifies a set G of states, such that we infinitely often meet a G-state on the run (mnemonic: a green light must flash infinitely often). A Rabin acceptance condition specifies k sets /?/ and k sets G,, and requires that for some /, we see G, infinitely often, and don't see /?/ infinitely often (mnemonic: k sets of lights; there must be one set where we see green often and don't see red often). In a Mostowski or parity acceptance condition, each state of the automaton is assigned an integer rank, and the highest rank occurring infinitely often must be even (there is no general agreement on highest/lowest or even/odd in this definition). In the next dimension, we may feed the automata trees rather than words. To start with, assume that the branching degree is fixed at n. The automaton transition function now specifies n successors, and notionally the automaton splits into n copies as it passes to the successors, so a run is a tree matching the input tree. The run is successful if all paths through the run satisfy the acceptance condition, which is specified as above. In the case of a non-deterministic tree automaton, the transition is chosen non-deterministically, but each transition specifies n successors. We can generalize this to automata on trees whose branching degree varies according to the label, or to trees whose branching degree is freely variable (so-called amorphous automata). Finally, we can complicate the success conditions as follows: instead of saying just that every path through the run accepts, we can say that the subrun rooted at a node n is accepted if some Boolean combination, depending on the state, /({7^}) holds, where Ti is the statement that the subrun rooted at «'s /th child is accepted, and that the run is accepted if the subrun starting at the root is accepted, provided the global acceptance condition is met. The global acceptance condition is most easily formulated game-theoretically, as we shall see later, but one can think of it in mu-calculus terms as being: there must exist a choice function which for each node selects a satisfying assignment for /({T/}), and thus selects some children; then every path through the selected nodes must meet the Rabin etc. acceptance condition. These are alternating automata. Warning: this alternation is that between 3 and V; nothing to do with fixpoint alternation! If the Boolean combination is just conjunction, /({T,}) = A/ ^/^ ^^ g^^ a normal tree automaton; if it is disjunction, we get a tree automaton that accepts if some path accepts, rather than if all paths accept, giving a form of non-determinism. It is probably not much of a surprise that: 9. Modal mu-calculus formulae are equivalent to alternating amorphous parity automata (on trees).
THEOREM
The equivalence is simple: a diamond modality corresponds to a node whose Boolean success combination is disjunction, a box modality to one whose success combination is
Modal logics and mu-calculi: An introduction
325
conjunction; and if one assigns ranks to the fixpoint operators that are consistent with subformula inclusion, with even ranks for maximal fixpoints and odd for minimal, the parity condition asserts that the obviously induced tree pre-model is well-founded. A rather more surprising fact is THEOREM
10. Ordinary Rabin automata are equivalent to alternating parity automata
{on trees). It is obvious that a Rabin automaton can be turned into an alternating parity automaton. However, the reverse construction is not so easy. It is quite easy to turn a parity condition into a Rabin condition, but it is harder to remove the alternation, and a large size blowup is required. In terms of modal mu-calculus formulas this is precisely the transformation into automaton normal form, anf, mentioned earlier, which has no V/3 alternation. As a corollary, we have THEOREM
11. Rabin automata are equivalent to modal mu-calculus formulae {on trees).
The theory of automata on infinite objects is highly developed. Wolfgang Thomas [70] provides a survey of the entire area, and Niwinski's [51] is a fundamental study of automata and fixpoint logics, including much useful background material. Here we shall just mention a few more of the immediate connections with modal mu-calculus. • In Rabin's original paper, one of the hardest lemmas was proving that Rabin automata are closed under complementation. Given the above, it is now 'obvious', since modal mu-calculus is closed under complementation by definition. • Rabin automata have the nice property that if they accept some tree, they accept some regular tree: that is, a tree that is the unravelling of a finite system. This gives the finite model property of the modal mu-calculus, as we have seen. • The emptiness problem for Rabin automata is decidable. Hence one can model-check by forming the product of the system with the Rabin automaton, and checking for emptiness, as we have also seen. We have mentioned mostly Rabin automata. Biichi automata on trees are strictly less expressive than Rabin automata. However, on words, parity, Rabin and Biichi automata are equivalent, and one has 12. Rabin/BUchi/parity automata on infinite words are equivalent to linear time mu-calculus formulae.
THEOREM
The fact that Biichi and parity automata are equivalent on words is the automatatheoretic analogue of the fact that the fixpoint alternation hierarchy collapses in linear-time mu-calculus. On trees, alternating Biichi automata correspond to 112 ^^^^^ mu-calculus formulae. 6.2. Monadic second-order logic To continue the story, we bring in monadic second-order logic, studied by Rabin in his original paper. SnS is the monadic second-order logic of the «-ary tree, so that elements
326
/ Bradfield, C Stirling
are nodes of the tree, the n successor relations are in the logic, first-order quantification over nodes is allowed, and quantification over sets, but not relations, of nodes is allowed. Rabin showed that SnS is equivalent to Rabin automata. It follows that on trees, SnS is equivalent to modal mu-calculus. This is a very curious result, since at first sight, SnS offers much more power. (It is obvious that mu-calculus is a sublogic of SnS since the definitions of greatest and least fixed point are monadic second-order definitions.) For one thing, we can talk about ancestors and cousins of nodes; for another, arbitrary secondorder quantification looks more powerful than just fixpoints. But in fact neither of these gives more power. If we consider transition systems rather than trees, David Janin and Igor Walukiewicz [33,34] have recently developed appropriate generalizations of this theory. We already know that modal mu-calculus respects bisimulation; it now turns out that THEOREM 13. A formula in the monadic second-order language of transition systems is expressible in modal mu-calculus exactly if it respects bisimulation.
6.3. Games Games have played an important role in many areas of mathematics, but especially in logic. The so-called Ehrenfeucht-Frai'sse games characterize first-order logic, and extensions and restrictions of them characterize various extensions and restrictions of first-order logic. In a similar manner, we can define games for the modal mu-calculus. Technically, such games are fairly trivial reformulations of automata or tableaux; but they have good explanatory power, and, more surprisingly, provide useful approaches to model-checking. Owing to the extensive use of games in finite model theory, game formulations of mu-calculus problems assist in exploring the close relationships with finite model theory. A parity game is played by two players, Abelard and Eloise.^'^ An arena for the game is a graph, in which each node is labelled as either an Abelard or Eloise node, and also labelled with a rank, as in parity automata. A play of the game consists of a sequence of moves in which the appropriate player chooses a successor of the current node; Eloise wins if the play ends in Abelard getting stuck, or if the play is infinite and the highest rank occurring infinitely often is even. It may be convenient to designate certain nodes as immediate Abelard/Eloise wins, for example to deal with atomic propositions in the mu-calculus. A strategy for one player is a function which given a partial play from which the player is due to move, gives the next move. A winning strategy is one which if followed guarantees a win. A strategy is history-free (or memoryless) if it depends only on the current position in the game. ^^ Game presentations are plagued by the variety of names for the players. In Ehrenfeucht-Fraisse games, they are traditionally called Player I and Player II. In finite-model theory they are called Duplicator and Spoiler, but the meaning of these names does not transfer happily to all situations. Other possibilities are Player and Opponent, or Player 0 and Player 1, or for model checking Verifier and Refuter. Our choice, introduced by Wilfrid Hodges, has the advantage of being formally meaningless, but with a mnemonic for remembering which player is which in appUcations: Vbelard and Eloise.
Modal logics and mu-calculi: An introduction
327
It should be obvious that, for example, modal mu-calculus model-checking can be viewed as a parity game from the discussion in the previous section: the game graph comprises pairs of states and formulae, with transitions given by the dependencies (that is, it is a quasi-model, in the terminology of Section 4.1). Abelard owns the conjunction, box, and maximal fixpoint nodes; Eloise the others; the ranks are assigned as for parity automata. The statement 'Eloise has a winning strategy' is equivalent to the statement that the corresponding alternating parity automaton has an accepting run is equivalent to the statement that the structure satisfies the formula. Equipping the structure with a choice function corresponds to giving Eloise a history-free strategy; and so by the fundamental theorem and duality, a player has a winning strategy iff they have a history-free winning strategy.
References [1] H.R. Andersen, Verification of temporal properties of concurrent systems, DAIMI PB-445, Computer Science Dept., Aarhus University (1993). [2] H.R. Andersen, C. Stirling and G. Winskel, A compositional proof system for the modal jjL-calculus, Proc. 9th IEEE Lies (1994), 144-153. [3] A. Arnold and D. Niwinski, Fixed point characterization of Biichi automata on infinite trees, J. Inform. Process. Cybernet. EIK 26 (1990), 451-^59. [4] J.W. de Bakker, Mathematical Theory of Program Correctness, Prentice-Hall, Englewood Cliffs, NJ (1980). [5] B. Banieqbal and H. Barringer, Temporal logic with fixed points. Temporal Logic in Specification, Lecture Notes in Comput. Sci. 398 (1989), 62-74. [6] H. Barringer, R. Kuiper and A. Pnueli, Now you may compose temporal logic specifications, Proc. 16th ACM STOC (1984), 51-63. [7] H. Bekic, Definable operations in general algebras, and the theory of automata and flow charts. Programming Languages and Their Definition, Lecture Notes in Comput. Sci. 177 (1984). [8] J.C. Bradfield, Verifying Temporal Properties of Systems, Birkhauser, Boston (1991). [9] J.C. Bradfield, A proof assistant for symbolic model-checking, Proc. CAV '92, Lecture Notes in Comput. Sci. 663 (1993), 316-329. [10] J.C. Bradfield, The modal mu-calculus alternation hierarchy is strict, Theoret. Comput. Sci. 195 (1997), 133-153. [11] J.C. Bradfield, Simplifying the modal mu-calculus alternation hierarchy, Proc. STACS '98, Lecture Notes in Comput. Sci. 1373 (1998), 39-49. [12] J.C. Bradfield, J. Esparza and A. Mader, An effective tableau system for the linear time mu-calculus, Proc. ICALP '96, Lecture Notes in Comput. Sci. 1099 (1996), 98-109. [13] J.C. Bradfield and C.P. Stirling, Local model checking for infinite state spaces, Theoret. Comput. Sci. 96 (1992), 157-174. [14] J.R. Biichi, On a decision method in restricted second order arithmetic. Logic, Methodology and Philosophy of Science, Proc. 1960 Congress, Stanford Univ. Press, Stanford, CA (1962), 1-11. [15] O. Burkart, D. Caucal, F. Moller and B. Steffen, Verification on infinite structures. Handbook of Process Algebra, J.A. Bergsta, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 545-623. [16] O. Burkart and B. Steffen, Model checking for context-free processes, Proc. CONCUR '92, Lecture Notes in Comput. Sci. 630 (1992), 123-137. [17] E.M. Clarke and E.A. Emerson, Design and synthesis of synchronization skeletons using branching time temporal logic. Lecture Notes in Comput. Sci. 131 (1981), 52-71. [18] E.M. Clarke, E.A. Emerson and A.P Sistla, Automatic verification of finite-state concurrent systems using temporal logic specifications, ACM Trans. Programming Languages and Systems 8 (1986), 244-263. [19] M. Dam, CTL* and ECTL* as fragments of the modal mu-calculus, Theoret. Comput. Sci. 126 (1994), 77-96. [20] A. de Morgan, A Budget of Paradoxes, Longmans, Green, and Co., London (1872).
328
/ Bradfield, C Stirling
[21] E.A. Emerson, Temporal and modal logic. Handbook of Theoretical Computer Science, Vol. B., J. van Leeuwen, ed., Elsevier (1990), 995-1072. [22] E.A. Emerson and E.M. Clarke, Characterizing correctness properties ofparallel programs using fixpoints, Procs ICALP '80, Lecture Notes in Comput. Sci. 85 (1980), 169-181. [23] E.A. Emerson and C.S. Jutla, Tree automata, mu-calculus and determinacy, Proc. 32nd IEEE FOCS (1990), 368-377. [24] E.A. Emerson, C.S. Jutla and A.P. Sistla, On model checking for fragments of p-calculus, Proc. CAV '93, Lecture Notes in Comput. Sci. 697 (1993), 385-396. [25] E.A. Emerson and C.-L. Lei, Efficient model checking in fragments of the propositional mu-calculus, Proc. 1st IEEE L i e s (1986), 267-278. [26] M.J. Fischer and R.E. Ladner, Propositional dynamic logic of regular programs, J. Comput. System Sci. 18 (1979), 194-211. [27] R. Royd, Assigning meanings to programs. Mathematical Aspects of Computer Science, J.T. Schwartz, ed., Amer. Math. Soc., Providence, RI (1967), 19-32. [28] Y. Gurevich and L. Harrington, Trees, automata and games, Proc. 14th ACM STOC (1982), 60-65. [29] D. Harel, A. Pnueli and J. Stavi, Propositional dynamic logic of context-free programs, Proc. 22nd IEEE FOCS (1981), 310-321. [30] M. Hennessy and R. Milner, On observing nondeterminism and concurrency, Proc. ICALP '80, Lecture Notes in Comput. Sci. 85 (1980), 295-309. [31] C.A.R. Hoare, An axiomatic basis for computer programming, Comm. ACM 12 (1969), 576-580. [32] H. Huttel, SnS can be modally characterized, Theoret. Comput. Sci. 74 (1990), 239-248. [33] D. Janin and I. Walukiewicz, Automata for the p-calculus and related results, Proc. MFCS '95, Lecture Notes in Comput. Sci. 969 (1995), 552-562. [34] D. Janin and I. Walukiewicz, On the expressive completeness of the propositional mu-calculus with respect to monadic second order logic, Proc. CONCUR '96, Lecture Notes in Comput. Sci. 1119 (1996), 263-277. [35] R. Kaivola, On modal mu-calculus and Biichi tree automata. Inform. Process. Lett. 54 (1995), 17-22. [36] R. Kaivola, Using automata to characterise fixpoint temporal logics, Ph.D. Thesis, University of Edinburgh (1997). [37] D. Kozen, Results on the propositional mu-calculus, Theoret. Comput. Sci. 27 (1983), 333-354. [38] D. Kozen, A finite model theorem for the propositional p -calculus, Studia Logica 47 (1988), 233-241. [39] D. Kozen and R. Parikh, An elementary proof of the completeness ofPDL, Theoret. Comput. Sci. 14 (1981), 113-118. [40] L. Lamport, Proving the correctness of multiprocess programs, IEEE Trans. Software Engrg. 2 (1977), 125-143. [41] G. Lenzi, A hierarchy theorem for the mu-calculus, Proc. ICALP '96, Lecture Notes in Comput. Sci. 1099 (1996), 87-109. [42] X. Liu, C.R. Ramakrishnan and S.A. Smolka, Fully local and efficient evaluation of alternating fixed points, Proc. TACAS '98, Lecture Notes in Comput. Sci. 1384 (1998), 5-19. [43] D. Long, A. Browne, E. Clarke, S. Jha and W. Marrero, An improved algorithm for the evaluation of fixpoint expressions, Proc. CAV '94, Lecture Notes in Comput. Sci. 818 (1994), 338-350. [44] A. Mader, Verification of modal properties using Boolean equation systems, Ph.D. Thesis, Technical University of Munich (1997). [45] Z. Manna and A. Pnueh, Formalization of properties of recursively defined functions, Proc. ACM STOC (1969), 201-210. [46] Z. Manna and A. Pnueli, How to cook a temporal proof system for your pet language, Proc. 10th ACM POPL(1983), 141-154. [47] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92 (1980). [48] D. Muller and P. Schupp, The theory of ends, pushdown automata and second order logic, Theoret. Comput. Sci. 37 (1985), 51-75. [49] P. Niebert, A v-calculus with local views for systems of sequential agents, Proc. MFCS '95, Lecture Notes in Comput. Sci. 969 (1995), 563-573. [50] D. Niwiriski, On fixed point clones, Proc. ICALP '86, Lecture Notes in Comput. Sci. 226 (1986), 464-473. [51] D. Niwiriski, Fixed point characterization of infinite behavior offinitestate systems, Theoret. Comput. Sci. 189 (1997), 1-69.
Modal logics and mu-calculi: An introduction
329
[52] D. Park, Fixpoint induction and proofs of program properties. Machine Intelligence 5 (1969), 59-78. [53] D. Park, Concurrency and automata on infinite sequences. Lecture Notes in Comput. Sci. 104 (1981), 167183. [54] W. Penczek, Temporal logics for trace systems, Intemat. J. Found. Comput. Sci. 4 (1) (1993), 31-67. [55] A. Pnueli, Temporal semantics of concurrent programs, Theoret. Comput. Sci. 27 (1983), 333-354. [56] V. Pratt, Semantical considerations of Floyd-Hoare logic, Proc. 16th IEEE FOCS (1976), 109-121. [57] V. Pratt, A near-optimal method for reasoning about action, J. Comput. System Sci. 20 (1980), 231-254. [58] V. Pratt, A decidable mu-calculus, Proc. 22nd IEEE FOCS (1982), 421-427. [59] M.O. Rabin, Decidability of second-order theories and automata on infinite trees. Trans. Amer. Math. Soc. 141 (1969), 1-35. [60] M.O. Rabin, Weakly definable relations and special automata. Mathematical Logic and Foundations of Set Theory, Y. Bar-Hillel, ed., North-Holland, Amsterdam (1970), 1-23. [61] A.P Sistla and E.M. Clarke, Complexity of propositional temporal logics, J. ACM 32 (1986), 733-749. [62] C. Stirling, Modal and temporal logics. Handbook of Logic in Computer Science, Vol. 2, S. Abramsky, D. Gabbay and T. Maibaum, eds, Oxford University Press (1991), 477-563. [63] C. Stirling, Local model checking games, Proc. Concur '95, Lecture Notes in Comput. Sci. 962 (1995), 1-11. [64] C. Stirling, Modal and temporal logics for processes. Logics for Concurrency, Lecture Notes in Comput. Sci. 1043(1996), 149-237. [65] C. Stirling and D. Walker, Local model checking in the modal mu-calculus, Theor. Comput. Sci. 89 (1991), 161-177. [66] C. Stirling and D. Walker, CCS, liveness, and local model checking in the linear time mu-calculus, Proc. First International Workshop on Automatic Verification Methods for Finite State Systems, Lecture Notes in Comput. Sci. 407 (1990), 166-178. [67] R. Streett, Propositional dynamic logic of looping and converse, Proc. 13th ACM STCX^ (1981), 375-383. [68] R.S. Streett and E.A. Emerson, An automata theoretic decision procedure for the propositional mu-calculus. Inform, and Comput. 81 (1989), 249-264. [69] PS. Thiagarajan, A trace based extension of linear time temporal logic, Proc. 9th IEEE LICS (1994), 438447. [70] W. Thomas, Languages, automata, and logic. Handbook of Formal Language Theory, Vol. Ill, G. Rozenberg and A. Salomaa, eds. Springer-Verlag, New York (1998), 389-455. [71] M.Y. Vardi, A temporal fixpoint calculus, Proc. 15th POPL (1988), 250-259. [72] M.Y. Vardi and P. Wolper, Yet another process logic. Logics of Programs, Lecture Notes in Comput. Sci. 164 (1983), 501-512. [73] B. Vergauwen and J. Lewi, Efficient local correctness checking for single and alternating Boolean equation systems, Proc. ICALP '94, Lecture Notes in Comput. Sci. 820 (1994), 302-315. [74] I. Walukiewicz, Completeness ofKozen's axiomatisation of the propositional p.-calculus, Proc. 10th IEEE LICS (1995), 14-24. [75] I. Walukiewicz, Notes on the propositional p-calculus: Completeness and related results, BRICS Notes Series BRICS-NS-95-l,http://www.brics.dk/BRICS/NS/95/l/BRICS-NS-95-l/index.html.
Subject index alternation (in automata), 324 alternation depth, 318 alternation, fixpoint, 318 anf, 314 annotation, 311 ^^^ approximant, 303 automaton normal form, 314 choice function, 311
CTL, 298 disjunctive formula, 314 __^ equation system, 322
filtration,
fairness, 309 299
330 games, 320 Hennessy-Milner Logic, 298 HML,298 liveness, 306
J. Bradjield, C. Stirling pre-model, well-founded, 311 Propositional Dynamic Logic, 298 quasi-model, 311 safety, 306 signature, 312
model-checking, complexity of, 315 tableau, 319 PDL, 298 pre-model, 311
unfolding, 303
Part 2 Finite-State Processes
This Page Intentionally Left Blank
CHAPTER 5
Process Algebra with Recursive Operations Jan A. Bergstra^'^, Wan Fokkink^ Alban Ponse^'^ ' CWI, Kruislaan413, 1098 SJ Amsterdam, The Netherlands http://www. cwi. nl ^ Utrecht University, Department of Philosophy, Heidelberglaan 8, 3584 CS Utrecht, The Netherlands http./Avww.phil. uu. nl/eng/home. html ^ University of Amsterdam, Programming Research Group, Kruislaan 403, 1098 SJ Amsterdam, The Netherlands http://www. science, uva. nl/re search/prog E-mails: [email protected], [email protected], [email protected]
Contents 1. Introduction 2. Preliminaries: Axioms and operational semantics 2.1. ACP-based systems 2.2. Transition rules and operational semantics 2.3. Recursive specifications 3. Axiomatisation of the binary Kleene star 3.1. Preliminaries 3.2. Completeness 3.3. Irredundancy of the axioms 3.4. Negative results 3.5. Extensions of BPA*(A) 4. Axiomatisations of other iterative operations 4.1. Axiomatisation of no-exit iteration 4.2. Axiomatisation of multi-exit iteration 4.3. Axiomatisation of prefix iteration 4.4. Axiomatisation of string iteration 4.5. Axiomatisation of flat iteration 5. Expressivity results 5.1. Expressivity of the binary Kleene star 5.2. Expressivity of multi-exit iteration 5.3. Expressivity of string iteration 5.4. Expressivity of flat iteration 6. Non-regular recursive operations 6.1. Process algebra with a push-down operation
335 338 338 341 344 345 346 347 354 355 357 358 358 359 361 363 363 365 365 370 371 372 374 375
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
333
334 6.2. Expressing a stack 6.3. Undecidability results 7. Special constants 7.1. Silent step and fairness 7.2. Empty process Acknowledgements References Subject index
J A. Bergstra et aL 378 381 382 383 384 385 385 388
Abstract This chapter provides an overview of the addition of various forms of iteration, i.e., recursive operations, to process algebra. Of these operations, (the original, binary version oO the Kleene star is considered most basic, and an equational axiomatisation of its combination with basic process algebra is explained in detail. The focus on iteration in process algebra raised interest in a number of variations of the Kleene star operation, of which an overview, including various completeness and expressivity results, is presented. Though most of these variations concern regular (iterative) operations, also the combination of process algebra and some non-regular operations is discussed, leading to undecidability and stronger expressivity results. Finally, some attention is paid to the interplay between iteration and the special process algebra constants representing the silent step and the empty process.
Process algebra with recursive operations
335
1. Introduction In process algebra, a (potentially) infinite process is usually represented as the solution of a system of guarded recursive equations, and proof theory and verification tend to focus on reasoning about such recursive systems. Although specification and verification of concurrent processes defined in this way serve their purposes well, recursive operations give a more direct representation and are easier to comprehend. The Kleene star * can be considered as the most fundamental recursive operation. In process algebra, the defining equation for the binary Kleene star reads x*j = x-(x*y) + >; where • models sequential composition and -h models non-deterministic choice (• binds stronger than +). In terms of operational semantics, the process x^'y chooses between x and J, and upon termination of x has this choice again. For example, the expression a*b for atomic actions a and b can be depicted by
V
where yj expresses successful termination. This chapter discusses the Kleene star in the setting of process algebra, and considers some derived recursive operations, with a focus on axiomatisations and expressiveness hierarchies. In the summer of 1951, S.C. Kleene was supported by the RAND Corporation, leading to Research Memorandum "Representation of Events in Nerve Nets and Finite Automata" [52]. The material in that paper, based on the fundamental paper [59],* was republished under the same title five years later [53]. In this seminal work, Kleene introduced the binary operation * for describing 'regular events'. He defined regular expressions, which correspond to finite automata, and gave algebraic transformation rules for these, notably £'*F = £ ( £ * F ) v F (£'*F being the iterate of E on F). Kleene noted the correspondence with conventions of algebra, treating £ v F as the analogue of £ -h F, and F F as the product of E and F. In 1958, Copi, Elgot, and Wright [30] showed interest in the results from [53]. However, they judged Kleene's theorems on analysis^ and synthesis^ obscured both by the complexity of his basic concepts and by the nature of the elements used in his nets. They introduced ' Kleene judged the theory for nerve nets with circles in [59] (McCuUoch and Pitts, 1943) to be obscure, and proceeded independently. He came up with "regular events" and the major correspondence results in automata theory. Theorem 5, stating that finite automata model regular events. ^ Theorem 3, stating that each regular event can be described by a finite automaton ("nerve net").
336
JA. Bergstra et al
simpler and stronger nets (in a sense weakening Kleene's synthesis result, but stating that this "brings the essential nature of the result into sharper focus"), and simpler operations. In particular they introduced a unary * operation "[...] because the operation Kleene uses seems "essentially" singulary and because the singulary operation simplifies the algebra of regular events. It should be noted that the singulary and binary star operations are interdefinable." [30, p. 195] This contradicts Kleene's original argument in [52, p. 50] that the length of an event is at least one, and that for this reason he did not define £"* as a unary operation. Four years later, Redko [69] proved that there does not exist a sound and complete finite equational axiomatisation for regular expressions. (This proof was simplified and corrected by Pilling; see [31, Chapter 11].) In 1966, Salomaa [70] presented a sound and complete finite axiomatisation for regular expressions, with as basic ingredient an implicational axiom dating back to Arden [9], namely (in process algebra notation): x = {y'X) + z=^x = y''z if y does not have the so-called empty word property. According to Kozen [57], this last property is not algebraic, in the sense that it is not preserved under action refinement; he proposed two alternative implicational axioms that do not have this drawback. Krob [58] settled two conjectures by Conway [31], to obtain an infinite sound and complete equational axiomatisation for regular expressions. Bloom and Esik [25] developed an alternative infinite equational axiomatisation for regular expressions, within the framework of iteration theories. In 1984, Milner [62] was the first to consider the unary Kleene star in process algebra, modulo strong bisimulation equivalence [66]. In contrast with regular expressions, this setting is not sufficiently expressive to describe all regular (i.e., finite-state) processes. Moreover, the merge operator jc || y [60] that executes its two arguments in parallel, and which is fundamental to process algebra, cannot always be eliminated from process terms in the presence of the Kleene star. Milner presented an axiomatisation for the unary Kleene star in strong bisimulation semantics, being a subset of Salomaa's axiomatisation, and asked whether his axiomatisation is complete. Fokkink [39] solved this question for noexit iteration jc*(5, where the special constant 8, called deadlock, does not exhibit any behaviour; since 5 blocks the exit, jc*5 executes JC infinitely often. Bloom, Esik, and Taubner [26] presented a complete axiomatisation for regular synchronisation trees modulo strong bisimulation equivalence, within the framework of iteration theories. Milner also asked for a characterisation of those recursive specifications that can be described modulo strong bisimulation semantics in process algebra with the unary Kleene star. Bosscher [28] solved this question in the absence of the deadlock. The two questions by Milner in their full generality remain unsolved. The unary Kleene star naturally gives rise to the empty process [74], which does not combine well with the merge operator. Therefore, Bergstra, Bethke, and Ponse [16,17] returned in 1993 to the binary version x*y of the Kleene star in process algebra, naming the operator after its discoverer. Troeger [73] introduced a process specification language
Process algebra with recursive operations
337
with iteration, in which he introduced a striking axiom for the binary Kleene star, here presented in process algebra notation:
Fokkink and Zantema [38,44] gave an affirmative answer to an open question from [17], namely, that the defining axiom and Troeger's axiom for the binary Kleene star, together with x * ( y . z ) = (x*y)-z
and the five standard axioms on + and • for basic process algebra [19], provide an equational characterisation of strong bisimulation equivalence. Corradini, De Nicola, and Labella studied the unary Kleene star in the presence of deadlock modulo resource bisimulation equivalence. In [32,33] they presented a complete axiomatisation based on Kozen's conditional axioms. In [34] they came up with a complete equational axiomatisation including Troeger's axiom. Aceto, Fokkink, and Ingolfsdottir [4] proved that a whole range of process semantics coarser than strong bisimulation do not allow a finite equational characterisation of the binary Kleene star. Furthermore, Sewell [72] showed that there does not exist a finite equational characterisation of the binary Kleene star modulo strong bisimulation equivalence in the presence of the deadlock <5, due to the fact that {a^Y3 is strongly bisimilar to fl*5 for positive integers k. Several variations of the binary Kleene star were introduced, to obtain particular desirable properties. • In order to increase the expressive power of the binary Kleene star in strong bisimulation semantics, Bergstra, Bethke, and Ponse [16] proposed multi-exit iteration {x\, ...,XkT(y\, ...,yk)fov positive integers k, with as defining equation
(xi,...,xkTiyx,...,n) = -^1 • (U2,...,xk.x\T{y2. ..-.yk,y\)) + >'i. Aceto and Fokkink [1] presented an axiomatic characterisation of multi-exit iteration in basic process algebra, modulo strong bisimulation equivalence. • Prefix iteration (similar to the delay operation from Hennessy [51]) is obtained by restricting the left-hand side of the binary Kleene star to atomic actions. Aceto, Fokkink, and Ingolfsdottir [5,36] presented finite equational characterisations of prefix iteration in basic CCS [60], modulo a whole range of process semantics. • String iteration [7] is obtained by restricting the left-hand side of the binary Kleene star to non-empty finite strings of atomic actions. Aceto and Groote [7] presented an equational characterisation of string iteration in basic CCS, modulo strong bisimulation equivalence. • Bergstra, Bethke, and Ponse [16] introduced^^r iteration, which is obtained by restricting the left-hand side of the binary Kleene star to sums of atomic actions. Unlike the binary Kleene star, the merge operator can be eliminated from process terms in the presence of flat iteration. In [48], van Glabbeek presented a complete finite equational
338
J.A. Bergstra et al.
characterisation of flat iteration in basic CCS extended with the silent step r [60], modulo four rooted weak bisimulation semantics that take into account the silent nature of the special constant r (identifying xx and x). This chapter also concerns expressivity of (subsystems of) the algebra of communicating processes (ACP) [19] extended with the constant r and abstraction operators [20], and enriched with the binary Kleene star or variants thereof. The r, which represents a silent step, in combination with abstraction operators, which rename actions into r, enables one to abstract from internal behaviour. In weaker semantics that identify xx and x, each regular process can be specified in ACPr (i.e., ACP with abstraction) and the binary Kleene star, using only handshaking (i.e., two-party communication) [22] and some auxiliary actions. Furthermore, in such a semantics, each computable process can be specified in ACPr with abstraction and a single recursive, non-regular operation, using only handshaking and some auxiliary actions. This chapter is set up as follows. Section 2 introduces the preliminaries. Section 3 contains an exposition on axiomatisations for the binary Kleene star, while Section 4 discusses axiomatisations for related iterative operations. Section 5 compares the expressivity of these iterative operations, and Section 6 studies the expressivity of some non-regular recursive operations. Finally, Section 7 touches upon topics such as fairness and the empty process.
2. Preliminaries: Axioms and operational semantics In this section we recall various process algebra axiom systems, structural operational semantics, behavioural equivalences, and recursive specifications. For a detailed introduction to these matters see, e.g., Baeten and Weijland [15].
2.1. ACP-based systems Let A be a finite set of atomic actions a,b,c,..., and let 5 be a constant not in A. We write As for A U {5}. Let furthermore _ | _ : A^ x A<5 -> A<5 be a communication function that is commutative, a\b — b\a
for all «, Z? € A5,
associative, a\{b\c)
= {a\b)\c
for all a,b,ce
A^,
and that satisfies 8 \ a = 8 for all a e As. The communication function | will be used to define communication actions: in the case that a \b = c e A,the simultaneous execution of actions a and b results in communication action c. The actions in A and the communication function | can be regarded as parameters of the process algebra axiom systems that are presented below.
Process algebra with recursive operations
339
The process algebraic framework ACP(A, |, r) stands for a particular signature over fixed A and communication function |, and a set of axioms over this signature. Let V denote the set of process terms over this signature: sorts:
A
(the given, finite set of atomic actions), (the set of process terms; A c P),
V operations: -{-:V xV -^ V
(non-deterministic choice or sum).
'\VxV->V
(sequential composition).
\\:VxV->V
(merge, parallel composition).
IL
(left merge). (communication merge, extending the given communication function). (encapsulation, // c A),
:Vxr->V
\'.VxV-^V dH'-V^V Ti\V->V constants: 5 € P xeV
(abstraction, / c A), (deadlock), (silent step).
Intuitively, an action a represents indivisible behaviour, 8 represents inaction, and r represents invisible internal behaviour. Moreover, P -\- Q executes either P or Q, P - Q first executes P and at its successful termination proceeds to execute Q, and P \\ Q executes P and Q in parallel allowing communication of actions from P and Q. The operators P ^ Q and P I Q both capture part of the behaviour of P \\ Q: P |L Q takes its first transition from P, while the first transition of P | Q is a communication of actions from P and Q. Finally, in 9//(P) all actions from // in P are blocked, while in r/(P) all actions from / in P are renamed into r. We take • to be the operation that binds strongest, and -I- the one that binds weakest. As usual in algebra, we tend to write xy instead of x • y. For • e {+, •, ||, |} we will assume that expressions PQ D • • • D P/? associate to the right. Furthermore, for /: ^ I we define x^"^' as jc -x^, and jc^ as JC. In Table 1 the axioms of the system ACP(A, |, r) are collected. Note that + and • are associative, and that + is moreover commutative and idempotent. In the case that a\(b\c)
= 8 for all a, Z?, c G A,
while I itself defines a communication, we speak of handshaking. We will study the following subsystems of ACP(A, |, r): • BPA(A). The signature of BPA(A) contains the elements of A, non-deterministic choice, and sequential composition. The axioms of BPA(A) are (A1)-(A5). • BPA5(A). The signature of BPA5(A) is the signature of BPA(A) extended with the deadlock. The axioms of BPA5(A) are (A1)-(A7).
340
J.A. Bergstra et al Table 1 The axioms for ACP(A, |, r), where a,be A^^ and H,I C,A (Al) (A2) (A3) (A4) (A5) (A6) (A7) (CI) (C2) (C3) (CMl) (CM2) (CMS) (CM4) (CM5) (CM6) (CM7) (CMS) (CM9) (Dl) (D2) (D3) (D4) (Bl) (Til) (TI2) (TI3) (TI4)
x-\'y x + iy-^z)
:zz V+JC
= = {x + v)z = {xy)z = jc + 5 = 8x = a\b = {a\b)\c = 6\a = x\\y = at X = ax IL V = (^ + v) t z = ax 1 b = a 1 bx = ax 1 by = {X -\-y)\z = x\{y + z) = ^Hio) = a//(«) = a//(^ + v) = ^Hixy) = XX = Tiia) = riia) = T/ix + y) = T^lixy) = X -l-JC
(x + v) + z X
xz 4- yz x(yz) X
8 b\a a\ib\c) 8 {x I v + y IL x)-}-x\\y ax o(x II y ) AT IL z + V (L z
(a 1 b)x (a 1 b)x (a \ b){x II y) x\z-^y\z x\y + x\z a ifa^H 8 if aeH 9//(^) + 9//(v) dH(x)dH(y) X
a if a ^ I T ifael T/ix) + Tj(y) Tj{x)rj(y)
• PA(A). The signature of PA(A) is the signature of BPA(A) extended with the merge and left merge. The axioms of PA(A) are (A1)-(A5), (CM2)-(CM4) (with a ranging over A), and (Ml)
x\\y = x I y-^y
I
x.
• PA5(A). The signature of PA5(A) is the signature of PA(A) extended with the deadlock. The axioms of PA(A) are (A1)-(A7), (Ml), and (CM2)-(CM4) (with a ranging over A^). • ACP(A, I). The signature of ACP(A, |) is the signature of ACP(A, |, r) w/r/z6>Mr the silent step and abstraction operators. The axioms of ACP(A, |) are (A1)-(A7), (CF1)-(CF2), (CM1)-(CM9), and (D1)-(D4) (with a, h ranging over As)We note that in PA(A) and PA5(A), commutativity of the merge (x || y = y || x) can be derived from axioms (Al) and (Ml). The binary equality relation = on process terms induced by an axiom system is obtained by taking all closed instantiations of axioms, and closing it under equivalence (i.e., under reflexivity, symmetry, and transitivity) and under contexts.
Process algebra with recursive operations
341
2.2. Transition rules and operational semantics We define a structural operational semantics in the style of Plotkin [68], to relate each process term to a labelled transition system. Then we define strong bisimulation as an equivalence between labelled transition systems, which carries over to process terms. The operational semantics and strong bisimulation are used in the proofs on axiomatisations in Sections 3 and 4, and on classification results in Section 5. A labelled transition system (LTS) is a tuple (5, {-^, -A- y/\a e A),s), where 5* is a set of states, - ^ for a G A is a binary relation between states, —> y for a € A is a unary predicate on states, ^ G 5 is the initial state. Expressions s - ^ s' and s - ^ y are called transitions. Intuitively, s - ^ s' denotes that from state s one can evolve to state s' by the execution of action a, while s - ^ y/ denotes that from state s one can terminate successfully by the execution of action a {y/ is pronounced "tick"). Consider one of the process algebra axiom systems BPA(A) — ACP(A, |, r), and let V represent all process terms given by its signature. We want to relate each process term in 7^ to a labelled transition system. We take the process terms in V as the set of states, and the atomic actions in A as the set of labels. (Note that atomic actions can denote both states and labels.) Exploiting the syntactic structure of process terms, the transition relations - ^ and - ^ y/ for a e A 3xt defined by means of inductive proof rules called transition rules | . Validity of the premises in 5, under a certain substitution, implies validity of the conclusion c under the same substitution. The transition rules in Table 2 define the labelled transition system associated to a process term in ACP(A, |, r). The signature and parameters of V (possibly including a communication function |) determine which transition rules are appropriate. For example, the last two transition rules for || (i.e., with x || y in the left-hand sides of their conclusions) are not relevant for ^\s{A). Note that the deadlock 8 has no outgoing transitions. The labelled transition system related to process term P has P itself as initial state. Often we will write simply P for the labelled transition system related to P. Intuitively, strong bisimulation relates two states if the LTSs rooted at these states have the same branching structure. This semantics does not take into account the silent nature ofr. DEFINITION 2.2.1 {Strong bisimulation). A strong bisimulation is a binary, symmetric relation IZ over the set of states that satisfies
-^ P' ^ 3Q'{Q~^ Q' PUQAP-^y/ =^ G - ^ V.
PHQAP
AP'UQ'),
Two states P and Q are strongly bisimilar, notation P ±± Q, if there exists a strong bisimulation relation 7^ with PIZQ.
342
J A. Bergstra et ai
Table 2 Transition rules for ACP(A, |, T ) , where a,be a
a a
X 1 X -\-y
1 > X «
a
x-Vy
X
a
>X
b
y
II
^ 1 ^
a
1
>X y
a
xy
1
X
b
«i^
II
1
a
X
'\ia\b^A
/
II X IL y
X
> X
,
b
y
> y
,
X
X
a
> X
^'
^ V ,
X 11 >' « l ^ > /x'II II / y'
1 > X
> V
t > X
y
11
"l^^
b
X 1 _v
/ > yj
> X'
11 V b
>'-
v'
ii
II
JC [j_ y X
a
.
y
>
>y
t > X
X 1y
y
a\b
b
a
a
/ > yj
/
b
/
X—>
V y—^ V 1 "1^ / x\y—> V
,
>X
/
H
xiaiH
9//U)-^3//U0 X
ifa\b€A
/
-y—^ V
> x'/
a\b
ifalbeA
"I'' /
JC II V a
X
1
>yyl
II
y- II >' — ^ y
a
b
^ II V
Q
X II y — > X
/
>^
X II y — U x' II y'/
> ^
II
> V
a
\ia\h^A
V
> V
X II V
f
y—>y
>V
>y
X
/ II
X—^V
x-\-y
>V
^—^ V
y—^ V ;c II >^ - ^ X y' II
>y
y—^V
V
X+ V
t > X
a
> x' II >' 1
ae A-c X—^
1
> y
a
xy t > X
X
V^
/ it
X
X II y
H, I C,A
y —> y
> X/
a
Aj,
r > X
x,(x)-^x,(x') x-^x' r/(x)-^r/UO
jjlael
lail
X
> V
' - ^ ^
-r
I
Mai I
2.2.2. (1) (Equivalence) It is not hard to see that strong bisimulation is an equivalence relation over ACV{A,\). (2) (Congruence) Strong bisimulation equivalence is a congruence relation up to ACP(A, I), meaning that PQ ±> QQ and P\ ^ Q\ implies Po-\- P\ ^ Go + 2 b PoPi ^ QoQ\, Po II P\ t> Qo II Q\, Pol P\^Qol Qu Po\P\^Qo\ Qu and 3// (Po) "^ 9// (Go)- This follows from the fact that the transition rules in Table 2 are in path/ormar; see [14,43,50] or Chapter 3 [6] in this handbook, (3) (Soundness) Up to and including ACP(A, j), all axiom systems are sound with respect to strong bisimilation equivalence, meaning that P = Q implies P <±Q. Since strong bisimulation is a congruence, soundness follows from the fact that all closed instantiations of axioms in ACP(/4, j) are valid in strong bisimulation semantics. (4) (Completeness) Up to and including ACP( A, j), all axiom systems are complete with respect to strong bisimilation equivalence, meaning that P<±Q implies P = Q; see, e.g.. [15,42].
THEOREM
Process algebra with recursive operations
343
We proceed to define some more semantic equivalence relations on states in a labelled transition system that do not take into account the silent nature of r. These definitions use the following notions, assuming an underlying LTS. Let P - ^ 2 for a 6 A* denote that state P can evolve to state Q by the execution of the sequence of actions a. This binary relation on states is defined as follows (with e denoting the empty string): - P-^ P; p- ^ Q Q-^ R P^^R p-
•V
p-^^V A string a 6 A* is a trace of P if P-^
Q for some state Q or P-^
2.2.3 (Substate). Q is a substate of P if P-^ proper substate of P if P-^ Q for some a e A* \{£}. DEHNITION
^.
Q for some a € A*. Q is a
2.2.4 (Ready simulation). A simulation is a binary relation 71 over the set of states that satisfies:
DEFINITION
PUQAP-U
P' ^ 3Q\Q-^
P U Q A P ^ ^
^
Q ^
Q'
AP'UQ').
V.
A simulation 7^ is a ready simulation if whenever PIZQ and « is a trace of Q, then a is a trace of P. Two states P and Q are simulation equivalent, notation P 2:1:5 C if P T^i Q and QIZ2P for simulations IZx and 7^2Two states P and Q are ready simulation equivalent, notation P —RS Q,if P7Z\ Q and QIZ2P for ready simulations 1Z\ and 7^2DEFINITION 2.2.5 (Lxinguage equivalence). Two states P and Q are language equivalent, notation P 2^^. 2> if for each trace P-^ ^ there is a trace Q - ^ V, and vice versa. DERNITION 2.2.6 {Jrace equivalence). Two states P and Q are rrac^ equivalent, notation P 2^:7 Q, if they give rise to the same set of traces.
In [45], van Glabbeek gave a comparison of a wide range of behavioural equivalences and preorders (i.e., relations that are in general not symmetric) that do not take into account the silent nature of T . Apart from the equivalence relation discussed above, he studied completed trace preorder and a variety of decorated trace preorders, which are based on decorated versions of traces. These preorders are coarser than strong bisimulation and ready simulation, but more refined than language and trace equivalence. In Section 4.3, prefix iteration is axiomatized with respect to some of the decorated trace preorders. The reader is referred to [45] for the definitions of these preorders.
344
J.A. Bergstra et al
Four standard semantic equivalences that take into account the silent nature of r (and that constitute congruence relations over ACP(y4, | , T ) ) are rooted branching bisimulation [49], rooted delay bisimulation [61], rooted //-bisimulation [13], and rooted weak bisimulation [63]. Of these four semantics, rooted branching bisimulation constitutes the finest relation, while rooted weak bisimulation constitutes the coarsest relation. In all four semantics the axiom (Bl) (i.e., jcr = jc) is valid, and that is all that is needed for the expressivity results concerning ACP(/4, |, r) discussed in this chapter. In [47], van Glabbeek gave a comparison of a wide range of process semantics that take into account the silent nature of r.
2.3. Recursive specifications Although iterative operations are recursive by nature, we will use recursive specifications and associated notions to prove some of the results concerning these operations. DEFINITION 2.3.1 {Recursion). We assume a set of recursion variables {Xj \ j e J) for some index set 7. A recursive specification £" is a set of recursive equations Xj = Tj for j € 7, where Tj is an ACP(A, |, r)-term in which the recursion variables X, for / e J may occur. Given some process semantics, processes Pj (for j e J) form a solution of E if substitution of Pj for Xj in the recursive equations of E yields equations that hold in this semantics. If a recursive specification has solutions, then these solutions are often referred to by the names of the corresponding recursion variables in E. Table 3 presents the transition rules for recursive specifications. If for instance E = [X = aX-\-b], then X - ^ X by the first transition rule, and X —> ^ by the second transition rule. Recursive specifications need not have unique solutions in any reasonable process semantics, examples being {X = X} and {X = TX}. The following two definitions are sufficient to remedy this imperfection. DEHNITION 2.3.2 (r-Guardedness). Let P be an expression containing a recursion variable X. An occurrence of X in P is z-guarded if P has a subexpression a Q where a e Aj; and Q contains this occurrence of X.
Table 3 Transition rules for recursion
\fX = TeE
T-^
I — ifX =
TeE
Process algebra with recursive operations
345
A recursive specification E — [Xj = Tj \ j e J] h r-guarded if by repeatedly substituting Tj expressions for occurrences of Xj, and by applying axioms of ACP(i4, |, r), one can obtain the situation that all occurrences of recursion variables in right-hand sides of recursive equations are r-guarded. DEFINITION 2.3.3 {z-Convergence). A recursive specification E = [Xj = Tj \ j e J)is X-convergent if Xj - ^ P (for j e J) implies that there is no infinite r-trace P —^ P' - ^ p'' ^ ^
Recursive specifications that are r-guarded and r-convergent have a unique solution modulo any reasonable process semantics. The existence of a solution underlies the soundness of the recursive definition principle [11]. We proceed to introduce the recursive specification principle (RSP), discussed in for instance [21,11]. This principle states that the recursive specification E = {Xj = Tj \ j e J} has at most one solution per recursion variable, modulo the process semantics under consideration. (RSP)
yj = TAyi/X:\ieJ)forJeJ Xk = yk
^^^^^^^^
(RSP) is sound with respect to the process equivalences mentioned thus far, provided E is both r-convergent and r-guarded. Note that (RSP) is not sound with respect to the recursive specifications {X = X] and {X = TX}. DEFINITION 2.3 A (Regularprocess). A process P is regular if P is bisimilar to a process T^iiQ) where 2 is a solution for a recursion variable in a finite recursive specification
where aij and fij are finite sums of actions in A (the empty sum representing 8).
3. Axiomatisation of the binary Kleene star In Section 1 we introduced the binary^ Kleene star (BKS), notation *. This operation is defined by the equation x''y=zx(x*y)-\-y. This section considers its finite equational axiomatisation in strong bisimulation semantics, and presents a negative result on the finite equational axiomatisability of BKS in a variety of other process semantics.
346
JA. Bergstra et al
3.1. Preliminaries BPA*(A) is obtained by extending BPA(A) with BKS. Bergstra, Bethke, and Ponse [17] introduced an axiomatisation for BPA*(A) modulo strong bisimulation equivalence, which consists of axioms (A1)-(A5) for BPA(y4), extended with the axioms (BKSl)-(BKS) for BKS in Table 4. The axiom (BKS3) stems from Troeger [73]. In order to provide process terms over BPA*(y4) with an operational semantics, we introduce transition rules for BKS. The transition rules for BKS in Table 5 express that x* j repeatedly executes x until it executes y. Together with the transition rules for BPA(A) in Table 2 they provide labelled transition systems to process terms over BPA*(A). Note that by the first two transition rules in Table 5, a state P can have itself as a proper substate. For example, a*6 - ^ a^'b. The transition rules for BKS are in path format [14,50]. Hence, strong bisimulation equivalence is a congruence with respect to BPA*(A); see [43] or Chapter 3 [6] in this handbook. Furthermore, its axiomatisation is sound for BPA*(y4) modulo strong bisimulation equivalence. Since strong bisimulation equivalence is a congruence, this can be verified by checking soundness for each axiom separately. It can be easily shown that the BKS axioms are valid in strong bisimulation. Fokkink and Zantema [44] proved that the axiomatisation for BPA*(A) is complete modulo strong bisimulation equivalence. Their proof is based on a term rewriting analysis (see, e.g., [10]), in a quest to reduce bisimilar process terms to the same ground normal form, which does not reduce any further. Since this aim cannot be fulfilled for BKS, this operator is replaced by an operator representing x{x*y), and the BKS axioms are adopted to fit this new operator. Those axioms are turned into conditional rewrite rules, which are applied modulo associativity and commutativity of the -f (see, e.g., [67]). Knuth-Bendix completion [54] is applied to make the conditional rewrite system weakly confluent. Termination of the resulting conditional term rewriting system is obtained by means of the technique oi semantic labelling from Zantema [75]. Hence, each process term is provably equal to a normal form. Finally, a careful case analysis learns that if two normal forms are strongly bisimilar, then they are syntactically equal modulo associativity and commutativity of the -f. This observation yields the desired completeness result. Table 4 Axioms for BKS (BKSl) (BKS2) (BKS3)
;c(jc*y) + v = Jc*y x*{yz) = {x*y)z x*(y((jc + y)*z) + z) = {x + yTz
Table 5 Transition rules for BKS a t
X — > X x^y > x'(jc*y)
a
I
X— >V Jc*y — ^ -v*y
at
>' — ^ y Jc*y > y'
f^'
/
y —^ V JC*_V > J
Process algebra with recursive operations
347
An alternative completeness proof was proposed in [38], based on induction on the structure of process terms. That proof method is more general, and was later on applied to obtain completeness results for axiomatisations of iteration operations in [ 1,34,39]. In the light of the generic applicability of this proof method and the significance of the completeness result in the realm of this chapter, we present the proof from [38] in some detail. Following Milner [64] (see also [46]), the latter proof strategy can also be used to derive CD-completeness of the axiomatisation for BPA*(y4). That is, if P and Q are open terms over BPA*(A), which may contain variables, and if a ( P ) = a(|2) holds for all closed instantiations a, then P = Q can be derived from the axioms. Often, co-completeness can be proved by providing variables with an operational semantics, such that P <^ Q holds with respect to this new operational semantics if and only if <J(P) <±a(Q) holds for all closed instantiations a with respect to the original operational semantics. In [38], completeness of the axiomatisation for BPA*(A) modulo bisimulation equivalence is derived for open terms, which immediately implies a>-completeness of the axiomatisation. Here, we present the proof from [38] for closed (instead of open) terms. The reader is referred to [38] for a proof of CD-completeness. (The motivation to refrain from this generalisation here is clarity of presentation; we prefer to work in an unambiguous semantic framework throughout this chapter.)
3.2. Completeness We note that each process term over BPA*(y4) has only finitely many substates. In the sequel, process terms are considered modulo associativity and commutativity of the -h, and we write P =AC Q if P and Q can be equated by axioms (Al) and (A2). As usual, z2i=\ Pi represents P\-\ \- Pn- We take care to avoid empty sums (where ^ L i Pi + Q is not considered empty and equals Q). For each process term P, its collection of possible transitions is non-empty and finite, say {P - ^ P, IJ = 1 , . . . , m} U {P - X y I y = 1,...,«}. We call m
n
J2^iPi-^J2^j i=\
j=\
the HNF-expansion of P (Head Normal Form expansion, cf. [15]). The process terms a, Pi and bj are the summands of P. LEMMA
3.2.1. Each process term is provably equal to its HNF-expansion.
PROOF.
Straightforward, by structural induction, using (A4), (A5), and (BKS1).
D
Process terms in BPA*(A) are normed, which means that they are able to terminate in finitely many transitions. The norm [12] of a process yields the length of the shortest termination trace of this process. Norm can be defined inductively by \a\ = 1,
348
JA. Bergstra et al.
|P + ei \PQ\ =
=min[\Pl\Q\}^ \P\^\Ql
\P'Q\ = \Ql We note that strongly bisimilar processes have the same norm. The following lemma, due to Caucal [29], is typical for normed processes. LEMMA 3.2.2. Let PQ±>RS. By symmetry we may assume \Q\ ^ |.S|. We can distinguish two cases'. • either P ±> R and Q±> S\ • or there is a proper substate P' of P such that P ±> RP' and P'Q<± S. PROOF.
This lemma follows from the following Facts A and B.
FACT A. IfPQ^RS and\Q\ ^ |5|, then either Q±±S, or there is a proper substate P' of P such that P'Q^S. PROOF. We prove Fact A by induction on |P|. First, let | P | = 1. Then P -^ ^ fox some a, so PQ -U Q. Since PQ ^ RS, and \R'S\ > \S\ ^ \Q\ for all substates R' of /?, it follows that R - ^ y and Q 't± S. Then we are done. Next, suppose we have proved the case for | P | ^ n, and let | P | = n -f-1. Then there is a P' with | P ' | = « and P - ^ P\ which implies PQ - % P'Q. Since PQ ±^ RS, we have two options: (1) P - ^ V and P'Q±>S. Then we are done. (2) R-^ R' and P'Q<± R'S. Since \P'\=n, induction yields either Q±^S or P"Q±± S for a proper substate P'^ of P'. Again, we are done. This concludes the proof of Fact A. D FACTB.
IfPQ^RQ,thenP<±R.
PROOF. Define a binary relation B on process terms by TBU iff TQ^ UQ.V^t show that B constitutes a strong bisimulation relation between P and R. • Since 1> is symmetric, so is B. • PQ±^RQ, so PBR. • Suppose r e L ^ and T -U ^. Then TQ - ^ Q, Since TQ ±> UQ. and \U'Q\ > Q for all substates U' of U. it follows that UQ-^ Q. In other words, U -^ ^. • Suppose r S L ^ and T - % r . Then TQ - % T'Q. Since TQ±>UQ. and i e | < \rQl it follows that there is a transition U -^ V with T'Q^ U'Q. Hence, T' B U'. This concludes the proof of Fact B. D
Finally, we show that Facts A and B together prove the lemma. l.Qi PQ <± RS with I |2I < |5|. According to Fact A we can distinguish two cases. • Q±±S. Then PQ^RS±^ RQ, so Fact B yields P i± /?.
Process algebra with recursive operations
349
• P'Q<±S fox some proper substate P' of P. Then PQ±>RS<± RP'Q. so Fact B yields P<±RP\ D We construct a set B of basic terms, such that each process term is provably equal to a basic term. The completeness theorem is proved by showing that strongly bisimilar basic terms are provably equal. (x + y)z -^ xz-h yz, ixy)z -> x{yz), (x*y)z ^
x'iyz).
The term rewriting system above consists of directions of the axioms (A4), (A5), and (BKS2), pointing from left to right. Its rewrite rules are to be interpreted modulo associativity and commutativity of the +. The term rewriting system is terminating, meaning that there are no infinite reductions. This follows from the following weight function w in the natural numbers: wia) = 2, w(P-\-Q)
=
w(P)-hw(Q),
w(PQ) =
wiPfwiQ),
w(P*Q) =
w(P)-^w(Q).
It is not hard to see that if P reduces to Q in one or more rewrite steps, then w(P) > w(Q). Since the ordering on the natural numbers is well-founded, we conclude that the term rewriting system is terminating. Let G denote the collection of ground normal forms, i.e., the collection of process terms that cannot be reduced by any of the three rewrite rules. Since the term rewriting system is terminating, and since its rewrite rules are directions of axioms, it follows that each process term is provably equal to a process term in G. The elements in G are defined by: P::=a\P-\-P\aP\
P^'P.
G is not yet our desired set of basic terms, due to the fact that there exist process terms in G which have a substate outside G. We give an example. EXAMPLE 3.2.3. Let A = {a, b, c}. Clearly, (a*b)*c € G, and (a*byc-U(a*b){(a%rc). The substate (a*b)((a*b)*c) is not in G, because the third rewrite rule in 1Z reduces this process term to a*(b((a*b)'^c)).
350
J.A. Bergstra et ai
In order to overcome this complication, we introduce the following collection of process terms: H = { P * e , P'iP^'Q) I P * e € G and P' is a proper substate oiP]. We define an equivalence relation = on IHI by putting P'{P"" Q) = P* Q fov proper substates P ' of P, and taking the reflexive, symmetric, transitive closure of = . The set B of basic terms is the union of G and H. LEMMA
3.2.4. IfPeMandP-^
P\ then P' eB.
PROOF. By induction on the structure of P.
If P G H \ G, then it is of the form Q'{Q*R) for some 2*/? G G. So P' is of the form either g*/? or Q'^Q^'R) for some proper substate Q" of Q'. In both cases, P' G B . If P G G, then it is of the form Y.i ^i Qi + Hj ^*j^j + E)t ^^' ^^^^^ ^^^ 2 " ^y' ^^^ Sj are in G. So P' is of the form Qi, R*Sj, R'jiR*Sj), or 5^, which are all basic terms (in the last case, this follows by structural induction). D The L-value [44] of a process term is defined by L(F) =max{|P'| | P' proper substate of P } . L(P) < L(PQ) and L{P) < L(P* Q), because for each proper substate P' of P, P ' Q is a proper substate of P Q and P\P* Q) is a proper substate of P* Q. Since norm is preserved under strong bisimulation, it follows that the same holds for L-value; i.e., ii P ±> Q then L{P) = L{Q). We define an ordering -< on B as follows:
•
P
• P -< (3 if P is a substate of Q but Q is not a substate of P; • if P -< Q and (2 -( P, then P < R. Note that if P, 2 G HI with P = Q, then P and Q have the same proper substates, and so L(P) = L(Q). These observations imply that the ordering ^ on B respects the equivalence = on M, that is, if P = g ^ P = 5, then P <S. LEMMA 3.2.5. < is a well-founded ordering on B. If P is a substate of Q, then all proper substates of P are proper substates of g , so UP) ^ L(Q). Hence, if P ^ g then L(P) ^ L(Q). Assume, toward a contradiction, that there exists an infinite backward chain < Pi < P\ < PQ. Since L(P„+i) ^ L(Pn) for all n G N, there is an A^ such that L(Pn) = LiPis/) for all n > iV. Since Pn < PN for n > N, it follows that P„ is a substate of Pi^ for n > N. Each process term has only finitely many substates, so there are m, n > A^ with n > m and Pn =AC Pm- Then Pn i^ Pm. SO wc havc found a contradiction. Hence, -< is well-founded. D PROOF.
Process algebra with recursive operations
351
In the proofs of the next two lemmas, we need a weight function g in the natural numbers, which is defined inductively by g{a) = 0, g(P-hQ) g(PQ)
=meix{g(P)^g(Q)}, =m^x{g(P),g(Q)},
g{P^Q) = max{^(P),g(Q) + l}. It is not hard to see, by structural induction, that if P -^ LEMMA
P\ then g(P) ^ g(P')-
3.2.6. Let P*Q£ B. IfQ' is a proper substate of Q, then Q' < P^'Q.
is a substate of g , so g(Q') ^ g(Q) < g(P*Q). which implies that P*Q cannot be a substate of Q'. On the other hand, Q' is a substate of P* g , so Q' < P*Q. D PROOF. Q'
LEMMA
3.2.7. IfP eMandP-^
PROOF.
This lemma follows from the following Facts A and B.
FACT
A. IfPeM
PROOF.
P\ then either P' < P, or P,P' eU and P = P\
and P - ^ P\ then either P' eWor P' has smaller size than P.
We prove Fact A by induction on the structure of P. Let
Since P -^ P\ P' is of one of the following forms. • P^ =AC Qi for some /. Then P^ has smaller size than P. . P' =AC ^'ji^^jSj) or P' =AC R)Sj for some 7. Then P' e M. • Sj - A P' for some j . Then induction yields that either P' e H, or P' has smaller size than Sj, which in turn has smaller size than P. This concludes the proof of Fact A. D FACT B .
IfP eMandP-^
P\ then either g(P) > g(P'), or P' eU and P = P'.
Since P € H, either P =AC Q'iQ^'P) or P =AC C*/? for some Q and R. Hence, P' =AC Q'^Q^'R). P' =AC G * ^ . or P' =AC R' for a proper substate R' of R. In the first two cases P ' € H and P = P\ and in the last case g{P') = g{R') ^ g{R) < g(Q*R) = g(P). This concludes the proof of Fact B. D PROOF.
Finally, we show that Facts A and B together prove the lemma. Let P -^ P' ^ P\ we prove that P, P ' € H and P = P'.
P' with
352
J.A. Bergstra et al.
Since P' is a substate of P and P' -/: P, P isa substate of P\ So there exists a sequence of transitions P o - ^ P i ^ - ' - ^ P .
(Ol)
where PQ =AC /", P\ =AC Z'', and P„ =AC P^ Suppose Pk ^B. for all k. Then according to Fact A, Pk-^\ has smaller size than Pk for k = 0,.... n — I, so Pn has smaller size than PQ. This contradicts PQ =AC ^ ==AC PnHence, Pi eM for some /. Since each Pk is a substate of each Pk',g{Pk) must be the same for all k. Then it follows from Fact B, together with Pi e H, that Pk eU for all /: and PQ = ^i = • • • = ^n • D Now we are ready to prove the desired completeness result for BPA*(A). THEOREM 3.2.8. (A1)-(A5), (BKS1HBKS3) is complete for BPA*(A) modulo strong bisimulation equivalence.
Each process term is provably equal to a basic term, so it is sufficient to show that strongly bisimilar basic terms are provably equal. Assume P, 2 e B with P i± g ; we show that P = Q,hy induction on the ordering ^ . To be precise, we assume that we have akeady dealt with strongly bisimilar pairs P, 5" e B with P -( P and 5 ^ 2 , or P ^ P and 5 = e , o r P ^ P a n d 5 ^ 2. First, assume that P or Q is not in H, say P ^ H. By the induction hypothesis, together with Lemma 3.2.7, for all transitions P - A P' and G - ^ Q' with P' <± Q' we have P = Q. Since P ±^ Q, axiom (A3) can be used to adapt the HNF-expansions of P and Q to the form PROOF.
m
n
m
n
where P, = 2/ for / = 1 , . . . , m. Hence, P = Q. Next, assume P,
iel
jeJ
where the P/ and the Tj are of the form either aV or a. Since P*5 i> 7*(/, each P/(P*5) for / e / is strongly bisimilar either to Tj{T*U) for a 7 € y or to a sunmiand of (/. We distinguish these two cases. (a) P/(P*5)±>r,(r*L^)fora7 G7.ThenP/(P*5)t>7;(P*5),sobyLemma3.2.2 (b) P, (P*5) ±±aU' for a transition U - ^ W.
Process algebra with recursive operations
353
Thus, / can be divided into the following, not necessarily disjoint, subsets: /o =
[ieI\3jeJ{Ri^Tj)]^
h = [i e I \3U -^
U'
(Ri(R*S)±>aU')}.
Similarly, J can be divided: 70 = {jeJ\3ieI /i = [j e J \3S -^
(Tj^Ri)}, S\Tj(T''U) ±^ aS')}.
If both I\ and J\ are non-empty, then U" <± /?*5 for a proper substate U'' of U, and ^ff ^ j^U f^^ ^ pj.Qpgj. substate S" of 5, and so U" <± S". By Lemma 3.2.6, S" < R*S and U'' < T^'U, so induction yields R*S = U" = 5'' = T*^, and we are done. Hence, we may assume that either I\ or J\ is empty, say J\ = 0. We proceed to derive ^ / ? / ( / ? * 5 ) + 5 = i7.
(1)
ieh
We show that each summand at the left-hand side of the equality sign is provably equal to a summand of U, and vice versa. • By definition of / i , for each RiiR*S) with / e I\ there is a summand aU' of U such that Ri{R*S) <± aU\ By Lemma 3.2.6 U' < T*U, so induction yields Ri(R*S)=aU\ • Consider a summand aS' of 5. Since R*S±±T*U and J\ = 0, it follows that aS' is strongly bisimilar to a summand all' of U, so induction yields aS' — aU'. • Finally, summands a of 5 correspond with summands a of U. • By the converse arguments it follows that each summand of U is provably equal to a summand at the left-hand side of the equality sign. This concludes the derivation of (1). Since J\ = 0, it follows that Jo ^ 0, so /Q ^ 0. By the definitions of /Q and Jo = J, each Ri with / e /o is strongly bisimilar to a Tj with 7 € J, and vice versa. Since L(Ri) ^L(R) < L(/?*5), induction yields Ri = Tj. Hence, ^ / ? / = r.
(2)
ielo
Finally, we derive R*S
(A3)
(BKS3).(A3)
(iy2)
^*^
354
J A. Bergstra et al
(2) Let P =Ac R'{R*S) and Q =AC T'^U. We prove /?\/?*5) = T'^U. \U\ = \T*U\ = \R\R*S)\ ^ 2 implies that U does not have atomic summands, so its HNF-expansion is of the form Yli^i^i- Since R\R*S) ^ T*U, each Ui is strongly bisimilar to R*S or to R'\R*S) for a proper substate R" of /?^ According to Lemma 3.2.6 Uj < T*U, so induction yields Ut = R*S or Uj — /?''(/?*5). This holds for all /, so ^ = J^i^i^i = ViR^S) for some process term V. Then R\R*S) ±> T*U i> (r*V)(/?*5), so Lemma 3.2.2 implies R' ^ T*V. Since L(R') < L(R\R*S)), induction yields R' = T*V. Hence, R\R*S) = (7*V)(/?*5') ^^=^^ r*(V(/?*5)) = r*L^. (3) Let P =Ac /?'(/?*5) and Q =AC T'{T*U). We prove /?'(/?*5') = r(T*U). By symmetry we may assume |/?*5| ^ |r*/7|. Lemma 3.2.2 distinguishes two possible cases. • R'^T' and /?*5 ±> T*U. Since L(/?0 < L(R'(R*S)), induction yields R' = T\ and case (1) applied to R*S ±± T*U yields R*S = T*U. Hence, R\R*S) = • R' ±± T'R" and R^R^'S) ±> T*U for a proper substate R^' of /?'. Since L(R') < L(R\R*S)), induction yields R' = T'R". Furthermore, case (1) applied to R'\R*S) ±> T*U yields R'\R''S) = T*U. Hence, R\R*S) = (T'R'')(R*S) ^^= ^^ r(R'\R*S)) This finishes the derivation of P = Q.
=
r(T*U). D
3.3. Irredundancy of the axioms Fokkink [38] showed that each of the BKS axioms is essential for the obtained completeness result. 3.3.1. If one of the BKS axioms is skipped from (A1HA5), (BKS1)-(BKS3), then this axiomatisation is no longer complete for BPA*(A) modulo strong bisimulation equivalence. THEOREM
PROOF. We apply a standard technique for proving that an equation e cannot be derived from an equational theory £, which prescribes to define a model for £ in which e is not valid. In order to show that (BKSl) cannot be derived from (A1HA5), (BKS2), (BKS3), we define an interpretation function 0 of open terms in the natural numbers:
cl>(a) = 0, 0(x) = 0, HP-^Q) = max{>(P),0(e)}, (l>(PQ) = cP(P)^ (l>(P*Q) = max{0(P) + \,(t>(Q) + 1}.
Process algebra with recursive operations
355
It is easy to see that this interpretation is a model for (A1)-(A5), (BKS2), (BKS3). However, 0(«(«*fl) -i-fl) = 0, while (/)(«*^) = 1. Hence, a(a*a) -\-a —a*a cannot be derived from (A1HA5), (BKS2), (BKS3). In order to show that (BKS2) cannot be derived from (A1)-(A5), (BKSl), (BKS3) we define an interpretation function i/r of open terms in the natural numbers: f{a) = 0, f{x)
= 0,
HP + Q) =max{Vr(/^),iA(e)}, ^{PQ)
=
f{Q).
rlr(P*Q) = max{^(P) + 1, if(Q)}. It is easy to see that this interpretation is a model for (A1)-(A5), (BKSl), (BKS3). However, \lf((a*a)a) = \lr(a) = 0, while \l/(a*(aa)) = max{V^(«) -h 1, ir(aa)] = 1. Hence, (a*a)a = a*(aa) cannot be derived from (A1HA5), (BKSl), (BKS3). In order to show that (BKS3) cannot be derived from (A1)-(A5), (BKSl), (BKS2), we define an interpretation function r] of open terms in sets of natural numbers:
nia) = 0, riM = 0, V(P + Q) = riiPQ) = riiP^'Q) =
r](P)^n(Q). ri(P)Ur](Q), ri(P)Uri(Q)U{\P\}.
It is easy to see that this interpretation is a model for (A1)-(A5), (BKSl), (BKS2). However, rj((aa)*(a((aa -I- a)*a) -^ a)) = {\aa\, \aa -\- a\} = {1,2} while r]{{aa -f aTa) = {|aa + a|} = {1}. Hence, {aaT{a{{aa + aTa) -h a) = {aa -h aYa cannot be derived from (A1)-(A5), (BKSl), (BKS2). D
3.4. Negative results In contrast with the positive result on the finite equational axiomatisability of BPA*(A) modulo strong bisimulation equivalence, Aceto, Fokkink, and Ingolfsdottir [4] showed that BPA*(A) is not finitely based modulo any process semantics in between ready simulation (see Definition 2.2.4) and language equivalence (see Definition 2.2.5). In the case of a singleton alphabet, this answered a problem in regular languages raised by Salomaa in [71 ]; see [3]. Crvenkovic, Dolinka, and Esik [35] provided a more elegant answer to the latter question. Ready simulation and language equivalence constitute congruence relations over BPA*(A) (in the case of language equivalence this follows from the fact that the transition rules for BPA*(A) are in L cool format [40]). Process semantics in the linear/branching
356
J.A. Bergstra et al
time spectrum [45] that are finer than language equivalence and coarser than ready simulation, and which constitute congruence relations over BPA*(y4), are failure semantics, ready semantics, failure trace semantics, and ready trace semantics. The result above follows from the existence of an infinite set of equations that cannot all be proved by means of any finite set of equations that is sound modulo language equivalence. This family of equations consists of E.n
a*{a") + {a")*{a + ... + a") = {a"y{a +
.--+a")
for n ^ 1, where a is some action. Ready simulation is the finest semantics in the linear/branching time spectrum in which the E.n are sound. Note that for n > 1, none of the equations E.n is sound in strong bisimulation equivalence. Given a finite set of equations that is sound with respect to language equivalence, Aceto, Fokkink, and Ingolfsdottir construct a model Ap for these equations in which equation E./7 fails, for some prime number p. The model that is used for this purpose is based on an adaptation of a construction due to Conway [31], who used it to obtain a new proof of a theorem, originally due to Redko [69], saying that BPA*(y4) is not finitely based modulo language equivalence. Let a be an action. For p a. prime number, the carrier Ap of the algebra Ap consists of non-empty formal sums of a^,a\ ..., «^~^ together with the formal symbol a*, that is. ^ a '
|0C/c{O,...,/7-l}
U{a*}.
iel
The syntax of Ap contains three more operators, which are semantic counterparts of the binary function symbols in BPA*(A). In order to avoid confusion, circled symbols denote the operators in the algebra Ap: 0 , O, and (g) represent the semantic counterparts of -h, •, and *, respectively. Table 6 presents an axiomatisation for Ap. Process terms over BPA*(A) are mapped to Ap as expected: every action in A is mapped to the symbol a ^, while -h, •, and * are mapped to 0 , O, and ®, respectively. For a process Table 6 Axiomatisation for the algebra Ap a ©X = a X ©a* = a* iel
jeJ
helUJ
a* Ox = a* xQa* = a*
^a'0E«^= iel
jeJ
E he[(i+j) mod p\{ij)elxJ]
a*
otherwise
Process algebra with recursive operations
357
term P, the denotation of P in the algebra Ap is represented by ^/?|[Pl. We note that equation E.p fails in Ap. Namely,
The following theorem is the key to the nonaxiomatisability result from [4]. 3.4.1. For every finite set £ of equations that are sound with respect to there exists a prime number p such that all equations in S are valid in Ap. THEOREM
COROLLARY 3.4.2. No congruence relation over BPA*(A) that is included in satisfies E.nfor alln^l has a complete finite equational axiomatisation.
^L
'^L.
and
A process semantics that is coarser than language equivalence is trace equivalence 2:IT. where two process terms are considered equivalent if they give rise to the same (not necessarily terminating) traces (see Definition 2.2.6). If |A| > 1, then trace equivalence is not a congruence relation over BPA(i4); e.g., a-{-aa C:^T aa, but (a -f aa)b 9^7 aab. However, if the set A of actions is a singleton [a], then trace equivalence constitutes a congruence relation over BPA*(A). In contrast with their negative results on the finite axiomatisability of BPA*(A) modulo process semantics between ready simulation and language equivalence, Aceto, Fokkink, and Ingolfsdottir showed that BPA*({a}) modulo trace equivalence is axiomatized completely by the five axioms for B?A({a]) together with the three axioms in Table 7. THEOREM
3.4.3. (A1)-(A5), (T1)-(T3) is complete for BPA*({^}) modulo trace equiva-
lence.
3.5. Extensions of BFA*{A) The signature of BPA^(A) is obtained by extending BPAsiA) with BKS. Its axioms are those of BPA*(A) and of BPA5(A), i.e., (A1)-(A7) in Table 1 for BPA^(A), and (BKSl)(BKS3) for BKS. Sewell [72] showed that there does not exist a complete equational ax-
Table 7 Axioms for trace equivalence {A = {a}) (Tl) X + iy*z) (T2) X -\-xy xy (T3)
= = =
a*a xy yx
358
JA. Bergstra et al. Table 8 Axioms for BKS with encapsulation and abstraction (BKS4) (BKS5)
a//(;c*v) = a//U)*a//(v) Tj(x*y) = r/(;c)*r/(y)
iomatisation for BPA^(A) modulo strong bisimulation equivalence. This motivates the introduction of the implicational axiom (Rsp*)
'=y'+\ X = y*z
It remains an open question, dating back to Milner [62], whether (A1)-(A7), (BKSl), (RSP*) is complete modulo strong bisimulation equivalence. We note that (BKS2) and (BKS3) can be derived from this axiomatisation. The signature of PA*(A) is obtained by extending PA(A) with BKS. The axioms of PA*(A) are those of PA(A) and (BKS1)-(BKS3). The system PAsiA) can be extended in a similar way to PA^(A). The system ACP* (A, |) is defined by inclusion of (BKS 1HBKS4); see Table 8. Note that (BKS4) can be derived using (RSP*). Finally, ACP*(A, |, r) is obtained by inclusion into ACP(A, |, r) of (BKS1HBKS5); see Table 8. Note that (RSP*) is not sound for ACP*(A, |, T); e.g., r = r r - f 5, but r = T*8 is not a desirable identity in any process semantics.
4. Axiomatisations of other iterative operations This section considers four restricted versions and one generalised version of BKS. We discuss the different advantages of each of these operators, and formulate various axiomatisations and completeness results.
4.1. Axiomatisation of no-exit iteration No-exit iteration (NEI) x"^ is bisimilar to x*8. No-exit iteration can be used to formally describe programs that repeat a certain procedure without end. Many communication protocols can be expressed, and shown correct, using no-exit iteration. An explanation is that (concurrent) components of such protocols often perform repetitive behaviour in the following style (receive/process/send-repetition): (j^n{d)Psj{d)\ ^ deD
or ^
('^r/(J)P5,(^) + e j , ^ deD
'
Process algebra with recursive operations Table 9 Axioms for NEI (NEIl)
x^=x{x^)
359
Table 10 Transition rules for NEI x-^x'
x-^y/
where Q handles an exceptional situation. A standard example in process algebra is the alternating bit protocol (see, e.g., [21]), specified as the concurrent execution of four components, each of which can be specified in the style above. Further examples of this specification and verification style can be found in [18,76]. Table 9 presents two axioms for NEI. (NEIl) is its defining axiom, while (RSP^) is an adaptation of (RSP*). The axiomatisations for BPA'^(A) and BPA^(A) are obtained by extending BPA(A) and BPA5(A) with (NEIl) and (RSP^). In order to provide process terms over BPA^(y4) with an operational semantics, we introduce transition rules for NEI. Together with the transition rules for BPA(i4) in Table 2 they provide labelled transition systems to process terms over BPA^(A). The transition rules for NEI are in path format. Hence, strong bisimulation equivalence is a congruence with respect to BPA^(A). Furthermore, its axiomatisation is sound for BPA^(A) modulo strong bisimulation equivalence. Since strong bisimulation equivalence is a congruence, this can be verified by checking soundness for each axiom separately. It is easily verified that (NEIl) and (RSP^) are indeed sound modulo strong bisimulation equivalence. The following two completeness results for no-exit iteration originate from [39]. Their proofs, which are omitted here, are based on the proof strategy from [38]. THEOREM 4.1.1. (A1)-(A5), (NEIl), (RSP^) is complete for BPA^(A) modulo strong bisimulation equivalence. THEOREM 4.1.2. (A1)-(A7), (NEIl), (RSP^) is complete for BPA^(A) modulo strong bisimulation equivalence.
The observation by Sewell [72] that there does not exist a complete finite equational axiomatisation for BPA|(A) modulo strong bisimulation equivalence, is based on the fact that a^ is strongly bisimilar to {a^)^ fork^ 1. This argument can be copied to conclude that there do not exist complete finite equational axiomatisations for BPA^(A) and BPA^(A). Hence, the implicational axiom (RSP^) is irredundant. It is not difficult to see that axiom (NEIl) is irredundant as well.
4.2. Axiomatisation of multi-exit iteration Milner [62] noted that not every regular process can be described in BRA*(A), up to strong bisimulation equivalence. The limited expressive power of BKS was highlighted in [16],
360
JA. Bergstra et al Table 11 Axioms for MEI
(MEIl)
xx{{x2,...,xk,xxr{y2,...,yk.y\)) +
(MEI2)
{{xx,...,xkr{yx....,yk))z
(MEI3)
(zo'-^2----^^)*(>'i +z\{{x2 =
=
y\--{x\,...,xkr{y\,...,yk) {xx....,xi,r{yM,...,ykz)
xk,zo + z\T{y2^-...yk^y\))^y2^--'^yk)
{zQ-\-z\,x2,..-,xf,)*{y\,-..,yk)
(MEI4)
{ZQ.Z\,X2,...,XkT{y\,Z2{{X2^---,Xk,ZQ{Z\
(MEI5)
((xu...,xk)^r{{y\,...,yk)')
= (zoC^i + Z2),X2,...,
xkTiyx,..., =
+Z2))*(V2---n-'Vl))'>'2---yA:)
yk) {xi,...,xkr{yi,...,yk)
where it was shown that the process described by the recursive specification X\ = aX2 H-fl, X2 = aXi-\-b, cannot be expressed in BPA*(A) modulo strong bisimulation equivalence. See Section 5 for more information on the expressive power of iterative operators. Bergstra, Bethke, and Ponse [16] introduced multi-exit iteration (MEI) as a more expressive variant of iteration. For every A: ^ 1, and process terms Pi and Q, (1 ^ / ^ /:), the process term (P\,..., Pk)*(Q\, - •., Qk) denotes a solution to the recursion variable X\ in the recursive specification Xi = P1X2 + G1,
Xk-\ = Pk-\Xk H- Qk-\. Xk =
PkXi-\-Qk.
Aceto and Fokkink [1] introduced the axiom system BPA'"^*(A), which is obtained by adding the MEI axioms (MEI1)-(MEI5) in Table 11 to BPA(A). The first three MEI axioms are adaptations of the three BKS axioms. The last two MEI axioms relate process terms of distinct exit degrees. (MEM) is the multiplicative counterpart of (MEI3), while (MEI5) enables to reduce repetitive patterns at the left- and right-hand side of MEI. In order to provide process terms over BPA'"^*(A) with an operational semantics, we introduce transition rules for MEI. Together with the transition rules for BPA( A) in Table 2 they provide labelled transition systems to process terms over BPA'"^*(A). The transition rules for MEI are in path format. Hence, strong bisimulation equivalence is a congruence with respect to BPA'"^*(A). Furthermore, its axiomatisation is sound for BPA^^*(A) modulo strong bisimulation equivalence. Since strong bisimulation equivalence is a congruence, this can be verified by checking soundness for each axiom separately. It is easily verified that (MEIl), (MEI2), and (MEI5) are sound modulo strong
Process algebra with recursive operations
361
Table 12 Transition rules for MEI a
I
-yj — ^ - ^ 1
Ui,...,x^)*(>'I,...,>'^)-%jt',(U2,...,^;,A:i)*(y2 x\ Ui,...,xi,Y{y\.•••,yk) a
> ^
- ^ (-^2
t
^k^x\)*(y2
y;,y\) a
y\ — ^ >'i (xi,...,XA:)*(3^i - • . . >'^) - ^ yi
VA, Vl))
I
V, - ^ V Ui
xk)*{y\,...,
vjt) - ^
y
bisimulation equivalence. See [1] for a detailed proof that (MEI3) and (MEM) are sound modulo strong bisimulation equivalence. In [1] it is proved that the axiomatisationBPA'"''*(y4) is complete for BPA'^''*(A) modulo strong bisimulation equivalence. The completeness proof, which is omitted here, is based on the proof strategy from [38]. THEOREM 4.2.1. (A1HA5), (MEI1)-(MEI5) is complete for BPA'"^*(A) modulo strong bisimulation equivalence.
4.3. Axiomatisation ofprefix iteration Prefix iteration (PI) [36] is a variation of BKS, obtained by restricting its first argument to single atomic actions. The advantage of PI over BKS is twofold: (1) PI can be axiomatized in a setting with prefix multiplication of CCS [63], which is obtained from sequential composition by restricting its first argument to single atomic actions; (2) PI allows a complete equational axiomatisation modulo strong bisimulation equivalence in the presence of the deadlock 5. We note that, in general, sequential composition can be restricted to prefix multiplication without loss of expressivity. BPA^*(A) consists of BPA(A), with sequential composition xy restricted to prefix multiplication ax from CCS, extended with PI. Table 13 presents a collection of axioms for PI. First of all, (PI1)-(PI2) from [36] axiomatize PI with respect to strong bisimulation. THEOREM 4.3.1. (A1)-(A3), (A6), {V\\)-{V\1) is complete for'BVkl''{A) bisimulation equivalence.
modulo strong
The remaining equations and inequalities in Table 13 originate from Aceto, Fokkink, and Ingolfsdottir [5], who proved completeness results for PI in a variety of behavioural equivalences and preorders in the linear/branching time spectrum [45]. These axiomatisations for BPA^*(A) all incorporate axioms (A1)-(A3), (A6) for BPA<5(A) with prefix
362
J A. Bergstra et al Table 13 Axioms for PI (PIl) (PI2)
\{a*x)^x a^ia^'x)
— a*x = a*x
(CTl) (PCTl) (PCT2)
a(x + v) a*ix-\-y) a* (ax)
= = =
ax + ay a*x -\-a*y aia*x)
aS a*8
8 8
X
= = ^
ax a*x
^ ^
ax -\-ay a*(x-^ay)
(LI) (PLl) (SI) (RSI) (PRSl) (Rl) (PRl) (PR2) (Fl) (PFl) (PF2) (PF3)
X+ V
a{bx-\-by + v) ^ a{bx-\-v)-i-a{by + w) a(a*ibx-^by-^v)) ^ aia*{bx-]-v))-{-a(a*(by+ w)) a*ibx-\-by-\-v-^a(by-\-w)) ^ a*(bx-i-v-\-aiby-\-w))-\-by a{x-\-y) a(a*(x + y)) aia*x) a*{x-\-y+a{y + z))
^ ^ ^ ^
ax-\-a(y-{-z) a{a*x)-\-a{a*{y-i-z)) a*ia(x-\-y)) a*{x+a{y-\-z))-\-y
multiplication, standard axioms from the literature for BPA^CA) modulo the behavioural equivalence in question, and (PI1)-(PI2) for PI. (PCT1)-(PCT2) axiomatize PI with respect to completed trace equivalence. THEOREM 4.3.2. (A1HA3), (A6), (PI1)-(PI2), (CTl), (PCT1)-(PCT2) is complete for BPA^*(A) modulo completed trace equivalence.
(PLl), in cooperation with (PCT1)-(PCT2), axiomatize PI with respect to language equivalence. THEOREM 4.3.3. (A1)-(A3), (A6), (PI1)-(PI2), (CTl), (PCT1)-(PCT2), (LI), (PLl), is complete for BPA^*(A) modulo language equivalence.
No extra axioms are needed for PI modulo simulation preorder. THEOREM 4.3.4. ( A 1 ) - ( A 3 ) , simulation preorder.
(A6), ( P I 1 ) - ( P I 2 ) ,
(SI) is complete for BPA^*(A) modulo
(PRSl) axiomatizes PI with respect to ready simulation preorder. THEOREM 4.3.5. (A1)-(A3), (A6), (PI1)-(PI2), (RSI). {VRS\) is complete for BVKl''{A) modulo ready simulation preorder
Process algebra with recursive operations
363
Table 14 Axioms for SI (SA5) (SIl) (SI2) (SB) (SI4)
w\{w2x) = {w\W2)x w{w*x) -\-x w*(w*x) (w")*8 a{(wa)*8)
= = = =
w*x w*x w*8 iaw)*8
(PR1)-(PR2), in cooperation with (PRSl), axiomatize PI with respect to readies preorder. THEOREM 4.3.6. (A1)-(A3),(A6), (PIl)-(PI2),(RSl),(Rl),(RSl),(PRl)-(PR2)/5cowplete for BPA^*(A) modulo readies preorder.
It is still an open question whether there exists a complete axiomatisation for BPA^*(A) modulo failures preorder. Aceto, Fokkink, and Ingolfsdottir conjectured that (PF1)-(PF3), in cooperation with (PRSl), are sufficient to axiomatize PI with respect to failures preorder. CONJECTURE 4.3.7. (A1)-(A3), (A6), (PI1)-(PI2), (Fl), (PRSl), (PF1)-(PF3) is complete for BPA^*(A) modulo failures preorder.
To the best of our knowledge, axioms for PI with respect to ready trace preorder and failure trace preorder have not yet been formulated.
4.4. Axiomatisation of string iteration String iteration (SI) [7] is a variation of PI, in which the first argument of iteration is allowed to contain non-empty finite strings of atomic actions. Aceto and Groote [7] extended the axiomatisation for PI in strong bisimulation to SI. Like PI, and unlike BKS, SI allows an equational axiomatisation modulo strong bisimulation equivalence in the presence of the deadlock^. BPA^*(A) consists of BPA(A), with sequential composition xy restricted to string multiplication wy, extended with SI. Table 13 presents two axioms for SI in strong bisimulation. In Table 13, u; ranges over the collection A^ of non-empty strings of atomic actions. THEOREM 4.4.1. (A1)-(A3), (SA5), (A6), (SI1)-(SI4) is complete for BPAf (A) modulo strong bisimulation equivalence.
4.5. Axiomatisation of flat iteration In general, the merge operator cannot be eliminated from process terms with BKS. Therefore Bergstra, Bethke, and Ponse [16] introduced ^«r iteration (FI), which is obtained by
364
J.A. Bergstra et al. Table 15 Axioms for FI (FA4) (FBI) (FB2) (FIl)
(n2)
{a + /3)JC =
ax^^x
ar = a a{x -\- rv) = a(x -\- zy) + ay a*()8((a + /3)*jc)+jc) = (a-\-fi)*x 8*x = x
restricting the left-hand side of BKS to sums of atomic actions. Similarly, flat multiplication is obtained by restricting the left-hand side of sequential composition to sums of atomic actions. The transition rules for these operators are simply the transition rules for BKS and sequential composition with the left-hand sides restricted to sums of atomic actions. BPA^ {A) is obtained by adding FI to BPA5 (A) and restricting sequential composition to flat multipUcation. The merge can be eliminated from process terms that contain FI. For example, typically, (a*^?) || (c* J) is strongly bisimilar to (a + c-h« I cT{{d-\-a\
d)(a*b) -^(b-hb\
c)(c*d)+b\
d).
For a detailed discussion on this expressivity claim the reader is referred to Section 5.2. In [48], van Glabbeek presented complete axiomatisations for BPA^ {A) extended with the silent step r, modulo four rooted bisimulation semantics that take into account the silent nature of r: rooted branching bisimulation, rooted delay bisimulation, rooted r)bisimulation and rooted weak bisimulation. Of these four equivalences, rooted branching bisimulation constitutes the finest relation, while rooted weak bisimulation constitutes the coarsest relation; rooted delay bisimulation and rooted r;-bisimulation are incomparable. All four equivalences constitute congruence relations over BPA^^ (A) (in the case of rooted branching bisimulation equivalence this follows from the fact that the transition rules for BPA{^*(A) are in RBB safe format [41]). The axiomatisations for FI are adaptations of axiomatisations introduced by Aceto, Fokkink, van Glabbeek, and Ingolfsdottir [8,37,2] for PI. Table 15 presents adaptations to prefix multiplication of axiom (A4) and of two standard axioms (B1HB2) for r. Furthermore, (HI) is an adaptation of (BKS3) to FI, while (n2) expresses the interplay of FI with the deadlock S. In the axioms, a and ^ range over sums of atomic actions (the empty sum representing 8). Note that the defining equation of FI, ^*x = ^(y^*x)-fx
can be derived from (FIl) by taking a to be 5. Table 16 presents axioms for the interplay of FI with the silent step r, modulo the four aforementioned equivalence relations. (FTl) is an instantiation of Koomen'sfair abstraction rule (KFAR) [55,11] for rooted branching and r;-bisimulation, while (FT4) serves this same purpose for rooted delay and weak bisimulation. In [48], van Glabbeek proved completeness for BPA^^*(A) with respect to rooted branching bisimulation; see Theorem 4.5.1.
Process algebra with recursive operations
365
Table 16 Axioms for FI with the silent step (FTl) (a + r)*A: (FT2) a(fi*iT(^*{x-{-y))-\-x)) (FT3) a*U + rv) (FT4) (a-\-T)*x
= a*x + r(a*jc) = a(p*(x-\-y)) = a*{x-h zy+ ay) = T(a*x)
The complete axiomatisations for BPA/^*(A) modulo rooted delay, rj-, and weak bisimulation equivalence can then be obtained from the complete axiomatisation modulo rooted branching bisimulation equivalence, using a reduction technique from van Glabbeek and Weijland [49]; see Theorems 4.5.2,4.5.3, and 4.5.4. THEOREM 4.5.1. (A1)-(A3), (FA4), (A6HA7), (FBI), ( n i H n 2 ) , ( F n H F T 2 ) is complete for BPA^^^ (A) modulo rooted branching bisimulation equivalence.
THEOREM 4.5.2. (A1)-(A3), (FA4), (A6)-(A7), (FBI), ( n i ) - ( n 2 ) , (FT4) is complete for BPA^^ (A) modulo rooted delay bisimulation equivalence. 4.5.3. (A1)-(A3), (FA4), (A6)-(A7), (FB1)-(FB2), ( n i ) - ( n 2 ) , (FT1)-(FT3) is complete for BPA^^*(A) modulo rooted r]-bisimulation equivalence.
THEOREM
4.5.4. (A1)-(A3), (FA4), (A6)-(A7), (FB1)-(FB2), (ni)-(FI2), (FT3)-(FT4) is complete for BPA^^*(A) modulo rooted weak bisimulation equivalence.
THEOREM
5. Expressivity results This section concerns expressivity of process algebra with recursive operations, to categorize what can be specified with the various recursive operations. Of course, answers to these questions depend on the particular process semantics one adopts.
5.1. Expressivity of the binary Kleene star In [17], Bergstra, Bethke, and Ponse showed that the expressivity of systems with BKS can be analyzed by establishing properties of cycles in labelled transition systems. These results were strengthened by Boselie [27]. We recall these results, and first introduce some further terminology. A state 2 is a successor of state P if P - ^ 0 . A cycle is a sequence of distinct states (PQ. • • •. Pn) such that P/+i is a successor of P/ for / = 0 , . . . , n - 1 and Po is a successor of P„. An action a is an exit action of state P if P —> V. We use = to denote that two terms are syntactically the same. LEMMA 5.1.1. Let C be a cycle in a labelled transition system associated to a process term ov^r ACP*(v4, |, r). Then C has one of the following forms, for n G N:
366
JA. Bergstra et al
(i) C = ( P o G , / ' i e , - . . , ^ . G ) ; (ii) C = (P*Q, P\(P*Q),..., Pn{P*Q)), or any cyclic permutation thereof; (iii) C = ( P o l l G o , / ' i l l G i , . . . , P . l i e . ) ; (iv) C = (a//(Po), dH(P\), . . ., dH(Pn)l PROOF. Let C = (Co,..., C„). We apply case distinction on Co- Clearly Co is not a single atomic action, and as +, [L, I do not occur as the first operation in right-hand sides of conclusions of transition rules, it follows that Co # P o 2 for o G {+, [L , |}. Suppose Co = RS. If S is not a state in C, then C = (RS, R\S,..., RnS), which corresponds to case (i). If 5 is a state in C, then S-^ RS for some a € A*. It is not hard to see that only the first transition rule for BKS can give rise to a transition T - ^ T' where r is a proper subterm of T'. Hence, S is of the form P*Q, and the first transition in the sequence S-^ RS is invoked by the first transition rule for BKS. This yields form (ii). Suppose Co = R^S. Analogous to the case Co = RS, we see that C is of form (ii). Suppose Co = R\\ S. As R \\ S is not a substate of R or S, it follows from the transition rules of the merge that C must be of form (iii). Suppose Co = dniR). Since only the first transition rule for dn can have been used, it follows that C is of form (iv). D
Lemma 5. L1 can be used to derive further properties of cycles. LEMMA 5.L2. Let C be a cycle in a labelled transition system associated to a process term over BPA^(A). Then there is at most one state P in C that has a successor Q such that P is not a proper substate of Q. PROOF. AS C belongs to a process term over BPA|(y4), it must be of the form (i) or (ii) in Lemma 5.LL We apply induction with respect to the size of C. Suppose C = (PoQ,..., Pn Q). By induction, the cycle (Po, • • •, Pn) contains at most one state P/ that has a successor R such that Pj is not a proper substate of R. This implies that Pi Q is the only state in C that may have a successor S such that P, Q is not a proper substate of S. Suppose C = (P* Q, Pi ( P * Q ) , . . . , Pn(P* 2))» or any cyclic permutation thereof. Then P*Q is the only state in C that may have a successor R such that P*Q is not a proper substate of P. D
LEMMA 5.1.3. Let C be a cycle in a labelled transition system associated to a process term over PA^(A). If there is a state in C with an exit action, then every other state in C has only successors in C. belongs to a process term over PA^(A), this cycle must be of the form (i), (ii), or (iii) in Lemma 5.1. L Suppose C = (PoQ,..., Pn Q). Then none of the states in C has an exit action. Suppose C = (P* 2 , Pi (P*(2),..., P„(P* (2)), or any cyclic permutation thereof. Then P* Q is the only state in C that may have an exit action, and the other states in C have only successors in C. PROOF. AS C
Process algebra with recursive operations
367
Suppose C = (flo II Co. • ., ^/7 II Qn)- Since the communication merge is excluded from PA^(A), none of the states in C has an exit action. D LEMMA 5.1.4. Let C be a cycle in a labelled transition system associated to a process term over ACP*(A, |). Then there is at most one state in C with an exit action. As C belongs to a process term over ACP* (A, |), this cycle must be of the form (i), (ii), (iii), or (iv) in Lemma 5.1.1. We apply induction with respect to the size of C. Suppose C = ( P o g , . . . , Pn Q). Then none of the states in C has an exit action. Suppose C = {P* Q, P\ (P* Q),,.., Pn(P* 2)), or any cyclic permutation thereof. Then P*Q is the only state in C that may have an exit action. Suppose C = (Po\\ Qo,...,Pn\\ Qn)' Assume P, || Qi and Pj \\ Qj both have an exit action. Then by induction Pj || Qj represent the same state, so i = j . Suppose C = (9//(Po), •.., ^HiPn))- By induction, the cycle (Po, • • •, Pn) contains at most one state Pj that has an exit action. So dniPi) is the only state in C that may have an exit action. D PROOF.
We have the following expressivity hierarchy for process algebra with BKS. THEOREM
5.1.5.
BPA^(A) < PA^(A) < ACP*(A, I) < ACP*(A, |, r) where < means ''less expressive than, provided A contains at least k actions'' modulo strong bisimulation equivalence, except for the last inequality, which requires the presence ofx and soundness o/(Bl) {i.e., xr =x). If one does not restrict to handshaking, PA*(A)iACP*(A,|). The same inclusions hold in the absence of 8. < PA*(A) and BPA|(A) < PA^(A). Consider the PA*(A) process term P = (aa)*a || a, which can be depicted as follows:
PROOF. B P A * ( A )
a 4 ^
V
a P ~
a ^ 1 :;-
, ^ V
368
J.A. Bergstra et al.
where 1 abbreviates (aaya, 2 abbreviates a((aa)*a), 3 abbreviates a((aa)*a) \\ a, and 4 abbreviates a. According to Lemma 5.1.2, P cannot be specified in BPA^(A). Namely, the states P and 3 are not strongly bisimilar and form a cycle, while both states have a successor from which one cannot return to this (nor to any strongly bisimilar) cycle. PA^(A) -< ACP*(A, I), where / = 1 in a setting without handshaking and / = 2 otherwise. Take P as in the previous case, and \eia \a be defined (either as a, thus no handshaking, or as b^ a). Then on top of the picture above, the labelled transition system associated to P contains the following transitions: P - ^ y/, P - ^ 2, and 3 -^-^ 1. According to Lemma 5.1.3, P cannot be specified in PA|(A). Namely, the states P and 3 are not strongly bisimilar and form a cycle, while P has an exit action and 3 has a successor from which one cannot return to this (nor to any strongly bisimilar) cycle. 4
ACP*(A, I) < ACP*(A, I, r). Take the recursive specification Xy =
aX2-\-a,
X2 = aaX\ -\-a. Assume auxiliary actions b, c, and d, with c\c ^ b and d\d = b iht only communications defined. Let the process term P be defined by: P = T[b]od[cM]{{a{ad + Q = {c{a{a(ad^ac)
ac)+ac)Q\\R),
+ ac))yd,
R = (dc)*cd. It can be derived from the axioms of ACP*(A, |) together with (RSP) and (Bl) that P = X\. Hence, X\ is expressible in ACP*(A, |, r) modulo process semantics that respect (Bl). According to Lemma 5.1.4, Xi cannot be specified in ACP*(A, |, r) modulo strong bisimulation equivalence, even if r is allowed to occur in A as a non-silent action. Namely, X\ and X2 are not strongly bisimilar and form a cycle, while both X\ and X2 have an exit action. D It is an open question whether ACP*(A, |) < ACP*(A, |, r) holds. The following theorem emphasizes the expressive power of ACP*(A, |, r). 5.L6. For each regular process P there is a finite extension A^""^ of A such that P can be expressed in ACP*(A^^^ |, r), even if one restricts to handshaking and the actions in A are not subject to communication. THEOREM
Process algebra with recursive operations
369
PROOF. P is a solution for the recursion variable Xi in a recursive specification Xi = Yl^j^i ^ij^j -^Pifori = l,...,n, where aij and Pi are finite sums of actions or 8. Define A^^^ as the extension of A with the following 2« + 3 fresh atomic actions: in,
ry, Sj
(7 = 0 , . . . , n ) .
def
Let Kj I Sj = in (for j = 0 , . . . , « ) be the only communications defined (so we have handshaking, and the actions in A are not subject to communication). Furthermore, let def
H — {rj.Sj I / = 0 , . . . , « } , and let Gi
abbreviate
^
aij sj -\- fijSo for / == 1 , . . . , n,
7= 1
Q
abbreviate
I Xl'^^^^ ) ^^'
M
abbreviate
j Y^ry^y j (ro^o)-
We derive
^HiGiQWM) = a//(( X]«/j^ye + i^/^oGj II Mj = J^^^i.j^HisjQ II M) + ^idH(soQ II M) n
= Y^aij
indHiQ \\ SJM) -^Pi indniQ \\ so)
7=1 n
= ^
aij in in 9// (Gy Q \\ M)-\- Pi in in.
7=1
Hence,
T{in} o dH (Gi Q\\M) = J2 ""'J ^{"'} ° ^^ (^^- 2 II M) + A-. 7=1
Consequently, T{i„} o dniGiQ \\ M) satisfies the recursive equation for Xi (for / = 1 , . . . , n). By (RSP) it follows that X\ = r{/„} o dniGi Q \\ M). D
370
J.A. Bergstra et al
5.2. Expressivity of multi-exit iteration We first note that in the extension of BPA^ (A) with multi-exit iteration one cannot describe all regular processes modulo strong bisimulation equivalence. For example, the process described by X = aY-j-aZ, Y = aZ-\-a, Z — aX -\-aa, cannot be expressed, as from the state X the two non-bisimilar exits a and a a can be reached in a single step. In [1] it was shown that for every k^ I there is a process over a single action that can be specified using (k -\~ l)-exit iteration, but not using h-exit iteration with h ^k.We proceed to sketch their argumentation. For A: ^ 1, BPA'"^*^^^^(A) denotes the set of process terms over BPA'^^*(A) that only use /z-exit iteration with h ^k. The set of termination options of a process term P over BPA'"^*(A), is the smallest collection of process terms satisfying: • if P - ^ y , then A is a termination option of P\ • if P - ^ Q and Q does not contain occurrences of MEI, then aQisa termination option of P. LEMMA 5.2.1. Let C be a cycle in a labelled transition system associated to a process term over BPA'"^ * (< k)(A). Then C contains at most k states with distinct, non-empty sets of termination options. Let C = (Co,..., C„). We apply structural induction on Co- Clearly Co is not a single atomic action, and as -f does not occur as the first operation in right-hand sides of conclusions of transition rules, it follows that Co is not of the form P -\- Q. (1) Co = PoGo- There are two possibilities. (a) Qo is not a state in C. Then there is a cycle (Po,..., P„) such that C, = P, go for / = 0 , ...,n. If Qo contains occurrences of MEI, then all states in C have an empty set of termination options. If Qo does not contain occurrences of MEI, then the set of termination options of C, (for/ = 0 , . . .,n) is PROOF.
{RQo\ Ris 3. termination option of P,}. The inductive hypothesis yields that there are at most k process terms P, with distinct, non-empty sets of termination options. Hence, there are at most k states in C with distinct, non-empty sets of termination options. (b) Qo is a state C/ in C. By induction there are at most k states in the cycle ( C / , . . . , C„, C o , . . . , C/_ 1) with distinct, non-empty sets of termination options. So the same holds for C.
Process algebra with recursive operations
371
(2)Co = ( P i , . . . , P / , ) * ( e , , . . . , e / , ) , w h e r e / z ^ / : . Clearly, substates of the Qi cannot be in C. Thus the only states in C with possibly non-empty sets of termination options are (P/,...,p/„p,,...,P/_,)*(e/,...,eA,Gi,.
.,e/-i)
f o r / = 1, . . . , / i . THEOREM PROOF.
D
5.2.2. BPA'"^*^^^>(A) iBPA'""*^^^-^'^(.4)/or^ > 1.
Let ae A.li suffices to show that the {k + l)-exit iteration term
cannot be specified in BPA'"^*^^^^(A) modulo strong bisimulation equivalence. This follows from Lemma 5.2.1, because this process term induces a cycle that traverses the process term (a,...,«)*(«^...,«^+',«,...,«'-'), which has [a^] as set of termination options, for / = 1 , . . . , / : -f-1. Clearly, a^ ^aJ if/ ^ j . D
5.3. Expressivity of string iteration In this section it is shown that for every k ^ 1 there is a process over a single action that can be specified by SI using a string of length A: + 1, but not by SI using strings of length at most k. For ^ ^ 1, BPA^*^^^HA) denotes the set of process terms over BPA'*(A) that only use strings of length at most k. LEMMA 5.3.1. Let C be a cycle in a labelled transition system associated to a process term over B P A ^ * ^ ^ ^ \ A ) . Then C contains at most k distinct states. Let C = (Co,..., C„). We apply structural induction on CQ. Clearly Co is not a single atomic action, and as + does not occur as the first operation in right-hand sides of conclusions of transition rules, it follows that Co is not of the form P -\- Q. (1) Co = u;F. Clearly, P is a state C/ in C. By induction there are at most k distinct states in the cycle ( C / , . . . , C„, C o , . . . , C/-1). So the same holds for C. (2) Co = {a\' -ahTP. w h e r e h ^ k . Clearly, substates of P cannot be in C. Thus the only distinct states in C are PROOF.
fe+i . "ah){{ax • --ahTP)
(for / = 1 , . . . , h).
•
372
JA. Bergstra et al
THEOREM PROOF.
5.3.2. BPA^*^^^^(A) i(BPA^*^^^+'HA)/or^ ^ 1.
Let a e A.li suffices to show that the {k + l)-string iteration term
cannot be specified by a process term over BPA^*^^^^(A) modulo strong bisimulation equivalence. This follows from Lemma 5.3.1, because the process term above induces a cycle that traverses the /: -h 1 non-bisimilar process terms «' {{a^^')*«) for / = 0,...,/:. D
5.4. Expressivity of flat iteration This section presents some expressivity results on FI from [16]. BPA^*(A), BPA^*(A), PA^*(A), and ACP^*(A, |) are obtained by adding FI to BPA(A), BPA^CA), PA(A), and ACP(A, I), respectively, and restricting sequential composition to flat multiplication. As stated below, restricting sequential composition to prefix multiplication gives no loss of expressivity. Flat iterative basic terms over BPA^*(A) are defined by the BNF grammar P:\=a\P
+
P\aP\a''P
where a e A and a is an atomic sum. Flat iterative basic terms over BPA^ (A) are defined by adding 8 to the BNF grammar. 5.4.1. Each process term over BPA*(A) [BPAJ(A)] with BKS restricted to FI is bisimilar to aflat iterative basic term over LEMMA
PROOF.
By structural induction, using the axioms of BPA^(A) and those in Table 15. D
With respect to expressivity of systems with FI in strong bisimulation semantics we have the following results. 5.4.2. (1) BPA^*(A)iBPA*(A)flnJBPA/*(A)iBPA*(A), (2) BPA^*(A) is as expressive as PA^*(A), and (3) BPAJ*(A) is as expressive as ACP^*(A, |).
THEOREM
PROOF. Fact (1) is trivially true, as FI does not give rise to cycles of length greater than one. For example, the process term (aa)*a over BPA*(A), which has a cycle of length two, cannot be expressed in BPA^ (A) modulo strong bisimulation equivalence. We proceed to present the proof of Fact (2). Fact (3) can be proved in a similar fashion. From Lemma 5.4.1 it follows that BPA^*(A) is as expressive as PA^*(A) if all process terms P \\ Q and P ^ Q with P and Q flat iterative basic terms are expressible in BPA^*(A). Expressibility of P \\ Q and P I Q in BPA^*(A) can be proved in parallel.
Process algebra -with recursive operations using induction on the size of such terms. We focus on the case P \\ Q\ the case P IL G can be dealt with in a similar fashion. We consider three cases, depending on whether P and Q are of the form a* /?. (1) Let P = a*/? and Q = p^^S. Then we derive (using commutativity of || in PA*(A)) P\\Q = {ct + P)(P\\Q)^R
t
Q^St
P.
The process terms /? |L 2 and 5" [L /^ have sizes smaller than P \\ Q, so by induction they can be expressed in BPA^*(i4), say by U and V, respectively. By (RSP*),
so P II e is expressible in BPA^*(^). (2) Let P =Ac Ez < ^ / + Hj ^jSj + Hk ^k (with P not of the form a*R) and Q = P*T. Then we derive P\\Q
= P(P\\Q)-hT
I P + ^ a , ( « / ? / ) II Q) + ^ a , ( 5 , - || Q) i
J
+ J2^kQThe process terms T (L P, (a*Ri) \\ Q, and Sj || Q have sizes smaller than P || Q, so by induction they can be expressed in BPA^*(.4), say by U, V/, and Wj, respectively. By (RSP*),
P\\Q = r f ^ + ^«/V/+^a,W,+J]^^Q^ so P II 2 is expressible in BPA^*(A). (3) Let P =AC E , «r Pi + E ; ^j Sj + Y.k ^k (with P not of the form a* P) and Q =AC E ^ i^r^^ + Em ^mUm + E n ^/» (^i^h Q not of the form )8*r). Then we derive
P\\Q = J2ai{(afRi) II Q) + ^aj(Sj \\ Q) + J2^'Q J
k
The process terms (a*P/) || g , 5y || G, ()S*r£) || P, and L^,„ || P have sizes smaller than P II Q, so by induction they can be expressed in BPA^*(y4). Hence, P || 2 is expressible inBPA^*(A). Owing to commutativity of the merge, the three cases above cover all possible forms of P II Q. So we conclude that P || 0 is expressible in BPA^*(^). D
373
374
J.A. Bergstra et al.
Note that parts in general process terms over BPA^*(A) [BPA^*(y4)] cannot be equated to process terms over PA^*(A) [ACP^*(A, |)]. If one of the arguments of || specifies a cycle, this occurrence of || cannot be eliminated with the axioms provided.
6. Non-regular recursive operations With each of the recursive operations discussed before, one can define at most a regular process. In this section we consider some operations with which non-regular processes can be described. A typical example of a non-regular process is a stack over a finite data type. In [17], Bergstra, Bethke, and Ponse introduced the recursive, non-regular nesting operation U, defined by (NE)
x^y=x{{x^y)x)^-y.
More recently, in [23,24], Bergstra and Ponse introduced two other non-regular, recursive operations, the back and forth operation, notation ^ , defined by
(BF)
x^y=x({x^y)y)^y,
and the push-down operation, notation $, defined by (PD)
xV=x((jcV)(xV))+J.
The transition rules for these operations are as expected. As an example, consider the process terms a^b, a^b, and a^b, of which the labelled transition systems are illustrated below:
V
a-b
(a^'b)
(a-b)
{{a^b)a)a
((a-b)b)b
-^b
The three operations give rise to variants of RSP*: (RSP^) (RSP^)
x= X =
y(xy)-^z y''Z
X = y{xz)-\-z x = y^z
a^b
(a^b)
{a^b)^(a^b)
V
Process algebra with recursive operations
(RSP^)
375
x^y{xx)-\-z X = y^z
It is easily seen that these three operations are non-regular, and it can be argued that they are the most simple candidates for obtaining a binary, non-regular recursive operation. Let o e {tJ, ^ , $}. Adding o to the signature of ACP(A, |), and its defining axiom to those of ACP(A, I), yields the system ACP^(A, |). In the same way, we define ACP*^(A, |) as the extension of ACP*(A, |) with o. It is an open question whether the resulting axiomatisations with the corresponding RSP variant are complete modulo strong bisimulation equivalence. In [23,24], the following results were recorded. • Adding abstraction to ACP^(A, |) with o G {tJ,^,$} and A sufficiently large yields universal expressivity modulo process semantics that respect (Bl)."^ (Note that BKS need not be available.) • For o € {tt, ^ , $} and A sufficiently large, ACP*'^(/4, |) has an undecidable theory. The point is that one can encode register machine computability in a systematic way, and reduce recursive inseparability to provable equality in the initial algebra of ACP*"^ (A, |). In [17], it was proved that a stack over a finite data type can be defined with the operations of ACP with abstraction and handshaking communication, with the help of a finite number of auxiliary actions and of the operations * and tJ. With two stacks and a regular control process, a Turing machine can be specified in process algebra; see [11]. As a consequence, each computable process can be specified in this setting. Bergstra and Ponse [23,24] proved that adding only one of tJ, $, or ^ to ACP(A, |, r) yields a setting in which regular processes and stacks can be defined, and therefore each computable process. In this section we sketch the argumentation for the $-case of these results. This case is more simple and direct than the other two cases. In the forthcoming expressiveness proofs, strong bisimilarity of process terms is derived from the axioms. For clarity of presentation, in these derivations we assume the presence of axioms for commutativity and associativity of the merge. However, the axiomatic derivability of the expressiveness results can also be obtained without these axioms. 6.1. Process algebra with a push-down operation We first show that each regular process can be specified in ACP^(A, |, r) modulo process semantics that respect (Bl), provided A is sufficiently large. This is the first cornerstone of the universal expressivity result for ACP^(A, |, r). 6.1.1. For each regular process P there is a finite extension A^-^'^ of A such that P can be expressed in ACP^(A^^^ |, r), even if one restricts to handshaking and the actions in A are not subject to communication. THEOREM
PROOF. P is a solution for the recursion variable Xi in a recursive specification X, = Yl]=\^'^iJ^j) + A for/ = 1, . . . , n , where a/,y and )S/ are finite sums of actions or 5. ^ In the case of rooted weak bisimulation semantics, the resulting theory can be judged expressively complete, as all semi-computable processes that initially are finitely branching can be expressed; see [24].
376
JA. Bergstra et al.
Define A^^^ as the extension of A with the following 2« -f- 3 fresh atomic actions: in,
rj,
sj
0=0,
...,M).
def
Let rj I Sj = in (for j = 0, . . . , n ) be the only communications defined (so we have handshaking, and the actions in A are not subject to communication). Furthermore, let def
H = {rj,Sj I / = 0 , . . . , « } , and let Fi abbreviate j ^Y^ajjSj ] -\- fii for / = 1,...,«,
K abbreviate j Y^o/^y I ^o, n
\ S
M abbreviate ( Y.rjSj\
50.
Then X\ = r{/„} o 3//(Fi K \\ M). This can be shown with the help of the infinite recursive specification Yi{k) = iY^aijYj{k
^' \)\ -^ fii, where n ^ 1, / = 1,... ,n, )^ € N.
Obviously, Xt is a solution for each 7, (Jt) (/ = 1 , . . . , w, k e N). So by (RSP) it suffices to show that X[in] o dniFiK \\ M) is a solution for F/(0). We show this by first omitting the ^{m}-application. For /: e N we derive
+ jS,-9//(/:^+'||M*+') ,m*+'
= ( Y, oti.j in in 9// (Fj K''^^ \\ M*+2) ) + A'«'*+i
Hence, applying axioms (Bl) and (TI1)-(TI4), we find for each k e'H r|,„, O3H(F,/(:*+' II M*+') = I ^ a , , y r | , „ ) oaH(FyA:*+2 || A/^+2) j + ^ , .
Process algebra with recursive operations So T[in} o dniFiK^^^
377
II M^^^) satisfies the recursive equation for Yi(k).
D
A basic, auxiliary process used in the following proofs is the counter C displayed below, with actions a (add one), b (subtract one), c (test zero), and d (remove the counter):
V
r (a''b)C
(a^b)^C
This process can be recognized as a register, i.e., a memory location for a natural number with unbounded capacity and restricted access as modelled by the specific actions. Using BKS and push-down, the counter C can be defined by
C = {a{a^b)-\-cyd. The following result states that C can be defined without BKS, at cost of five auxiliary actions. In the next section we shall define a stack using two counters and a regular control process. LEMMA 6.1.2. Let A = {a,b,c,d). The counter (a(a^b) -h c)*d can be defined in ACP^(A^-^M,r) w/r/2 |A^-^''\A| = 5, even if one restricts to handshaking and the actions in A are not subject to communication. PROOF.
Define A^^^ as the extension of A with the following five fresh atomic actions: m,
ry, Sj
( 7 = 0 , 1).
def
Let rj I Sj = in (for j = 0,1) be the only communications defined (so we have handshaking, and the actions in A are not subject to communication). Furthermore, let P Q R
abbreviate abbreviate abbreviate
{a(a^b) + c)s\ + d, {riP)^ro, (ri^O^^o-
Then it follows with (RSP) that {a(a^b) -f c)*J = m,,} o d[ri.s.\i=OA}(PQ II R)-
D
378
JA. Bergstra et al.
6.2. Expressing a stack We provide recursive specifications of a stack over a finite data type in ACP^(A^^^ |, T), with the help of a regular control process and two counters. Let D = { d i , . . . , d/v} for some A^ ^ 1 be a finite set of data elements, ranged over by d. Let furthermore D* be the set of finite strings over D, ranged over by <J, and let e denote the empty string. The stack S{e) over D with empty-testing and termination option is defined by the infinite recursive specification
S{s) =
lj^ridj)S(dj)\+s(empty)S(s)-i-risto),
S(da) = ( ^ r ( d y ) 5 ( d y d a ) ] + ^ ( d ) 5 ( a ) .
Here the contents of the stack is represented by the argument of S: S(da) is the stack that contains da with d on top. Action r(d/) (receive d/) models the push of d/ onto the stack, and action 5(d/) (send d,) represents deletion of d, from the stack. Action s (empty) models empty-testing of the (empty) stack, and action r(stop) models termination of the (empty) stack. A non-terminating or non-empty-testing stack over D can be obtained by leaving out the concerning sunmiand. In case N = I (D = {d\}), the recursive equations above specify a counter: the stack contents then models the counter value. The following theorem is the second (and last) cornerstone of the universal expressivity resultforACP^(A,|,r). THEOREM 6.2.1. Each stack over a finite data type D with actions from A can be expressed in ACP^(A^^^ I, T) with A^^^ a finite extension of A, even if one restricts to handshaking and the actions in A are not subject to communication.
Let a stack S{e) be given as described above. Without loss of generality, assume D = { d i , . . . , dA^} for some A^ > 1 (if A^ = 1, then a counter does the job). Our approach is to encode the contents of the stack, i.e., elements from D*, by natural numbers according to the following Godel numbering '".'^: D* ^- N: PROOF.
V
^^ 0,
r-dya"' =^ j + N • ^a"". This encoding is a bijection with inverse decode :N ^- D* (let * denote concatenation of strings): s if«=0, decodein) = \ dw * decodeC^) i{n^O,nmodN= d(„ ,„od N) * decodei""<" ';;,'"' ^ ' ) otherwise.
0,
Process algebra with recursive operations
379
For example, if iV = 3, then '"d3di d2~' = 24 and decode(32) = d2di da e {di, d2, d3}*. Next, we define two counters to specify S{s) in ACP^(A^^^ |, r): Cj = {aj{a]bj)+cjydj
(7 = 1,2),
with add-action aj, subtract-action bj, zero-testing cj, and stop-action dj, all in A^'^^ \ A. We shall use the following abbreviations (for n e N): def
Cj(0) '=1* Cy, Cjin + l)"^^
{aj%)Cj(n),
We further define a regular control process X^ with actions aj,bj,Cj,dj e A^^^ \ A and those of the stack. In combination with the Cy, the process X^ is used to define S{E). Note that the coding discussed above does not occur explicitly in this recursive specification.
^e = f Y^r(dj)a\Xj
\
-Vs{empty)Xe-\-r{stop)d\d2,
and for A: = 1 , . . . , iV:
Xk = ( ^ r ( d y ) Pushy j + 5 ( d ^ ) P o p ^ . ,
Pushit = (Shift 1 to 2)a\(N Shift 2 to 1)X^, Pop^ = b\( — Shift 1 to 2 jTest^, = {bia2)*ci
(shift the contents of Ci to C2),
N A^ Shift 2 to 1 = {bia^Tci 1
Shift lio2
(shift the A^-fold of C2 to Ci),
— Shift 1 to 2 = MaiYcx (shift the number of N-folds of C\ to C2), A^ ^ ' Testg = /?2«iTesti -|- C2X^ (determine whether the stack is empty, Testi = Z72«iTest2 + Q X I
or which D-element is on top),
Test2 = bia\Test3 -\-c2X1, TestA^ = ^2^iTesti -hC2Xyv. Let I for 7 = 1, 2 be defined on (^^"^ \ ^ ) ^ by QJ \ QJ = bj \ bj = Cj \ cj = dj \ dj = in e A^^^ \ A, and let H = {aj,aj,bj,bj,Cj,Cj,dj,dj | 7 = 1, 2}. We show that
T{/.}oa,/(x, lie(0)11 C2(0))
380
JA. Bergstra et al.
behaves as S(6), the empty stack:
T(m}oa//(x, i|Ci(0)i|C2(0))
-^s{empty)mn} o a,/(X, || C,(0) || C2(0)) ^r{stop)T{in}odH{did2 II C,(0) II C2(0))
-^siempty)T{in} o dniX^ \\ Ci(0) || C2(0))
= ( E''^^>)^i'«} ° ^^(^v- II ^i( ""^i^) II ^2(0)) J + s{empty)x{in] o a^(X, || Ci (0) || CiiO)) + r(^r^/7).
(3)
We are done if T{in} o dniXj \\ C\ ( ^dya^) || CiiO)) behaves as S{dja) for some a e D*. We prove this by first omitting the T{,„} -operation, and analyzing the behaviour of dn (Xj \\ C\( ^djcr'^) II C2(0)). This analysis is arranged in a graphical style in Figure 1, where P - ^ Q represents the statement P =aQiox some a e A, P-^ Q represents P = aQ, and branching represents an application of + . So the uppermost expression in Figure 1 with its arrows and resulting expressions represents the obviously derivable equation
a//(Xy II CC^dyor^) || Cii^)) = I ^rCd^Oa//(Push;^ II C,(^d,a^) II C2(0))j -^s(dj)dH{Popj
II Cii^dja-") II C2(0)).
By the axiom (Bl), identity (3) above, and the derivation displayed in Figure 1 it follows that r{in} o dH{Xs II Ci (0) II C2(0))
and
r{/„} o dn {Xj \\ C, ( ^dya^) || C2(0))
satisfy the recursive equations for S(8) and S(dja), respectively (j = 1 , . . . , N and a e D*). By (RSP) it follows that S(8) = T{in}odH(Xe\\Ci
|| C 2 ) .
By Theorem 6.1.1 and Lemma 6.1.2 it follows that once D is fixed, X^ and hence the empty stack S(e) can be expressed in ACP^(A''^', |, r) with handshaking for some A''^' ^A. D
381
Process algebra with recursive operations
3//(Xj||Ci(^dya^)||C2(0)) r{dk)fork =
h...^N a,/(Popy ||C,(^dya^)||C2(0))
a//(Push^||Ci(^dya^)||C2(0)) Shift 1 to 2 communications dH(a\N Shift2to IX^^ || Ci(0) || Cji^'djcr^))
{b\\bx)J
dHijjShifi
1 to 2Test^ || Ci(N • ^a"^) || C2(0))
jj Shift 1 to 2 comm 's
(«l|ai)^ dniN Shift 2 to IX^ II Ci (k) II C2( ^dja^))
a//(Test^ || Cj (0) || Cji V ) )
//Shift 2 to 1 comm's 3//(^ytl|C,(^d;tdyO||C2(0)) I dniXe II C,(0) II C2(0)) I
((Z?2l^2)(«ll^l))
a//(Testyv II C,(A^ • ^i;-^) || Ciik)) {{b2\b2){a\\ax)f
a/y(Test;^. ||Ci(^d^i;^)||C2(0))
a//(X^I|Ci{^d^.u'^)||C2(0)) Fig. 1. Calculations with dniXj \\ C\ (''djo'^) \\ C2(0)).
Baeten, Bergstra, and Klop [11] showed that Turing machines can be specified in process algebra by means of two stacks and a regular control process. In view of Theorem 6.2.1, this yields that ACP^(A, |, T) is universally expressive; see [24] for details.
6.3. Undecidability results We now sketch the undecidability result mentioned above for ACP*^(A, j). The idea is that in this signature one can 'implement' register machine computability in the following way. (1) Registers (counters) have a straightforward definition in ACP* (A, |), namely {a{a%) + cYd (cf. Section 6.1). (2) Starting from a universal programming language for two-register machines (cf. Minsky in [65]), one can define a process algebraic representation of each program in BPA*(A) (using a third register for I/O, and a fourth one as "program-line counter").
382
J.A. Bergstra et al.
(3) Defining encapsulation in an appropriate way, this yields for any computable function / : N -^ N a process term P and a computable function ^: N ^- N \ {0} such that the equation dH{Px II Co(n) II Ci II C2 II C3) = in^^"^dH{x \\ Co{f(n)) \\ C, || C2 || C3) can be derived from the axioms for ACP*^(A, |) if and only if f(n) is defined, and the left-hand side equals an infinite m-trace otherwise. Here in is the result of a conmiunication between the program (process term) P and the registers. Now let Wey, We2 be recursively inseparable sets, and let / : N -> N be the partial recursive function defined by
f(n)=l
1
ifneWe,,
I undefined
otherwise.
Choose P as described in item (3) above, and let Pp P2 and P\ (n), P2{n) be defined by P[ =
P(s^d3)is^d2)(s;dO(s^do).
P^ =
P(s;d3)(s^d2)(s;d\){(S0(s^C0)rd0),
Piin) = dH{P; II Coin) II C, II C2 II C3)
(/ = 1,2).
Then we find neWe,
=^ f(n) = 0=^Pan)
neWe,=^
= P2(n)
fin) = 1 ^ />, (n) ^ P2in)
(=/«^^"^+^), {in'^"^^^ # in'^"^^^).
As to the latter implication: assume otherwise, i.e., in^ — in^^^ for some k^ \. Then by Lemma 2.2.2, in^ <± in^^\ which clearly is a contradiction. Thus, decidability of P\in) = Pjin) provides a recursive separation of We^ and W^2' which is contradictory. All details and a more precise explanation can be found in [24]. A similar proof strategy can be applied for ACP*^(A, j) and ACP*^(A, |), where counterlike processes are used instead.
7. Special constants This section provides some last comments on two particular constants. First we shortly consider the silent step r in relation to fairness, deahng with infinite r-traces (cf. Definition 2.3.3 and Theorems 4.5.1^.5.4). Finally, we briefly discuss the empty process in the context of iteration.
Process algebra with recursive operations
383
7.1. Silent step and fairness Due to the character of r, one would want to be able to abstract from infinite sequences of r steps. Depending on the kind of process semantics adopted, different solutions have been found. In the case of rooted branching bisimulation, with next to (Bl) the extra axiom
(B2) x{x{y^z)
+ y)=x{y + z)
a general solution is provided by Koomen'sfair abstraction rule [55,11]. For each n and each set of equations, there is a version KFAR,^ that is valid in rooted branching bisimulation. For example, the axiom KFAR^ reads as follows: x = ix ~\-y (i € /) Tr/(x) = TT/(y) (so the infinite r sequence induced by ix is reduced to a single r step). By definition of BKS we now have an immediate representation of the process in the premise of KFARp namely i*y. Henceforth we can represent KFAR^ by the law rr/(/*y) = rr/(y)
(/€/).
Given the distribution law (BKS5)
r/(x*y) = r/(jc)*r/(y)
(see Table 8), we can even represent KFAR^ simply by (HR^)
r(T*Jc) = rjc.
(taking jc for r/(y)), where FIR abbreviates Fair Iteration Rule. EXAMPLE 7.1.1. A particular consequence of FIR^ is the case where x as above is replaced by Tx:
T*(rx) = Tx,
(4)
theproof of which is trivial: r*(rjc) = r(r*(rjc))+ tjc = r r x - | - r x = Tx. As a small example of the use of F//?^ consider a statistic experiment which models the tossing of a coin until head comes up (cf. [15]). This process can be described by: (throw t a i l ) * t h r o w head. for actions throw, t a i l , and head. We assume that the probabiHty of tossing heads is larger than 0. Thus we exclude the infinite trace that alternately executes t h r o w and t a i l . Abstracting from just the two atomic actions in / = {throw, t a i l } , F//?^ yields r / ( ( t h r o w t a i l ) * t h r o w head) = r h e a d .
384
JA. Bergstra et al
First, observe r / ( t h r o w t a i l ) = r. Then, using (4), it easily follows that r/((throw t a i l ) * t h r o w head) = r head. This expresses that h e a d eventually comes up, and thus excludes the infinite sequence of r-steps present in r / ( ( t h r o w t a i l ) * t h r o w h e a d ) .
7.2. Empty process Let the symbol 6: denote the empty process, introduced as a unit for sequential composition by Koymans and Vrancken in [56] (see also [15,74]). Obvious as e may be (being a unit for •), its introduction is nontrivial because at the same time it must be a unit for || as well. In the design of BPA, PA, AC? and related axiom systems, it has proved useful to study versions of the theory, both with and without e. Just for this reason the star operation with its (original) defining equation as given by Kleene in [53] was introduced in process algebra. Taking y = e'm x'^y, one obtains x*£ which satisfies X*£=JC(jC*£)+£.
(5)
The unary operation _*£ is a plausible candidate for the unary version of Kleene's star operation in process algebra. Moreover, taking jc = 5 in (5) implies that 5*^ = ^ (by the identities ^x = 8 and 5 + jc = jc), and hence that *£ cannot be used in a setting without having a available as a separate process (once 5 is accepted as one). So with e, the interdefinabihty of the unary and the binary star, noted in [30], is preserved. Milner [62] formulated an axiomatisation for the unary Kleene star in BPA with deadlock and empty process, modulo strong bisimulation equivalence. It remains an open question whether this axiomatisation is complete. Fokkink showed that Milner's axiomatisation adapted to no-exit iteration (NEI, see Section 4.1) is complete modulo strong bisimulation equivalence, in the presence of empty process. A particular consequence of Milner's axiomatisation is (in our notation, using binary Kleene star) s^x = jc,
which seems a natural identity. Turning to the non-regular operations (see Section 6), the identity e^x = x seems as natural. The other two non-regular operations, i.e., the pushdown $ and the back and forth operation ^ , have a more surprising effect when combined with e. Using recursive specifications we find that s^a is a solution of the recursive equation
and 8^a is a solution of X = Xa-\-a.
Process algebra with recursive operations
385
Both these recursive specifications are easily associated with infinitely branching processes. The (unguarded) specification X = Xa -\- a occurs in [15] as an example specification that has two distinct solutions: Y17=\ ^' ^^^ ^^ "+• Y17^\ ^' • ^^^ transition rules for recursive specifications (see Table 3) as well as those for ^ yield the first solution. The interplay of recursive operations with empty process is apparently nontrivial and deserves further study.
Acknowledgements We thank Faron Moller for providing useful comments.
References [1] L. Aceto and WJ. Fokkink, An equational axiomatization for multi-exit iteration. Inform, and Comput. 137 (2) (1997), 121-158. [2] L. Aceto, W.J. Fokkink, R.J. van Glabbeek and A. Ingolfsdottir, Axiomatizing prefix iteration with silent steps. Inform, and Comput. 127 (1) (1996), 26-40. [3] L. Aceto, W.J. Fokkink and A. Ingolfsdottir, On a question of A. Salomaa: The equational theory of regular expressions over a singleton alphabet is not finitely based, Theoret. Comput. Sci. 209 (1/2) (1998), 163-178. [4] L. Aceto, W.J. Fokkink and A. Ingolfsdottir, A menagerie of non-finitely based process semantics over fiPA*: From ready simulation to completed traces. Math. Struct. Comput. Sci. 8 (3) (1998), 193-230. [5] L. Aceto, W.J. Fokkink and A. Ingolfsdottir, A Cook's tour of equational axiomatizations for prefix iteration. Proceedings 1st Conference on Foundations of Software Science and Computation Structures (FoSSaCS'98), Lisbon, Lecture Notes in Comput. Sci. 1378, M. Nivat, ed.. Springer-Verlag (1998), 20-34. [6] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [7] L. Aceto and J.F. Groote, A complete equational axiomatization for MPA with string iteration, Theoret. Comput. Sci. 211 (1/2) (1999), 339-374. [8] L. Aceto and A. Ingolfsdottir, An equational axiomatization of observation congruence for prefix iteration. Proceedings 5th Conference on Algebraic Methodology and Software Technology (AMAST'96), Munich, Lecture Notes in Comput. Sci. 1101, M. Wirsing and M. Nivat, eds. Springer-Verlag (1996), 195-209. [9] D.N, Arden, Delayed logic and finite state machines. Theory of Computing Machine Design, University of Michigan Press (1960), 1-35. [10] F. Baader and T. Nipkow, Term Rewriting and All That, Cambridge University Press (1998). [11] J.C.M. Baeten, J.A. Bergstra and J.W. Klop, On the consistency ofKoomen 'sfair abstraction rule, Theoret. Comput. Sci. 51 (1/2) (1987), 129-176. [12] J.C.M. Baeten, J.A. Bergstra and J.W. Klop, Decidability of bisimulation equivalence for processes generating context-free languages, J. ACM 40 (3) (1993), 653-682. [13] J.C.M. Baeten and R.J. van Glabbeek, Another look at abstraction in process algebra. Proceedings 14th Colloquium on Automata, Languages and Programming (ICALP'87), Karlsruhe, Lecture Notes in Comput. Sci. 267, T. Ottmann, ed.. Springer-Veriag (1987), 84-94. [14] J.C.M. Baeten and C. Verhoef, A congruence theorem for structured operational semantics with predicates. Proceedings 4th Conference on Concurrency Theory (CONCUR'93), Hildesheim, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer-Veriag (1993), 477-492. [15] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts in Theoretical Computer Science 18, Cambridge University Press (1990). [16] J.A. Bergstra, I. Bethke and A. Ponse, Process algebra with iteration. Report P9314, Programming Research Group, University of Amsterdam (1993).
386
J.A. Bergstra et al.
[17] J.A. Bergstra, I. Bethke and A. Ponse, Process algebra with iteration and nesting, Comput. J. 37 (4) (1994), 243-258. [18] J.A. Bergstra, J.A. Hillebrand and A. Ponse, Grid protocols based on synchronous communication, Sci. Comput. Programming 29 (1/2) (1997), 199-233. [19] J.A. Bergstra and J.W. Klop, Process algebra for synchronous communication. Inform, and Comput. 60 (1/3) (1984), 109-137. [20] J.A. Bergstra and J.W. Klop, Algebra of communicating processes with abstraction, Theoret. Comput. Sci. 37(1) (1985), 77-121. [21] J.A. Bergstra and J.W. Klop, Verification of an alternating bit protocol by means of process algebra. Proceedings Spring School on Mathematical Methods of Specification and Synthesis of Software Systems 85, Wendisch-Rietz, Lecture Notes in Comput. Sci. 215, W. Bibel and K.P. Jantke, eds. Springer-Verlag (1986), 9-23. [22] J.A. Bergstra, J.W. Klop and J.V. Tucker, Algebraic tools for system construction. Proceedings 4th Workshop on Logics of Programs, Pittsburgh, Lecture Notes in Comput. Sci. 164, E. Clarke and D. Kozen, eds. Springer-Verlag (1984), 34^^44. [23] J.A. Bergstra and A. Ponse, Two recursive generalizations of iteration in process algebra. Report P9808, Programming Research Group, University of Amsterdam (1998). Extended version to appear in: Theoret. Comput. Sci. [24] J.A. Bergstra and A. Ponse, Register machine based processes. Programming Research Group, University of Amsterdam, June 13 (1999). [25] S.L. Bloom and Z. Esik, Equational axioms for regular sets. Math. Struct. Comput. Sci. 3(1) (1993), 1-24. [26] S.L. Bloom, Z. Esik and D.A. Taubner, Iteration theories of synchronization trees. Inform, and Comput. 102(1) (1993), 1-55. [27] J. Boselie, Expressiveness results for process algebra with iteration. Master's Thesis, University of Amsterdam (1995). [28] D.J.B. Bosscher, Grammars modulo bisimulation, Ph.D. Thesis, University of Amsterdam (1997). [29] D. Caucal, Graphes canoniques de graphes algebriques, Theoret. Inform. Appl. 24 (4) (1990), 339-352. [30] I.M. Copi, C.C. Elgot and J.B. Wright, Realization of events by logical nets, J. ACM 5 (1958), 181-196. [31 ] J.H. Conway, Regular Algebra and Finite Machines, Chapman and Hall (1971). [32] F. Corradini, R. De Nicola and A. Labella, Fully abstract models for nondeterministic regular expressions. Proceedings 6th Conference on Concurrency Theory (CONCUR'95), Philadelphia, Lecture Notes in Comput. Sci. 962,1. Lee and S.A. Smolka, eds. Springer-Verlag (1995), 130-144. [33] F. Corradini, R. De Nicola and A. Labella, Models of nondeterministic regular expressions, J. Comput. System Sci. 59 (3) (1999), 412^^9. [34] F. Corradini, R. De Nicola and A. Labella, A finite axiomatization of nondeterministic regular expressions, Theoret. Inform. Appl. 33 (4) (1999), 447-466. [35] S. Crvenkovic, I. Dolinka and Z. Esik, A note on equations for commutative regular languages. Inform. Process. Lett. 70 (6) (1999), 265-267. [36] W.J. Fokkink, A complete equational axiomatization for prefix iteration. Inform. Process. Lett. 52 (6) (1994), 333-337. [37] W.J. Fokkink, A complete axiomatization for prefix iteration in branching bisimulation, Fundamenta Informaticae 26 (2) (1996), 103-113. [38] W.J. Fokkink, On the completeness of the equations for the Kleene star in bisimulation. Proceedings 5th Conference on Algebraic Methodology and Software Technology (AMAST'96), Munich, Lecture Notes in Comput. Sci. 1101, M. Wirsing and M. Nivat, eds. Springer-Verlag (1996), 180-194. [39] W.J. Fokkink, Axiomatizations for the perpetual loop in process algebra. Proceedings 24th Colloquium on Automata, Languages and Programming (ICALP'97), Bologna, Lecture Notes in Comput. Sci. 1256, P. Degano, R. Gorrieri and A. Marchetti-Spaccamela, eds. Springer-Verlag (1997), 571-581. [40] W.J. Fokkink, Language preorder as a precongruence, Theoret. Comput. Sci. 243 (1/2) (2(X)0), 391-408. [41] W.J. Fokkink, Rooted branching bisimulation as a congruence, J. Comput. System Sci. 60 (1) (20(X)), 1337. [42] W.J. Fokkink, Introduction to Process Algebra, Springer-Verlag (2000). [43] W.J. Fokkink and R.J. van Glabbeek, Ntyft/ntyxt rules reduce to ntree rules. Inform, and Comput. 126 (1) (1996), 1-10.
Process algebra with recursive operations
387
[44] W.J. Fokkink and H. Zantema, Basic process algebra with iteration: Completeness of its equational axioms, Comput. J. 37 (4) (1994), 259-267. [45] R.J. van Glabbeek, The linear time - branching time spectrum. Proceedings 1st Conference on Concurrency Theory (CONCUR'90), Amsterdam, Lecture Notes in Comput. Sci. 458, J.C.M. Baeten and J.W. Klop, eds. Springer-Verlag (1990), 278-297. See also: Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 3-99. [46] R.J. van Glabbeek, A complete axiomatization for branching bisimulation congruence of finite-state behaviours. Proceedings 18th Symposium on Mathematical Foundations of Computer Science (MFCS'93), Gdansk, Lecture Notes in Comput. Sci. 711, A. Borzyszkowski and S. Sokolowski, eds. Springer-Verlag (1993), 473-484. [47] R.J. van Glabbeek, The linear time - branching time spectrum II: The semantics of sequential systems with silent moves. Proceedings 4th Conference on Concurrency Theory (CONCUR'93), Hildesheim, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer-Verlag (1993), 66-81. [48] R.J. van Glabbeek, Axiomatizing flat iteration. Proceedings 8th Conference on Concurrency Theory (CONCUR'98), Warsaw, Lecture Notes in Comput. Sci. 1243, A. Mazurkiewicz and J. Winkowski, eds, SpringerVerlag (1997), 228-242. [49] R.J. van Glabbeek and W.P. Weijland, Branching time and abstraction in bisimulation semantics, J. ACM 43 (3) (1996), 555-600. [50] J.F. Groote and F.W. Vaandrager, Structured operational semantics and bisimulation as a congruence. Inform, and Comput. 100 (2) (1992), 202-260. [51] M. Hennessy, A term model for synchronous processes. Inform, and Control 51 (1) (1981), 58-75. [52] S.C. Kleene, Representation of events in nerve nets and finite automata. Research Memorandum RM-704, U.S. Air Force Project RAND, The RAND Cooperation (15 December 1951). [53] S.C. Kleene, Representation of events in nerve nets andfiniteautomata. Automata Studies, C. Shannon and J. McCarthy, eds, Princeton University Press (1956), 3-41. [54] D.E. Knuth and P.B. Bendix, Simple word problems in universal algebras. Computational Problems in Abstract Algebra, J. Leech, ed., Pergamon Press (1970), 263-297. [55] C.J. Koomen, A structure theory for communication network control, Ph.D. Thesis, Delft Technical University (1982). [56] C.P.J. Koymans and J.L.M. Vrancken, Extending process algebra with the empty process e. Logic Group Preprint Series Nr. 1, CIF, Utrecht University (1985). [57] D. Kozen, A completeness theorem for Kleene algebras and the algebra of regular events. Inform, and Comput. 110 (2) (1994), 366-390. [58] D. Krob, Complete systems of B-rational identities, Theoret. Comput. Sci. 89 (2) (1991), 207-343. [59] W.S. McCuUoch and W. Pitts, A logical calculus of ideas immanent in nervous activity. Bull. Math. Biophys. 5(1943), 115-133. [60] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer-Verlag (1980). [61] R. Milner, A modal characterisation of observable machine-behaviour. Proceedings 6th Colloquium on Trees in Algebra and Programming (GAAP'81), Genoa, Lecture Notes in Comput. Sci. 112, E. Astesiano and C. Bohm, eds. Springer-Verlag (1981), 25-34. [62] R. Milner, A complete inference system for a class of regular behaviours, J. Comput. System Sci. 28 (3) (1984), 439-466. [63] R. Milner, Communication and Concurrency, Prentice Hall (1989). [64] R. Milner, A complete axiomatisation for observational congruence of finite-state behaviours. Inform, and Comput. 81 (2) (1989), 227-247. [65] M.L. Minsky, Computation: Finite and Infinite Machines, Prentice Hall (1967). [66] D.M.R. Park, Concurrency and automata on infinite sequences. Proceedings 5th GI (Gesellschaft fiir Informatik) Conference, Karlsruhe, Lecture Notes in Comput. Sci. 104, P. Deussen, ed.. Springer-Verlag (1981), 167-183. [67] D.A, Plaisted, Equational reasoning and term rewriting systems. Handbook of Logic in Artificial Intelligence and Logic Programming, Vol. 1, D. Gabbay and J. Siekmann, eds, Oxford University Press (1993), 273-364.
388
J.A. Bergstra et al.
[68] G.D. Plotkin, A structural approach to operational semantics. Report DAIMI FN-19, Computer Science Department, Aarhus University (1981). [69] V.N. Redko, On defining relations for the algebra of regular events, Ukrain. Mat. Zh. 16 (1964), 120-126, in Russian. [70] A. Salomaa, Two complete axiom systems for the algebra of regular events, J. ACM 13 (1) (1966), 158-169. [71] A. Salomaa, Theory of Automata, International Series of Monographs in Pure and Applied Mathematics 100, Pergamon Press (1969). [72] P.M. Sewell, Nonaxiomatisability of equivalences over finite state processes, Ann. Pure Appl. Logic 90 (1/3) (1997), 163-191. [73] D.R. Troeger, Step bisimulation is pomset equivalence on a parallel language without explicit internal choice. Math. Struct. Comput. Sci. 3(1) (1993), 25-62. [74] J.L.M. Vrancken, The algebra of communicating processes with empty process, Theoret. Comput. Sci. 177 (2) (1997), 287-328. [75] H. Zantema, Termination of term rewriting by semantic labelling, Fundamenta Informaticae 24 (1/2) (1995), 89-105. [76] M.B. van der Zwaag, Some verifications in process algebra with iota. Proceedings 3rd Workshop on Formal Methods for Industrial Critical Systems (FMICS'98), Amsterdam, J.F. Groote, S.P. Luttik and J.J. van Wamel, eds, Stichting Mathematisch Centrum (1998), 347-368.
Subject index +,339 $,374 *,335, 345 ±±,341 •,339 5,339 9//, 339 00,35%
(^-completeness, 347 11,339 1L,339 1,339 tJ,374
T,339 T-convergence, 345 T-guarded, 344 T/,339 £,384 abstraction, 339 ACP, 338, 339 action, 338 - communication, 338 - exit, 365 algebra of communicating processes, 338, 339 back and forth operation, 374 binary Kleene star, 345 bisimulation equivalence - (rooted) branching, 344
- (rooted) weak, 344 -strong, 341 bisimulation relation, 341 BKS, 345 BPA, 339 communication - action, 338 - handshaking, 339 - merge, 339 completeness, 342, 346, 347, 358, 361 congruence relation, 342 counter, 377 cycle, 365 deadlock, 339 empty process, 384 encapsulation, 339 equivalence - language, 343 - ready simulation, 343 - simulation, 343 - strong bisimulation, 341 - trace, 343 exit action, 365 fairness, 383 RR, 383 flat iteration, 363
Process algebra with recursive
operations
handshaking, 339 HNF-expansion, 347
- normed, 347 push-down operation, 374
iteration -flat, 363 - muhi-exit, 360 - no-exit, 358 -prefix, 361 - string, 363
ready simulation equivalence, 343 ready simulation relation, 343 recursive specification, 344 - solution of a, 344 recursive specification principle, see RSP regular process, 345 RSP, 345 -RSP'=',374 -RSP^,375 -RSP*, 358 - RSP^, 359 -RSP-,374
KFAR, 383 Kleene star - binary, 345 - unary, 384 labelled transition system, 341 language equivalence, 343 left merge, 339 loop, see cycle LIS, 341 merge, 339 - communication merge, 339 - left merge, 339 multi-exit iteration, 360 nesting operation, 374 no-exit iteration, 358 non-deterministic choice, 339 normed process term, 347 PA, 340 parallel composition, 339 prefix iteration, 361 process term, 339
sequential composition, 339 silent step, 339 simulation equivalence, 343 simulation relation, 343 state, 341 - initial, 341 - proper substate, 343 - substate, 343 - successor of a, 365 string iteration, 363 strong bisimulation equivalence, 341 substate, 343 sum, 339 trace, 343 trace equivalence, 343 transition, 341 - labelled transition system, 341 -rule, 341
389
This Page Intentionally Left Blank
CHAPTER 6
Equivalence and Preorder Checking for Finite-State Systems Ranee Cleaveland^ Oleg Sokolsky^ ' Department of Computer Science, SUNY at Stony Brook, Stony Brook, NY 11794-4400, USA E-mail: [email protected]. edu ^ Department of Computer and Information Science, University of Pennsylvania, Philadelphia, PA 19104-6389, USA E-mail: sokolsky@saul cis. upenn. edu
Contents 1. Introduction 2. Basic definitions 2.1. Labeled transition systems 2.2. Bisimulation equivalence 2.3. Simulation-based refinement orderings 2.4. A parameterized semantic relation 3. Global equivalence algorithms 3.1. A basic partition-refinement algorithm for bisimulation equivalence 3.2. The Paige-Taijan algorithm for bisimulation equivalence 3.3. OBDD-based equivalence checking 3.4. Computing other equivalences via process transformations 3.5. Computing branching bisimulation equivalence 4. Global preorder algorithms 5. Local algorithms 6. Tools 7. Conclusions References Subject index
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
391
393 394 394 395 397 397 398 398 401 403 407 408 411 416 422 423 423 424
392
R. Cleaveland, O. Sokolsky
Abstract This chapter surveys algorithms for computing semantic equivalences and refinement relations, or preorders, over states in finite-state labeled transitions systems. Methods for calculating a general equivalence, namely bisimulation equivalence, and a general preorder are described and shown to be useful as a basis for calculating other semantic relations as well. Two general classes of algorithms are considered: global ones, which require the a priori construction of the state space but are generally more efficient in the asymptotic case, and local, or on-the-fly ones, which avoid the construction of unnecessary states while incurring some additional computational overhead.
Equivalence and preorder checking for finite-state systems
393
1. Introduction Research in process algebra has focused on the use of behavioral relations such as equivalences and refinement orderings as a basis for establishing system correctness (see [16] in this Handbook and [3,2,20,22,23]). In the process-algebraic framework specifications and implementations are both given as terms in the same algebra; the intuition is that a specification describes the desired high-level behavior the system should exhibit, while the implementation details the proposed means for achieving this behavior. One then uses an appropriate equivalence or preorder to establish that the implementation conforms to the specification. In the case of equivalence-based reasoning, conformance means "has the same behavior as"; in this case an implementation is correct if its behavior is indistinguishable from that of the specification. Refinement (or preorder) relations, on the other hand, typically embody a notion of "better than": an implementation conforms to (or refines) a specification if the behavior of the former is "at least as good as" that stipulated by the specification. The benefits of such process-algebraic approaches include the following. • Users need only learn one language in order to write specifications and implementations. • The algebra provides explicit support for compositional specifications and implementations, allowing the specification (implementation) of a system to be built up from the specifications (implementations) of its components. • Specifications include information about what is disallowed as well as what is allowed. Consequently, a number of different process algebras have been studied, and a variety of different equivalences and refinement relations capturing different aspects of behavior have been developed. A hallmark of process-oriented behavioral relations is that they are usually defined with respect to labeled transition systems, which form a semantic model of systems, rather than with respect to a particular syntax of process descriptions. This style of definition permits notions of equivalence and refinement to be applied to any algebra with a semantics given in terms of labeled transition systems. It also means techniques for establishing these relations may be given in terms of labeled transition systems. If, in addition, these labeled transition systems are finitary, then the relations may be calculated in a purely mechanical manner: tools may then be developed for automatically checking that (finitary) implementations conform to (finitary) specifications. This paper surveys algorithms for calculating behavioral relations for a particular class of finitary labeled transition systems, namely, those consisting of a finite number of states and transition labels. We focus on relations that are sensitive only to the degree of nondeterminism systems may exhibit; we do not consider relations sensitive to other aspects of system behavior such as timing, probability, priority, or parallelism. See Chapters 10-13 of this volume, respectively, for a treatment of these features. This decision is due to the fact that models of nondeterminism have a longer history and hence are more settled, and to the fact that techniques for computing these relations find direct application in the computation of the others. The remainder of this chapter has the following structure. The next section introduces the basic definitions and notations used throughout the remainder of the survey. The discussion then breaks into two major parts. Section 3 presents algorithms for calculating behavioral equivalences using partition refinement and symbolic techniques. Section 4 considers an
394
R. Cleaveland, O. Sokolsky
algorithm for behavioral preorders. Section 5 introduces local, or on-the-fly techniques. Local algorithms aim to reduce the amount of work required by avoiding the a priori construction of the entire state space. Section 6 presents some of the tools that implement the algorithms described in this chapter, while Section 7 concludes.
2. Basic definitions This section contains definitions of concepts and notations used in the remainder of the chapter.
2.1. Labeled transition systems Semantically, systems are modeled as labeled transition systems, which may be defined as follows. 2.1. A labeled transition system (LTS) is a triple (5, .4, - ^ ) , where <S is a set of states, ^ is a set of actions, and ^^ c 5 x ^ x 5 is the transition relation.
DEHNITION
Intuitively, an LTS (5, A, -^) defines a computational framework, with S representing the set of states that systems may enter, A the actions systems may engage in, and -> the execution steps system undergo as they perform actions. In what follows we generally write s - ^ s' in lieu of {s, a, s') e^^, and we say that s' is an ^-derivative of ^. We use - ^ * to denote the transitive closure of - ^ . We define a process to be a quadruple (iS, A.^^.si) where (<S, ^ , ^ ) is an LTS and si eS'is the start state. Let («S, A,^) be an LTS, and let 5 € 5 be a state and A € ^ an action. We use the following terminology and notations in what follows. • (5, v4, -») is finite-state if S and A are both finite sets. • s —^ holds if s - ^ s' for some s' € S. • {• - ^ s} C 5 , \hQpreset of s with respect to a, is the set {r G 5 | r - % s). • [s - ^ •} c 5 , the postset of s with respect to «, is the set {r G 5 | ^ - ^ /}. • [s —^} c A, the initial actions of ^, is the set {a G ^ | 5* —>}. • {5 ^- *•} c <S, the reachable set of states from s, is the smallest set satisfying the following: -
^G { 5 - > * • } .
- If r G {^ -> *•} and t -A-1' for some aeA then t' e{s -^ *•}. These notions may be lifted to sets of states by taking unions in the obvious manner. Thus if 5* c 5 then we have the following:
seS
Equivalence and preorder checking for finite-state systems
395
seS seS
The traditional approach to defining the semantics of process algebras involves constructing an LTS in the following manner. Firstly, the syntax of the algebra includes a set A of actions and a set V of process terms. Then a transition relation ^- c p x ^ x 7^ is defined inductively in the SOS style using proof rules [25] (but also see [1] in this Handbook). The structure {V,A,^) constitutes an LTS that in essence encodes all possible behavior of all processes. Of course, this LTS is not usually finite-state, so one may wonder how algorithms for finite-state systems could be used for determining if two process terms in a given algebra are semantically related. The answer lies in the fact that in general, one does not need to consider the entire LTS of the algebra; it typically suffices to consider only the terms reachable from the ones in question. If this reachable set is finite (and typically one may give syntactic characterizations of terms satisfying this property) then one may apply the algorithms presented in this chapter to the LTS induced by the finite set of reachable states. We return to this point later.
2.2. Bisimulation equivalence Bisimulation equivalence is interesting in its own right as a basis for relating processes; it also may be seen as a basis for defining other relations as well. Bisimulation and other behavioral equivalences are treated in more detail in [16] in this Handbook. 2.2 {Bisimulation equivalence). Let (5, A, -^) be an LTS. • A relation /? c 5 x «S is a bisimulation if whenever (^i, ^2) ^ R then the following hold for all a eA: 1. If 51 - ^ s[ then there is an ^2 such that S2 - ^ s'^ and (s[, s'-y) e R. 2. If 52 - ^ ^2 then there is an s\ such that s\ - ^ s[ and {s[ ,s'-y)eR. • Two states s\,S2eS are bisimulation equivalent, written s\ ^ 52, if there exists a bisimulation R such that (s\,S2) e R.
DEHNITION
Intuitively, two states in an LTS are bisimulation equivalent if they can "simulate" each other's transitions. Under this interpretation a bisimulation indicates how transitions from related states may be matched in order to ensure that the "bi-simulation" property holds. Bisimulation equivalence enjoys a number of mathematical properties. Firstly, it is indeed an equivalence relation in that it is reflexive, symmetric and transitive. Secondly, it is itself a bisimulation, and in fact is the largest bisimulation with respect to set containment. Finally, it may be seen as the greatest fixpoint of the following function mapping relations to relations.
396
R. Cleaveland, O. Sokolsky
DEHNITION
2.3. Let £ = (5, ^ , ->) be an LTS. Then Tc • 2^""^ -^ 2*^^^ is given by:
TciR) = {{su S2) I Vfl G A.Ws' e S. {si -^
2.4. LetC= (5, A,->)be R = J=-^(R), R'Z^.
s'=^ 3t' e S.S2 -^
an LTS. Then - = Tc(^),
THEOREM
t' A (S\ t') e R)A
and for any R such that
The proof of this theorem rehes on the Tarski-Knaster fixpoint theorem, which gives characterizations of the fixpoints of monotonic functions over complete lattices. In this case, the complete lattice in question is the set 2*^^*^ of binary relations ordered by set inclusion; in this lattice it is easy to see that J^c is monotonic (the more pairs there are in R, the more pairs there are in Fc(R)), and hence the Tarski-Knaster theorem is applicable. The characterization of bisimulation equivalence in Theorem 2.4 suggests that in order to compute the relation over a given LTS C, it suffices to calculate the greatest fixpoint of Tc' The next result suggests how this might be done for finite-state LTSs. 2.5. An LTS (5, ^ , ^ ) is image-finite if for every ^ G 5 and ^ € ^ , the set [s - ^ •} is finite.
DEHNITION
In other words, an LTS is image-finite if every state has a finite number of outgoing transitions for any given action. Certainly, any finite-state LTS is also image-finite. Now, when an LTS C is image-finite, the function T^ turns out to be continuous, and its greatest fixpoint (i.e., ^) has the following "iterative" characterization. THEOREM 2.6. Let C= {S,A^) the ^i are defined as follows:
be an image-finite LTS. Then -- = fl.^o ^ / ' ^^^^^
^Q = S X S, ^/+i = ^ £ ( - - / )
fori^O.
This characterization provides the basis for the algorithms discussed later in the chapter. Parameterized bisimulation equivalence. We will show that other semantic equivalences may be computed by combining appropriate transformations on labeled transition systems with a bisimulation algorithm. For this purpose, it turns out that a slight modification of the definition of bisimulation equivalence is useful. 2.7. Let (5, ^ , ->) be an LTS, and let £" c 5 x 5 be an equivalence relation. 1. A relation /? c 5 x 5 is an E-bisimulation if /? is a bisimulation and R ^ E. 2. Two states ^ 1 , ^ 2 ^ ^ are E-bisimulation equivalent, written ^i ^ ^ ^2. if there is an £•-bisimulation R with (^1, ^2) ^ ^•
DEHNITION
The relation ~ ^ differs from ^ in that it requires equivalent states to be related by E in addition to satisfying the transition conditions imposed by ~ . It is easy to show that ^
Equivalence and preorder checking for finite-state systems
397
coincides with ^ ^ , where U is the universal relation relating every state to every other state. Theorems 2.4 and 2.6 have obvious analogs for ^^.
2.3. Simulation-based refinement orderings Refinement orderings relate states in an LTS on the basis of the relative "quality" of their behavior. The (forward) simulation ordering represents one such notion that plays an important algorithmic role. Its definition is as follows. DEFINITION 2.8.
Let (5, A, -^)
be an LTS.
• A relation /? c <S x 5 is a forward simulation if whenever {s{,S2) ^ R then the following holds for all a e A. If ^1 - ^ 52 then there is an ^2 such that^2 - ^ -^2 ^^^ {s\,S2Je R. • s\^S2 if there is a forward simulation R such that {s\,S2) e R. Note that ^i £ S2 holds when S2 is able to track, or "simulate", the transitions that s\ is capable of. The relation £ turns out to be a preorder (i.e., reflexive and transitive), and like bisimulation it turns out to be the greatest fixpoint of an appropriately defined function over relations. DEHNITION
2.9. Let C={S,A-^)
be an LTS. Then Gc : 2^^^ -> 2^^^ is defined as
follows gj^(R) = {(51, S2) I Va G ^.V^' G S.{s\ -^S'=^
3t'.S2 -^t'
J\ {s\ t') €/?)}.
That £ is the greatest fixpoint of Qc follows from the same line of reasoning offered for Theorem 2.4. In addition, one may give the following analog of Theorem 2.6, which provides a basis for algorithms presented later in the chapter. 2.10. LetC= (5, A,-^)be the £ . are defined as follows. THEOREM
£,.^1 = £ ? £ ( £ . )
an image-finite LTS. Then £ = fl/^o £ /' ^^^^^
fori^O.
The backward simulation ordering £ is the inverse of £ : ^i £ 5^2 if and only if 52 £ ^i.
2.4. A parameterized semantic relation We close this section with the definition of a parameterized semantic relation that proves useful as a basis for calculating other simulation and bisimulation relations.
398
R. Cleaveland, O. Sokolsky
2.11. Let (5, ^ , ->) be an LTS, let 77 c 5 x 5 be a relation on states, and let 0 1 , 02 ^ <5 X 5 X ^ be relations on states and actions. • A relation /? c 5 x 5 is a (77,
with (^1,52) G R.
The definition of (77, 0 i , 02)-bisimilarity is somewhat complicated. Intuitively, the three parameters have the following roles: • 77 serves as an "initial condition" that related states must satisfy. • 01 and 02 constrain when related states are required to track each others transitions. We denote (77, 0 i , 02)-bisimulation as £ ^ , using the preorder symbol since in general, when 01 7^ 02, it is not an equivalence relation. For example, if we let U be the (overloaded) symbol for the universal relation, then ~ coincides with (U, U, L^)-bisimilarity, while ^^ is (£", U, (/)-bisimilarity. Similarly, £ turns out to be (U, U, 0)-bisimilarity, and 5 (^. ^^ L^)-bisimilarity.
3. Global equivalence algorithms In this section, we present several equivalence-checking algorithms which, given a finitestate LTS {S,A, -^) and an equivalence relation £", iteratively compute the parameterized bisimulation equivalence ^ ^ . Then, the equivalence of two given states can then be tested by checking whether they belong to the same equivalence class. The equivalence relation is represented by the set of equivalence classes, or a partition of the states in the LTS. A partition is a set of blocks {Bi c 5 | 5, fl Bj = 0 , i ^j A IJ/ ^/ = *5}/e/. The algorithms iteratively compute the fixed point of J^c as stipulated by Theorem 2.6. The starting point for the iteration is the partition induced by £. To simplify exposition, the algorithms below are presented for the important special case when E = U.ln this case, the equivalence relation computed is bisimulation equivalence ^ , and the initial partition is {5}. The algorithms discussed in this section differ in the way the partition is represented, and in the data structures used in the fixed-point computation. We first concentrate on the algorithms that represent the partition explicitly, as a set of sets of individual states. Such algorithms are commonly known as partition refinement algorithms. Section 3.3 describes a symbolic approach based on Boolean functions.
3.1. A basic partition-refinement algorithm fi)r bisimulation equivalence The first partition refinement algorithm for bisimulation equivalence is due to Kanellakis and Smolka [21]. Let P = {^i,..., Bn) be a partition consisting of a set of blocks. The
399
Equivalence and preorder checking for finite-state systems B
Bj
logQQOQl a
i
a
poo
a\a\^
P a
0 0 00
B2
\Q9Q\ ^
a
y
a
QOQI a\fl
poo
\, tz
00
9
a\
a
00
S' Fig. 1. Splitting a block in the partition.
split{B, a, P) -> {[Bi] a set of blocks) choose s e B {* Bi contains states equivalent to 5 *} ^1 = 0 {* Bi contains states inequivalent to 5 *} ^2 = 0 f o r e a c h 5' G 5 d o begin it[{s-^.]]p^[{s' ^^.]]p t h e n ^ l =Bi \J[s'] QlseBi^Bi^W] end itB2 = ^ t h e n r e t u r n {5]} e l s e r e t u r n {^1, iB2} Fig. 2. The pseudo-code for procedure split.
algorithm is based around the notion of splitting. A splitter for a block B G P is the block B' e P such that some states in B have a-transitions, for some a e A, into B^ and others do not. In this case, B can be split by B' with respect to a into blocks B\ ={s e B \3s' e B\s - % 5'}, B2 = B - B\. Splitting is illustrated in Figure 1. The algorithm uses splitting in the form of procedure split{B,a, P), which detects whether the partition P contains a splitter for a given block B e P with respect to action a ^A.lf such splitter exists, split returns the blocks ^i and Bi that result from the split. Otherwise, B itself is returned. Efficient implementation of split is critical to the overall complexity of the algorithm. Therefore, we will discuss in more detail the implementation of split and the data structures necessary to make it efficient. In presenting the procedure split we use the following notation: for a set of states 5, [S]p = {B e P \3s e S .s e B} isiht minimal set of blocks in P that contain all states in S. Then, [{s - ^ •}]p is the set of blocks that can be reached from s by an ^-transition. We will abuse terminology and call this set thepostset ofs in P with respect to a. Figure 2 gives the pseudo-code for procedure split. The procedure chooses a state from B and compares its postset in P to the postsets in P of other states in B. Clearly, if the postsets of two states are different, then there exists a splitter that will put these states in different blocks.
400
R. Cleaveland, O. Sokolsky P ••= {S}
changed := true
while changed do begin changed :=false
for each B e P do begin for each a € ^ do begin SortTransitions(a, B) if splitiB, a, P)^{B}
then begin P:=P-[B}Usplit(B,a,P) changed := true
break end end end end Fig. 3. Algorithm KS_PARTlTIONING.
In order to compare the postsets of the states of B efficiently, we need to order the transitions of ^. For this purpose, we impose an ordering on the blocks of P. The transitions of 5^ are lexicographically ordered by their labels. Further, for each label a, the transitions are ordered by the containing block of the target state of the transition. When a block is split, the ordering of transitions in states that have transitions into that block can be violated. Therefore, one needs to sort the «-transitions of all states of a block immediately before attempting to split the block. Procedure SortTransitions{a, B) uses lexicographic sorting to reorder the a-transitions of block B. Finally, we present the main loop of KS_PARTITIONING in Figure 3. The algorithm iteratively attempts splitting of every block in P with respect to every a e A until no more blocks can be split. Correctness of KSJPARTITIONING relies on the fact that when changed i^ false, there is no splitter for any of the blocks in P. Therefore, P = TciP) and, by Theorem 2.4, R C. ^. Moreover, if we denote by P/ the partition after /th iteration of the main loop of KS_PARTITIONING, we have ^ c -^, c P,. Thus we have that at termination of the algorithm, P = ^. The complexity of KS_PARTITIONING is given by the following theorem. THEOREM 3.1. Given a finite-state ITS (*S, A, ->) with \S\ = n and |-> | = m, algorithm KS_PARTITIONING takes 0(n • m) time.
The main loop of the algorithm is repeated at most n times. Within one iteration of the main loop, procedure split is called for each block at most once for each action a. PROOF.
Equivalence and preorder checking for finite-state systems
401
In turn, split considers each transition of every state in the block at most once. Therefore, the calls to split within one iteration of the main loop take 0(m) time. The calls to SortTransitions collectively take 0 ( | ^ | + m) time, or 0(m) when the set of labels is bounded by a constant. D
3.2. The Paige-Tarjan algorithm for bisimulation equivalence Performance of the basic partition refinement algorithm can be significantly improved through the use of more complex data structures. Paige and Tarjan [24] proposed an algorithm that utilizes information about previous splits to make future splits more efficient. To simplify the presentation of the algorithm, we describe the case where the alphabet of the LTS is a singleton. An extension of the algorithm to handle multiple actions is straightforward. First, we introduce the notion of stability of blocks and partitions. DEnNiTiON3.2. • A block B is stable with respect to a block S if either B C { « - > 5 } o r 5 n { « - > 5 } = 0. • A partition P is stable with respect to a block S if every B € P is stable with respect to 5. • A partition P is stable with respect to partition Q if P is stable with respect to every SeQ. • A partition is stable if it is stable with respect to itself. Clearly, ^ is the coarsest stable partition. The Paige-Tarjan algorithm is based on the following observation. Let B be stable with respect to S, and let S be partitioned into 5*1 and Sj- Then, if B 0 S = 0, B is stable with respect to both 5*1 and 5*2. Otherwise, B can be split into three blocks: ^1 = ^ - { • ^ 5 2 } , ^12 = B n { « - ^ 5 i } n { # - > 5 2 } , Bi =
B-{.-^Si}.
This three-way splitting is illustrated in Figure 4. The improvement in complexity that the Paige-Tarjan algorithm provides over the basic partition refinement algorithm of the previous section stems from the fact that threeway splitting can be performed in time proportional to the size of the smaller of the two blocks S\, 5*2. To do so, with every state s eS and for every block 5, we keep a variable count(s, S) = \{s' e S \ s - ^ } . Now, we can decide in constant time to which of the subblocks of 5 a state s e B belongs. We have three cases: (1) if count(s, S\) = count(s, 5), then 5 G ^ i ; (2) if 0 < count(s, S\) < count(s, 5), then s e B\2; 0) if count(s, ^i) = 0, then^ e Bi. In addition to maintaining the count variables, we have to store the information about the history of prior splits. If a block has been used as a splitter, it is stable with respect to a partition. If such a block has been split itself, the smaller of its sub-blocks can be used in three-way splitting. We use an additional data structure to store split history: X is
402
R. Cleaveland, O. Sokolsky
Fig. 4. Efficient splitting of a block. P '•= [S] X:=P while X7«^0 do begin choose S e X X:=X-S {* choose splitter *} i f 5 is compound t h e n begin Sp := the smaller of the children of S {* compound children of S stay in X *} X := XU compound(S) end else Sp'=S for each B e [m-^ Sp) do begin P' =split{B,Sp) update X{B,P') end end Fig. 5. Algorithm PT_PARTITIONING.
a forest of binary trees. Each node in a tree is a block satisfying the following conditions: • For each leaf block B, B e P. • Each non-leaf block is the union of its children. • For each root block B, P is stable with respect to B. Roots of the trees are used as splitters for the current partition until X is empty. A splitter is called compound if it is the root of a non-trivial tree; otherwise it is called simple. For a compound splitter 5, compound(S) is the set of the non-trivial subtrees rooted at the children of S. The algorithm, called PT_PARTITIONING, is shown in Figure 5. It repeatedly chooses a splitter Sp from X. A compound splitter is chosen if one exists. Then, every block B e P
403
Equivalence and preorder checking for finite-state systems I'B2}
P'={B 1,8,2,82}
8
Bj
8,
I
^
8,
Bn
8,
Fig. 6. Splitting a block.
that has transitions into Sp is split with respect to the chosen sphtter. We use the notation 5 G {• -> Sp} to mean [B e P \3s e B .s -^ s' A s' e Sp). The operation is denoted split{B, Sp). The result is a set of blocks P' containing one, two, or three blocks, depending on how B was split. By Sp' we denote P' represented as a tree. The shape of Sp' is given in Figure 6. Operation split{B, Sp) also updates the variables count{s, S) for all s e B.To do this, split scans the set {• -> S] twice. On the first pass, counts are computed, and splitting itself is done on the second pass. When P' is a singleton, no splitting has occurred and no further work is necessary. Otherwise, X needs to be updated to reflect the splitting of B. Three cases are possible: 1. 5 is a simple splitter in X. In this case, B is removed from X and all elements of P' are added to X as simple splitters. 2. B is a leaf in one of the trees in X. The tree is extended at B with Sp'. 3. B does not appear in any tree in X. Sp' is added to X as a new tree. The three cases are illustrated in Figure 7. We denote by update X(B, P') the operation of updating X as just described. Correctness of PT_PARTITIONING is established by means of the following invariant. For 5 G P, if 5 is not a simple sphtter in X and B is not a leaf of a compound splitter in X, then P is stable with respect to B. Indeed, every newly split block is placed in one of the trees in X, and it remains there until it is used in splitting. At every iteration of the outer loop of the algorithm, at most two blocks are removed from X: the one used as a splitter in that iteration, and the sibling of the splitter, if one exists. After the iteration is complete, P is stable with respect to both blocks. Subsequent refinements do not alter stabiUty with respect to a block: if P is stable with respect to a block B and P' is a refinement of P, then P^ is stable with respect to B. Therefore, when X is empty, P is stable with respect to itself. The worst-case running time of PT_PARTITIONING is 0(m • log2 n). For each state in a splitter Sp, the algorithm visits every incoming edge twice, performing 0(1) work for each edge. Because the smaller of the two sub-nodes of a compound splitter is used, each state can appear in at most log2 n -h 1 splitters. 3.3. OBDD-based equivalence checking A major drawback of the algorithms presented in the preceding sections is that they require the LTS to be fully constructed in advance. When a process term is constructed from
404
R. Cleaveland, O. Sokolsky case 1
^
case 2
^
case 3
»
Fig. 7. Updating the splitters.
n subprocesses by parallel composition, the size of the resulting LTS may grow exponentially large in n, rendering equivalence checking infeasible. Several approaches have been proposed to alleviate this problem. A group of algorithms called "local", which construct only as much of the LTS as needed to determine equivalence (or inequivalence), will be introduced later in this chapter. This section is concerned with a different approach, one that uses ordered binary decision diagrams (OBDDs) to succinctly represent the LTS. OBDDs [6] are widely used in symbolic analysis algorithms such as model checking. We present an OBDD-based bisimulation checking algorithm based on the one by Bouali and de Simone [4]. An OBDD is a representation of a Boolean function by a rooted acyclic directed graph with respect to a fixed variable ordering. Terminal nodes of the graph are labeled with Boolean constants, non-terminal nodes are labeled with input variables. Each non-terminal node has two outgoing edges for the two possible values of the variable labeling the node, indicating which node is evaluated next. Every path from the root of the OBDD to a terminal node has to respect the ordering of variables. In addition, an OBDD does not contain duplicate terminals or non-terminals, nor redundant tests (i.e., nodes with both outgoing edges leading to the same node). Figure 8 shows the OBDD for the function {x\ v ^2) A X3 with the ordering x\ <X2 <x^. For a fixed variable ordering, OBDDs offer a canonical representation of Boolean functions; that is, two OBDDs representing the same function are isomorphic. Commonly used
Equivalence and preorder checking for finite-state systems
405
true branch false branch
Fig. 8. An example OBDD.
operations on Boolean functions, such as Boolean operations, functional composition, and variable quantification can be computed with OBDDs in time polynomial in the size of the OBDD representations for the component functions. The size of the OBDD for a Boolean function depends on the chosen variable ordering. In the worst case, the size is exponential in the number of variables. Still, many functions have much more compact representations. For a detailed discussion of OBDD properties we refer the reader to [7]. The OBDD representation of an ITS. An LTS (5, ^ , -^ > is represented by OBDDs in the following way. The states of the LTS are represented by an encoding of their enumeration, that is, by means of a function a :«S -> {0, 1}^ that associates with each state a distinct Boolean vector. Thus, representation of n states in an LTS requires k = log2 n Boolean variables. We let ? represent the encoding of a state s. The alphabet of the LTS is encoded in the same way, and a is the encoding of a label a. States(x) is the characteristic function of the set of states in the LTS. The transition relation of an LTS is represented by a characteristic function 8(a,s, s^), which returns true when s —^ s'. Since all Boolean functions considered in this section operate on encodings of state, labels, etc., and not on the objects themselves, we will use x for (x) where no confusion can arise. Symbolic computation of the bisimulation equivalence. Like the algorithms presented previously, the algorithm for symbolic bisimulation checking is based on the characterization of Theorem 2.6. In order to compute the iterative fixed point symbolically, we need to express the function Tc in terms of efficient OBDD operations. First, we introduce several auxiliary operations on Boolean functions. A restriction of function / with respect to variable jc is f\x^k{x\,.. .,x,.. .,Xu) = f(x\,...,/:,... ,x„). The smoothing operator is defined by 5v(/) = /l.v^o v flx^i- We have S^if) = 3x / . The smoothing operator is extended to sets of variables in the obvious way. Substitution of a vector X = {jci,..., jc„} by a vector F = {yi,..., y„} within the OBDD for the function / is the simultaneous replacement of variables from X by respective variables from Y. Substitution is defined as [Y ^
X]f
(yi <-> xi) A /
406
R. Cleaveland, O. Sokolsky R(x, y) := Statesix) A States(y) New(x, y) := R(x, y) w h i l e New(x, y) ^false do
begin /?+U,>'):=J^£(/?) Newix, y) := /?+(JC, >') A /?(jc, y) R{x,y):=R-^(x,y) end Fig. 9. Symbolic computation of bisimulation.
With these definitions, we can give the definition of J^c^R) suitable for symbohc computation. We represent R as the characteristic function of the Cartesian product of the equivalence classes of /?, denoted R{x, y). R{x, y) returns true if x and y belong to the same equivalence class. An auxiliary function
Ea{x,z) =
Sy[R{x,y)A6{a,z.y))
represents the relationship "z has an a-transition into the equivalence class oi x'\ With this function, we can express the relationship that two states cannot be in the same equivalence class:
Bad{x^y) = [x^z](\J
S,{[y^z]Ea{xa)^Ea{x^z))\.
Finally, we have
Tc{R)^R(x,y)r^Bad{x,y^. Note that the use of substitutions in the definition of Bad{x, y) allows us to construct Ea once per the appUcation of Tc- Construction of Ea, which computes the inverse of the transition relation of the LTS, is a much more expensive operation than substitution. The algorithm to compute the bisimulation equivalence symbolically, shown in Figure 9, is now a straightforward iterative fixed point computation that applies Tc to the current partition in each iteration. Initially, /? = «S x <S or, in a functional representation, R(x,y) = States{x) A Statesiy). Performance issues. The time and space efficiency of the OBDD-based algorithm depend on the OBDD variable ordering and certain details of the LTS encoding. Significant performance improvements can be achieved in the case when the LTS under consideration is obtained as a product of several communicating processes. Then, in addition to representing and manipulating the global LTS, we need to represent the LTSs of the components, which we refer to as local LTSs, and compute the global LTS from the local LTSs symbolically.
Equivalence and preorder checking for finite-state systems
407
States in the global LTS are represented as tuples of local states. There are two natural ways to order the variables used in the representation of local states. One ordering groups together all variables representing a state in a local LTS and uses the order of local states in the tuple to separate the states from different local LTSs. The other ordering groups local states together bit by bit. That is, the ordering places the first bit of the encodings of all local states before the second bit, etc. Experimental results presented in [4] suggest that the former ordering yields more compact representation during the initial stages of the algorithm, when the equivalence relation is coarse. When there are many equivalence classes, the latter ordering is a better choice. Dynamic reordering of variables may allow one to take advantage of both orderings. In addition, the order of local states within global state tuples has its effect on the size of OBDDs. As a rule of thumb, it is advantageous to group together the processes that actively communicate with each other. For example, let the global process be composed of three local processes, p\, P2, P3' Assume that p\ communicates with both p2 and /73, but there is little or no communication between p2 and p^. Then, the optimal order of local processes is to place pi in the middle, for example {p2, p\, p?,)-
3.4. Computing other equivalences via process transformations The algorithms presented above can be used to decide several other behavioral equivalences in addition to bisimulation equivalence. Examples of equivalences that can be decided by partition refinement include weak bisimulation [23] and testing equivalence [19]. In order to obtain a partition refinement algorithm for an equivalence relation /?, we need to define a suitable process transformation TR and an equivalence relation ER that will be used by the algorithm. Given an LTS £ = (5, ^ , ->), a process transformation is a function TR{C) =
{S\M.W)
from the set of LTSs to itself. Abusing notation, we will also use TR to denote a mapping from S to S' that relates the states of P and TR{C). A process transformation can be used to decide an equivalence relation R if there is an equivalence relation ER such that the following condition holds: siRs2
iff
TR(SI)^^'TR(S2).
In this case, we can construct TR(C) and then apply an equivalence-checking algorithm to compute'^^^. Weak bisimulation equivalence. As an example of process transformation, we present 7^ that is used to decide ^ , weak bisimulation equivalence or observational equivalence. Weak bisimulation equivalence abstracts away from the special unobservable action T eA by allowing transitions to be matched by sequences of transitions having the same observable (non-r) content.
408 DEFINITION 3.3.
R. Cleaveland, O. Sokolsky Let (5, ^ , ->) be an LTS.
• A symmetric relation /? c 5 x «S is a weak bisimulation if whenever {s\,S2) ^ R and ^1 - ^ ^5 ^^^^ ^^^ of the following holds: - a = T and there is an Sj such that ^2 —^ ""A and (5J, 4 ) ^ ^ ' ^'" - there is an Sj such that ^2 —^ * - ^ —^ *'y2 ^^^ ('^1»-^2) ^ ^• • Two states ^1,52 € 5 are weak bisimulation equivalent, written ^i ^ 52, if there exists a weak bisimulation R such that (^1, ^2) ^ ^• The transformation used to decide weak bisimulation is 7^((5, ^ , - > ) ) = (5, .4 ~ {r} U e, =^). The weak transition relation =^ is defined as follows: • s =^ s' when s - ^ *5'; • iov a^T.s = ^ s' when s —^ *—^ —^ *5^ We compute =^ in two steps. First, = ^ is constructed by applying a transitive-closure algorithm to the r-transitions of the original LTS. Then, the composition of relations ^=> and -^,a ^ s, produces all observable weak transitions. Weak bisimulation equivalence can now be computed as L^-bisimulation over 7i((<S, A, ->)). The correctness of this approach follows directly from Definition 3.3 and the construction of =>. Other equivalences. Several other process transformations for equivalence checking have been presented in the literature. In particular, observational congruence [23] is computed as f/-bisimulation over congruence transition systems (see [11] for details). Testing equivalence [19] can also be computed by process transformation. It turns out to be an ^-bisimulation over acceptance graphs. Both the process transformation and the acceptance set equivalence A are described in [10].
3.5» Computing branching bisimulation equivalence Branching bisimulation equivalence, introduced by [17], is similar to weak bisimulation equivalence in the sense that it abstracts away from the unobservable action r. However, branching bisimulation equivalence preserves the branching structure of processes; that is, the non-deterministic choices are resolved by the equivalent processes in the same order. Consequently, branching bisimulation equivalence is finer than weak bisimulation equivalence and possesses an appealing set of algebraic properties. Despite its close relation to bisimulation equivalence, branching bisimulation equivalence requires a modification of the partition refinement algorithm. The extended algorithm BB^PARTITIONING has been presented by Groote and Vaandrager [18]. DEFINITION 3.4.
Let {S, A -^) be an LTS.
• A symmetric relation R C.S x S is a. branching bisimulation if whenever (s\,S2) € R and ^1 —^ s[ then one of the following holds: - a = r and {s[, S2) e R, or - there exist S2, 4 ' such that 52 —^ *^2 ~ ^ ^'2 ^^^ ^"^i' 4 ^ ^ ^'
Equivalence and preorder checking for finite-state systems
409
• Two states s\,S2eS dirt branching bisimilar, written s\ ±±S2, if there exists a branching bisimulation R such that {s\,S2) e R, Before presenting the algorithm, we introduce some additional terminology. Given a partition P, a transition s —^ s' is called P-inert ii s and s' belong to the same block in P. A bottom state ^ in a block B is such that for all outgoing transitions oi s, s —^ s' =» s' iB. We will assume that the LTS does not contain cycles of unobservable events. This assumption is not a restriction. Indeed, if s —^ *s' and s' —^ 5, then s^t±s'. Then, states strongly connected by unobservable transitions will always be within the same equivalence class, and we can collapse them into the same state before the algorithm is run. A new notion of splitter is taken directly from Definition 3.4. For B, B' e P and a eA, let reacha {B, B') = {seB\3n^ SQ^S
OBSQ,
. . . , ^„ € B3s' e B'.
/\ (VO < / ^ n.Si-\ — ^ Si) A (Su - ^
S W {a = T ASn=
s'))
}.
A block B' is an ^-splitter for 5 if 0 ^ reacha(B, B') 7^ B. A partition refinement algorithm that uses this definition of splitter directly would be impractical. It would have to maintain information about sequences of inert r-transitions in each block and update this information as blocks are split. Instead, a different characterization of spHtter is used, as stipulated by the following theorem. THEOREM 3.5. Let P be a partition ofS, B, B' e P, and a e A. Then, B' is an a-splitter ofBif (1) a^r orB:^B\ (2) There exists s e B such that for some s e B', s —% s', (3) There exists a bottom state s e B such that for no s' e B', s ~% s'.
Suppose 5 ' is an a-sphtter of B. If ^ = r, then clearly B ^ B\ since reachr(B, B') is trivially equal to B, satisfying the first condition. By definition of a splitter, reachj{B, B^) ^ 0, which means that condition (2) holds. Finally, assume that for every bottom state s e B there is an a-transition into B'. Choose an arbitrary state t e B. Since there are no r-cycles in the LTS, then there is a (possibly trivial) r-path from t to a bottom state s. This means that / e reacha(B, B'). Since t was chosen arbitrarily, reacha(B, B') = B, which is a contradiction, and condition (3) holds. For the reverse direction, reacha(B, B') 7^ 0 because of condition (2), and reacha(B, B') i^ B because of conditions (1) and (3). D PROOF.
This characterization of a splitter allows us to find splitters in P efficiently. To do this, we need the following data structures. For each block B, we keep two lists of states. One list holds bottom states of the block, the other holds non-bottom ones. Moreover, we assume that non-bottom states are topologically sorted according to r-transitions. That is.
410
R. Cleaveland, O. Sokolsky s e l e c t 5 € working pre = 0 for e a c h a € ^ d o begin f o r e a c h a-transition t 6 in{S) do setMarks{t) f o r e a c h B G pre do i f 5 is a splitter of B t h e n begin remove B from its list changed := split(B, Bx^Bj) add B\, B2 to working i f changed t h e n append 5/0/?/^ to working end end working := working — [S] stable := stable U {S} Fig. 10. Refinement step of BB_PARTITIONING.
if 5 —^ 5', then s^ precedes s in the list of non-bottom states. This ordering is always well-defined since there are no r-cycles. Each non-bottom state s contains a list of inert transitions inert{s) originating in this state. Each block B, in addition to the lists of states, contains a list in{B) of non-inert transitions that end in B. Non-inert transitions are lexicographically sorted by their label. Every state s e S has a Boolean variable mark(s), initialized to false. Blocks of P are stored in two disjoint lists, stable and working. P is stable with respect to blocks in the first list; blocks in the second list can be splitters. When working becomes empty, the partition is stable and the algorithm terminates. The pseudo-code of the refinement step is shown in Figure 10, where pre is the set of blocks that have a transition into B. Procedure setMarks accomplishes two things: (1) if s is the source state of transition r, set mark(s) to true; (2) add the block to which s belongs to pre. For each B e pre, S is not a splitter if all bottom states of B are marked. If there are unmarked bottom states in B, procedure split(B, B\, B2) partitions B into two blocks 5 i , ^2 in the following way. First, marked bottom states of B become bottom states of B\ and unmarked states become bottom states of B2. Next, non-bottom states of B are scanned. If a state s is unmarked and does not have an outgoing transition that leads to a state in B\, then s becomes a non-bottom state of B2. AH transitions in inert(s) must lead to a state in B2 and thus no adjustment of inert(s) is needed. Here, the ordering of the nonbottom states is important (note that the ordering is preserved by splitting). Otherwise, s is placed in B\. Its inert transitions are scanned and, if a transition leads to a state in B2, it is removed from inert(s) and placed into in(B2). If inert(s) becomes empty, s is placed into the list of bottom states of B\. Otherwise, it remains a non-bottom states of B\. As each
Equivalence and preorder checking for finite-state systems
411
state is moved from B to its new block, its mark is cleared. Finally, in{B) is distributed to in{B\) and in(B2) according to the target state of each transition. Procedure split returns a Boolean value, which is true if the set of bottom states changed. It can be easily seen that, unless the set of bottom states in a partition has changed, stability of a block is preserved after refinement. Otherwise, every block in stable has to be considered as a splitter again. Thus, if split returns true, the contents of stable are moved to working. THEOREM 3.6. Given a finite-state ITS («S, A, -^) with \S\ = n and \-^\=m, BB_PARTITIONING computes the stable partition in 0(\A\ -f m • n) time.
algorithm
PROOF. Initialization of the data structures in the algorithm is accomplished in 0(|.4| -f m) time. This includes the computation of strongly connected components of S and topological sorting of inert transitions in each block of the initial partition. Both can be accomplished in 0(m) time. Lexicographic sorting of non-inert transitions takes 0 ( | A | -fm) time. There can be at most n ~ I refinement steps, each of which takes 0(m) time. D
4. Global preorder algorithms In this section we present an efficient algorithm to compute the parameterized semantic relations £ J^ ^^ introduced in Section 2.4. The algorithm is due to Celikkan and Cleaveland [9]. We first introduce an auxiliary function on relations similar to the one given in Definition 2.3. 4.1. Let £ = (5, A,-^) be an LTS and /? c 5 x 5 be a relation between states. Then j ^ ^ : 2'^''*^ -^ l^""^ is given by:
DEHNITION
T^(R) =
{{p,q)\pnqA'^aeA. {/7, q, a)e0i^[p^^p'^
3q\ q-^
q'A {p\ q') € /?] A
(/7, q^a)e(p2=^[q^^q^
V - P ^^ P ^ [P ^ Q) ^ ^] }•
Note that relation /? is a {/7, ^ i , 02>-bisimulation ijf R ^ J^^(R)- Correspondingly, if R - T^{R) 7^ 0 then R is not a (77, 0\, 02)-bisimulation. It is easy to see that the algorithm EFFJ'REORDER in Figure 11 computes £^^ ^^ over SxS. In order to efficiently implement this algorithm, one'must maintain the value of ToDelete = R — T^ (/?), as removing an element from R may change the value of T^ (R). Now from the definition of J^^ it follows that if {p,q) e R-T^ (R) then one of the three conditions below must hold. 1. {p.q)^n; 2. (/7, q, a) €01 A 3p\ p - ^ p' A ^q'.{q - ^ q'^ 3. {p^q.a) € 02 A 3q'. q ^^ q' A Sp'ip - ^ p ^
{p\ q') i R)\ {p\ q) i R)-
412
R. Cleaveland, O. Sokolsky R:=SxS; ToDelete:=R-T^(R) while ToDelete =?^ 0 do begin Choose {p,q) e ToDelete; R:=R-l{p,q)]; ToDelete \=R-r^{R)\ end; Fig. 11. Algorithm EFF-PREORDER for computing the £ ^
To understand how we may exploit these conditions, suppose that {/?, q) e R, (p, q,a) e 0\, and p has an ^-derivative p' such that (p\ q') for only one a-derivative q' oiq. Now if (Z?',^'} is removed from/?, it follows that (p,<7) ^ J'^C/?) and hence (p,^) € R-T^(R). Thus {/7, q) must be removed from R, as R cannot be a bisimulation if (/?, q) e R. This suggests that if we know how many a-derivatives of q that p' is related to, then when this number reaches 0 we can remove pairs involving q and states (like p) having rni atransition into p\ To record this information, EFFJ^REORDER maintains two arrays of counters. We describe these in turn. • HighCount{a, p\q) is the number of «-derivatives of the state q that are "higher" than p'• LowCount(a, p, q') is the number of ^-derivatives of the state p that are "lower" than q'. Formally they are defined as follows. HighCount{a, p\ q) = \{q'\q-^
q /\ {p\ ^') ^ ^} |.
LowCount{a, p,q') =.\[p'\ p-^
p' A {p\ q') e R}\.
The task of implementing EFFJ^REORDER can now be divided into an initialization phase and an iteration phase. The former involves the computation of the initial value of R, ToDelete, HighCount and LowCount. The initialization code is given in Figure 12. Note that HighCount(a, p\ q) is set to the number of ^-derivatives of q since we are assuming that all states are related (that is, we start with the coarsest partition), and similarly for LowCount. The set R holds the intermediate approximations to the preorder, and it will contain the desired preorder upon termination of the algorithm. After the initialization phase, the algorithm repeatedly removes elements from ToDelete, deletes them from R, and incrementally updates ToDelete = R - T^ (R) using the counters HighCount and LowCount. (As a practical matter, note that when an element is added to ToDelete, one may immediately remove it from R without affecting the correctness of the algorithm.) These counter values determine when a pair of states is not an element of ^ £ (/?) and thus should be added to ToDelete for eventual removal from R. The algorithm terminates when ToDelete = 0, in which case R = T^{R) and R is therefore the largest (77, (P\, ^2)-bisimulation on S. Figures 13 and 14 illustrate how HighCount counters are used during the algorithm. A HighCount(a, p',q) value of 0 means that there is
Equivalence and preorder checking for finite-state systems ToDelete:={{p,q) R:=SxS;
413
\ p f7q}\
f o r e a c h (p,q) e R do b e g i n f o r e a c h a e ({/?-%}U {(jr-%}) do b e g i n HighCountia, p,q) = \{q' \ q - ^ q'}\; LowCount(a, p, q) = \{p' \ p —> p^]\; {*Ifq does not have an a-transition, pair {p,q) is inserted into ToDelete. *} i f HighCount(a, p,q) =0 and {p, q, a) €
Before
u-^' a\ /
After
'i ^
HighCount(a,p'.q)=l
p' ^ [^
.!. . . -"> \
/a
} J
HighCounl(a.p',q) = 0
t
Fig. 13. Illustration of the main loop where HighCount value is 1.
Before
HighCount(a,p',q) = 2
After
HJghCount(a,p',q) = 1
Fig. 14. Dlustration of the main loop where HighCount value is greater than 1.
414
R. Cleaveland, O. Sokolsky w h i l e ToDelete^&do begin Choose{p', q') e ToDelete;
R:=R-[(p',q')y, /* First condition */ f o r e a c h a e {—% q') do b e g i n f o r e a c h qe{m -^ q] such that {p, q, a) e 0\ do b e g i n HighCount(a, p',q) := HighCount(a, p\q) — I; i f HighCount(a, p\ q) =0 t h e n b e g i n f o r e a c h p € {• - ^ /?'} do if {p,q) e R and {p, q) ^ ToDelete t h e n ToDelete := ToDelete U{{p,q)}', end; end; end; /* Second condition */ f o r e a c h a € {—%• p'} do b e g i n f o r e a c h p e {• - ^ p'] such that {p, q, a) e 02 <^o b e g i n LowCount(a, p, q') := LowCount(a, p,q') — 1; if. LowCount{a, p,q') = Othen begin f o r e a c h ^ G {• —> q'] do if {p,q) e R and (/?, ^) ^ ToDelete t h e n ToDelete := ToDelete U{{p,q)]; end; end; end; ToDelete := ToDelete - {{p\ q')]\ end Fig. 15. Main loop of algorithm EFFJPREORDER.
no a-derivative of q related to p'\ thus all pairs {/?, q) such that p - ^ /?' should be inserted into the set ToDelete. Note that the insertion of a pair {/?, q) into the set ToDelete is guarded by the predicates
4.2. The code given in Figure 12 takes 0(t[n\i + |tS| x |£|) time.
PROOF. Initialization of ToDelete and R takes 0(rinit + \S\^) time units. The nested "foreach" loops require 0 ( | 5 | x |£|) set membership operations. This follows from the fact
Equivalence and preorder checking for finite-state systems
415
that
EE
E
O(1)<X:EH^-^>I + II^-^H
^EEIw-^}| + EEH/'-^H peSqeS
peSqeS
^ Ei-^i+Ei^i peS
qeS
^ 0 ( | 5 | x | £ | + |5|x|L|) and checking predicates 0\ and 02 may be done in constant time after initiaUzing them properly. Then the total amount of time spent is 0(rinit -f \S\^ + |«S| x |£|). This reduces toO(finit+|5|x|/:|). D THEOREM
4.3. The code given in Figure 15 takes 0 ( | 5 | - + | 5 | x \C\) time.
PROOF. Wefirstnote that in the worst case, the outer loop executes at most 0(|«S|") times. Let T\ represent the total amount of time spent executing the first "f o r e a c h " loop over all iterations of the outermost "while*' loop and T2 represent the time spent in the second "f o r e a c h ' ' loop. T\ may be further decomposed into:
T\ = Ti-\-Tr, where 7] represents the total amount of time spend in the innermost "f o r e a c h /? 6 {• - ^ p'} do b e g i n " loop and Tr represents the time spent in the rest of the loop (e.g., in decrementing HighCount{a, p,q') and performing the test in the i f - t h e n statement). From the structure of the loops, we have the following
^^= E
E
E oa)=EE E
E o^^)
= 5]0{|£|) = 0(|5|x|£|). p'eS
Regarding T/, first note that for any a, p' and q, HighCount(a, p\ q) has its value changed to zero at most once. Thus the total amount of time spent in the innermost loop is:
Ti=
Y.
E o(i)=E
E
E o(i)
= ^ 0 ( | £ | ) = 0(|5|x|£|). qeS
Thus T\ = 0(|iS| X |£|). Using a similar argument, we may also infer that Tj = 0 ( | 5 | X |£|), and the theorem then follows. D
416
R. Cleaveland, O. Sokolsky
Note that the time spent in the initialization phase of this algorithm asymptotically dominates the time devoted to the second phase. We thus have the following. THEOREM 4.4. Given a finite-state LTS {S, A, ->) with \S\ = n and |-> | = m, algorithm EFFJ'REORDER takes 0(finit + \S\ x \C\) time.
Speeding up the algorithm. In general, when computing £ 0 , ^^ ^^ ^ ^ ^" ^^^^ really interested in whether the two given states, p and q, are related. If they are found not to be, then it is possible to terminate the algorithm immediately. Therefore if p ^^^ 0^q, then we would like to determine this as quickly as possible. This immediately suggests an optimization: if (/?, q) is ever inserted into ToDelete then the algorithm can terminate. Another heuristic for early termination involves processing elements in ToDelete in a particular order. Note that when (p\ q') ^ ToDelete is processed, it may induce the removal of {p,q) from /?, where p - ^ p' and q - ^ q'. Therefore while processing the pairs in ToDelete, the pair that is "closest" to the pair (/?, q) that we are interested in will be the most promising candidate to process. Formally, define l{p') to be the length of the shortest path from p to p', and l{q') to be the length of the shortest path from q to q'. Also let h{p\ q') = l{p') + l{q'). Then among the pairs in ToDelete the pair that minimizes h{p\ q') should be chosen for processing. Another way to speed up the algorithm is to avoid entirely the corresponding loops when either 0\ or ^2 is empty. If one of these relations is empty there is no need check the condition involving this relation, since that condition is trivially satisfied. 5. Local algorithms Algorithms for computing semantic equivalences and refinement replations usually consist of two steps [11]. In the first, the state space is generated and stored (possibly symbolically), while the second then manipulates the state space to determine whether an appropriate relation exists. The algorithms presented in the previous sections are examples of such "global'' algorithms. Global algorithms often perform poorly in practice because of the requirement that the state space be generated in advance. In particular, in many cases, one may be able to determine that one process fails to be related to another by examining only a fraction of the state space. In a design setting where one is repeatedly changing a design and checking it against a specification, one would like a verification algorithm exploiting this fact. On-the-fly verification algorithms combine the checking of a system's correctness with the generation of the system's state space [13]. In this section we present the efficient onthe-fly preorder-checking algorithm proposed in [8]. To determine whether two states po, qo are related, the algorithm attempts to construct a relation relating the states of the LTS incrementally starting with the pair (po.qo)- In order to achieve the desired complexity we represent the relation being built as an edge-labeled graph whose vertices are pairs of related states. Formally let C = (S,A,->) be an LTS and po, qo ^ S. We have the following. THEOREM
EC.VxAxV
5.1. po £ 0 , 0 , qo iff there exists a graph G = {V, E) with V ^ S x S and such that^
Equivalence and preorder checking for finite-state systems
417
• (Po,^o)e V; • whenever (p, q) eV then {p, q) e fJ; • whenever (/?, q) eV and (p, q, a) e 0\ and p - ^ p' then there exists a q' such that q-^q' with {p\q') e V and {{p\q'),a\,{p^q)) e £; • whenever {p, q) eV and {p,q,a) e 02 ^^^ q - ^ ' then there exists a p' such that p-^ p' with {p\ q') € V and ((p', q'), ai. (p, q)) e E, If such a graph exists then V represents a (77, 0\, 02>-bisimulation relating po and qo. If (p, ^) € V(Q), then the edges leading into (p, ^) may be thought of as the "justification" for including (p, ^) in the preorder. The index i of the action a indicates which of the conditions of Definition 4.1 the justification is based on. If / = 1 then the basis of justification is condition 2; if / = 2 then it is condition 3. Given LTS C = {S,A,->) and two states po.qoe S, the algorithm works by attempting to build a graph as described in Theorem 5.1. This construction proceeds incrementally using a depth-first search of 5 x 5 , starting with {po, qo). When the algorithm is invoked on p and q, a vertex for (p, q) is added to the graph (if one does not exist already) provided that {p,q) en. The algorithm then attempts to add nodes relating each t^f-derivative of p to some a-derivative of ^ whenever (p,q,a) €
418
R. Cleaveland, O. Sokolsky
}[1]=
Fig. 16. Illustration of the pointers high p
qi
.QM-
tions that highp,^^ is the index of the first potential candidate and {p,q,a) € 0 i . If it finds a match then it adds the edge {{p\ q'), a\, {/?, q)) into Q to indicate that the status of {p,q) depends on the status of {p',q') — any status change of (p',q^) requires the re-analysis of state {p,q). Procedure SEARCH JLOW performs the dual task of procedure SEARCH JilGH. Given states /? and (7, main procedure PREORDER tries to match each a-derivative of p with some ^-derivative of q by calling SEARCH JHIGH and each aderivative of q with some «-derivative of p by calling SEARCH±0W. PREORDER does not invoke SEARCHJilGH or SEARCHXOW if (p, q) i 77. When SEARCHJilGH or SEARCH±0W returns a not.related status (SEARCH JilGH returns a not.related status if some At-derivative of p cannot be matched to any a-derivative of q) then vertex (/?, q) is removed from Q and inserted into R. Then all the vertices having an incoming edge from {p,q) are re-analyzed. These vertices are stored in the set A. Pseudo-code for these procedures may be found in Figures 17, 18 and 19. 5.2. Let p, q be states in a finite-state LTS, and assume R = id andQ = (0, 0). Then PREORDER(p, q) terminates, and PREORDER(p, q) = related iff pi 77 ^•
THEOREM
PROOF. Each possible vertex and edge is added and deleted at most once from Q. Since the number of potential edges and vertices is bounded, PREORDER eventually terminates. As for correctness, we first note that when PREORDER(p, q) terminates Q satisfies the conditions laid out in Theorem 5.1. Also, PREORDER(p, q) returns a related result if and only if {/?, ^) is a vertex in g. Therefore, if PREORDER{p, q) = related then p^^^jp^q^ Now note that PREORDER{p, q) = not.related if and only if (p, ^> G /? at termination. Also, {p,q) is added to R only if some ^-transition of p can not be matched to any a-transition of q in such a way that the resulting Q satisfies Theorem 5.1. Therefore, if PREORDERip, q) = not.related then p ^q. D
The time complexity of PREORDER may now be characterized as follows. We assume that the calculation of the transitions from a state takes unit time (that is, the set of transitions of a state is stored in the state rather than being computed by the algorithm).
Equivalence and preorder checking for finite-state systems
R := 0; e:=(0,0>; PREORDERip,q) -^ (result.{related,notj-elated}) {* p and q are not related. *} if {p,q) e R t h e n r e t u r n (not.related);
if Jj?,q)yn then R:=RU[{p,q}}; r e t u r n {not-related); end; {* Pair {p,q) has already been inserted into V{Q). Its status is assumed related. *} i f {p,q) € V{Q) t h e n r e t u r n {related); {* Pair {/7, q) is going to be analyzed for the first time. *} Q:={V{G)U[{p,q)],E{G)); status := related; {* Match each a-derivative of p with some a-derivative ofq. *} f o r e a c h a e {p —^) w h i l e status = related do f o r e a c h p^ e {p - ^ •} w h i l e status = related do status := not-related; i f highpf^^ does not exist t h e n create highp> ^^ end; {* Match p' with some a-derivative ofq. *} status := SEARCHJiIGH{p - ^ p\ q); i f status = not-related t h e n {* A contains vertices that are going to be affected as a result of the removal of {p,q) from 5. *} A := {(r - ^ ;;, 5, /> | ({p, q), a,, (r, 5» € E{Q)\; end; end; {* Match each a-derivative of q with some a-derivative of p. *} f o r e a c h a^{q —%} w h i l e status = related do f o r e a c h p' e {q - ^ •} w h i l e status = related do 5rafM5 := not-related; i f lowq' p^ does not exist t h e n create lowq' p^ end; {* Match q' with some a-derivative of p. *} ^rato := SEARCH±OW{q -^ q\ p); i f status = not-related t h e n A := {(^ - ^ ^, r, /> | {{/?, ^), ^/, (r, s)) e E{Q)}; end; end; Fig. 17. "On-the-fly" PREORDER.
419
420
R. Cleaveland, O. Sokolsky
{* Re-analyze all the states that are affected from the removal of vertex {p,q) from Q. The set A contains all such pairs. *} i f status = not-related t h e n {* Remove incoming and outgoing edges from vertex {p,q}. *} g:={Vig)-{{p,q)},E(g)-{{7ti,ai,7t2)\(7ti={p,q)V7T2 = {p,q))Aie{\,2}}); {* Add {p,q) to the set of unrelated state pairs. *} R:=RUl{p,q)}; w h i l e A 7^ 0 do Choose (r —> r\s, type) e A; A:=A-{{r-^r\s,type)}; i f type = 1 t h e n b e g i n highr\s,a-=high,'sa-^^'^
{* Match / to the next «-derivative of 5. *} status := SEARCHJiIGH(r - ^ r\ s)\ i f status = not-related t h e n A := A U {{rr - ^ r, ss, i) \ ((r, s), bi, (rr, ss)) € E(g)]\ S : = ( y ( a ) - { ( r , 5 ) } , £ ( g ) - { ( 7 r i , ^ - , 7 r 2 ) | 7 r , =(r,5>V7r2 = (r,5>}); /?:=/?U{(r,5)}; end; end; i f ry/7e = 2 t h e n b e g i n status := SEARCH±OW(r - ^ r^ s)\ i f 5rafM5 = not-related t h e n A := A U {(rr - ^ r, 55, /) | {{s, r), ^/, {ss. rr)) e E{g))\ g_:= {V(g)-[{s,r)],E{g)-{{izx.bi,712) \nx=(s,r)y712 R:=RU{{s,r)}; end; end; end; endif; return(status); e n d PREORDER;
= {s,r)])\
Fig. 18. "On-the-fly" PREORDER (continued).
T H E O R E M 5.3. Let C= ( 5 , A ->) w/r/i | £ | = | 5 | + K | . PREORDER takes time proportional to that required by 0(tm\i -\-m) set membership operations, where m ^\C\ and ^init is ihe time required to compute H,
•}\^t(SEARCHJHGH)
+ J^K^ " ^
.}\^t(SEARCHXOW),
Equivalence and preorder checking for finite-state systems
421
SEARCHJilGHip - ^ p\ q) -> {result: [related, not^elated]) status := not-related; i f {p,q,a) ^
_
^
Fig. 19. Procedures SEARCH JilGH and SEARCHXOW.
where t{SEARCHJHGH) = 0(\{q - ^ •}!) and t{SEARCH±OW) = 0(|{/7 - % •}!). Then the total time spent to execute the nested f o r e a c h loops in Figure 17 over all the recursive calls is bounded by
ip,q)eSy<S
aeA
When a state pair (p,q) is found to be unrelated, all the state pairs that depend on this state pair need to be re-analyzed. The time spent to re-analyze these state pairs ignoring the time consumed by recursive calls is
\eA
^
422
R. Cleaveland, O. Sokolsky
In the worst case each state pair needs to be re-analyzed, and total time required to reanalyze the state pairs is bounded by
Then it follows that the time it takes to execute PREORDER is proportional to that required by OC^init + m) set membership operations. D As noted in Section 2.4, £ ^ 0 ^ can represent various behavioral equivalences and preorders by choosing
6. Tools Over the last decade, a number of tools that use process-algebraic formalisms for specification and analysis of systems have been developed. Several of these tools implement one or more of the algorithms presented in this chapter. The first successful tool in this category was the Concurrency Workbench (CWB) [11], developed as a joint project between the University of Edinburgh, the University of Sussex, and Uppsala University. The CWB implements global algorithms for several behavioral equivalences and preorders, including bisimulation, observational equivalence, and branching bisimulation. A continuation of the Concurrency Workbench effort resulted in CWB-NC, the Concurrency Workbench of the New Century [12]. In addition to improved efficiency and an extended set of algorithms, CWB-NC features the ability to "plug in" user-defined system description languages, and uses language-independent analysis algorithms on a uniform internal representation of processes. The Fc2 toolset [5] gives the user the choice between explicit representation of the state space with partition refinement analysis techniques and symbolic OBDD-based representation. A graphical user interface provided by the Autograph visual editor gives a more intuitive specification language compared with text-based process algebra terms. The Fc2 interchange format makes it possible to share specifications with other tools that support this format, such as Aldebaran, described below. CADP (CiESAR/ALDEBARAN Development Package) [14] also supports both partition refinement techniques based on the Paige-Tarjan algorithm and symbolic BDD-based algorithms. The toolset is oriented towards analysis of systems expressed in the high-level process-algebraic languages LOTOS and E-LOTOS [15]. A number of interchange formats are supported, allowing the user to work with other high-level languages such as SDL as well as low-level representations. The commercially available tool FDR2 [26] is based on the CSP [20] process algebra. FDR2's main analysis technique is based on establishing refinements (behavioral preorders) between processes. Analysis of real-time systems, including schedulability and resource requirements, is supported by the PARAGON toolset [27]. PARAGON calculates
Equivalence and preorder checking for finite-state systems
423
a resource-sensitive version of bisimulation equivalence using a partition-refinement algorithm.
7. Conclusions This chapter presented several algorithms for the analysis of finite-state process-algebraic specifications. The algorithms calculate behavioral equivalences and preorders; equivalences can be used to compare two processes for indistinguishable behavior and to minimize the state space of a system in a behavior-preserving manner. Preorders can be used to establish refinements, that is, specification/implementation relationships between processes. Finite-state systems represent an important class of system specifications, amenable to fully automatic formal analysis. Finite-state systems are used in the specification and verification of hardware and software designs, communication and security protocols, real-time systems, etc. Even when a specification has an infinite state space, some of its components may be finite-state. In this case, the inherent modularity of process-algebraic specifications allows one to apply automatic equivalence and preorder checking techniques to these components.
References [1] L. Aceto, W. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [21 J.C.M. Baeten, J.A. Bergstra and J.W. Klop, Syntax and defining equations for an interrupt in mechanism process algebra, Fundamenta Informatica 9 (1986), 127-168. [3] T. Bolognesi and E. Brinksma, Introduction to the ISO specification language LOTOS, Computer Networks and ISDN Systems 14 (1987), 25-59. [4] A. Bouali and R. de Simone, Symbolic bisimulation minimization, Proc. CAV '91, Lecture Notes in Comput. Sci. 663 (1992), 96-108. [5] A. Bouali, A. Ressouche, V. Roy and R. de Simone, The Fc2Tools set, Proc. of Computer-Aided Verification (CAV '96), Lecture Notes in Comput. Sci. 1102 (1996), 441^W5. [6] R.E. Bryant, Graph-based algorithms for Boolean function manipulation, IEEE Trans. Comput. C-35 (6) (1986), 677-691. [7] R.E. Bryant, Symbolic Boolean manipulation with ordered binary-decision diagrams, ACM Computing Surveys 24 (3) (1992), 293-318. [8] U. Celikkan, Semantic preorders in the automated verification of concurrent systems, Ph.D. thesis. North Carolina State University, Raleigh (1995). [9] U. Celikkan and R, Cleaveland, Generating diagnostic information for behavioral preorders, Distrib. Comput. 9 (1995), 61-75. [10] R. Cleaveland and M. Hennessy, Testing equivalence as a bisimulation equivalence. Formal Aspects of Computing 5 (1) (1993), 1-20. [11] R. Cleaveland, J. Parrow and B. Steffen, The Concurrency Workbench: A semantics-based tool for the verification of concurrent systems, ACM TOPLAS 15 (1) (1993). [12] R. Cleaveland and S. Sims, The NCSV Concurrency Workbench, Proc. of Computer-Aided Verification (CAV '96), Lecture Notes in Comput. Sci. 1102 (1996), 394-397. [13] C. Courcoubetis, M. Vardi, P. Wolper and M. Yannakakis, Memory efficient algorithms for the verification of temporal properties, Proc. of Computer-Aided Verification (CAV '90) (1990).
424
R. Cleaveland, O. Sokolsky
[14] J.-C. Fernandez, H. Garavel, A. Kerbrat, R. Mateescu, L. Mounier and M. Sighireanu, CADP: A protocol validation and verification toolbox, Proc. of Computer-Aided Verification (CAV '96), Lecture Notes in Comput. Sci. 1102 (1996), 437-440. [15] H. Garavel and M. Sighireanu, Towards a second generation offormal description techniques - rationale for the design ofe-lotos, Proc. FMICS'98 (1998), 187-230. [16] RJ. van Glabbeek, The linear time - branching time spectrum I. The semantics of concrete, sequential process. Handbook of Process Algebra, J. A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 3-99. [17] R.J. van Glabbeek and W.P. Weijland, Branching time and abstraction in bisimulation semantics, J. ACM 43 (3) (1996), 555-600. [18] J.F. Groote and F.W. Vaandrager, An efficient algorithm for branching bisimulation and stuttering equivalence, Proc. 17th International Colloquium on Automata, Languages and Programming, Lecture Notes in Comput. Sci. 443, Springer-Verlag (1990), 626-638. [19] M. Hennessy, An Algebraic Theory of Processes, MIT Press (1988). [20] C.A.R. Hoare, Communicating Sequential Processes, Prentice-Hall (1985). [21 ] PC. Kanellakis and S.A. Smolka, CCS expressions,finitestate processes and three problems of equivalence. Inform, and Comput. 86 (1) (1990), 43-68. [22] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92 (1980). [23] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [24] R. Paige and R.E. Taijan, Three partition refinement algorithms, SIAM J. Comput. 16 (6) (1987), 973-989. [25] G. Plotkin, A structural approach to operational semantics, Aarhus University, Computer Science Department (1981). [26] A.W. Roscoe, Model-checking CSP, A Classical Mind: Essays in Honour of C.A.R. Hoare, Prentice-Hall (1994). [27] O. Sokolsky, I. Lee and H. Ben-Abdallah, Specification and analysis of real-time systems with PARAGON, Ann. Software Engineering 7 (1999), 211-234.
Subject index ~ , 395, 396, 398 -^,396,398,407 ^,408,409 ^,407 £ ^ ^ ,398,411,412,416-418,422 £,397,398 algorithm - BB_PARTITIONING, 408^11 - EFF_PREORDER, 411^16 - KaneUakis-Smolka, see KS_PARTITIONING - KS_PARTITIONING, 398-401 -local, 416-422 - on-the-fly, see local - Paige-Tarjan, see PT_PARTITIONING -PREORDER, 411, 422 - PT_PARTITIONING, 401-403 - symbolic, 405-407 equivalence -bisimulation, 395,398 - - fixpoint characterization, 396 - - iterative characterization, 396 - - parameterized, 396, 398
-
branching bisimulation, 408 observational, 407 observational congruence, 408 testing, 408 weak bisimulation, 407
labeled transition system, 394 - finite-state, 394 - image-finite, 396 LTS, see labeled transition system OBDD, 404-407 parameterized semantic relation, 397, 411,416 partition refinement, 398 preorder - forward simulation, 397 process transformation, 407 refinement ordering, see preorder sphtter, 398, 401, 404, 409, 411 - compound, 402
Parts Infinite-State Processes
This Page Intentionally Left Blank
CHAPTER 7
A Symbolic Approach to Value-Passing Processes Anna Ingolfsdottir^ Huimin Lin^ Institute of Computer Science, Aalborg University, Denmark E-mail: [email protected] ^ Laboratory for Computer Science, Institute of Software, Chinese Academy of Sciences, Republic of China E-mail: [email protected]
Contents 1. Introduction 1.1. Some examples 1.2. Late and early semantics 1.3. Infinite branching 1.4. Axiomatization 1.5. Outline of the chapter 2. The value-passing language 2.1. The syntax 2.2. Operational semantics 3. Bisimulation equivalences 3.1. Early bisimulation 3.2. Late bisimulation 3.3. Translating into pure processes 4. Symbohc bisimulations 4.1. Symbohc operational semantics 4.2. Early symbolic bisimulation 4.3. Late symbohc bisimulation 4.4. Weak symbohc equivalences 5. Proof systems 5.1. The Core system 5.2. The axioms for early bisimulation 5.3. The T laws 5.4. Adding other operators 5.5. Reasoning about recursion 6. Summary and related work Acknowledgements References Subject index
429 429 431 434 436 437 437 437 439 440 440 442 446 448 449 451 454 456 459 459 464 465 467 468 475 475 475 477
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
427
428
A. Ingolfsdottir, H. Lin
Abstract In this chapter we give a survey of the semantic theory for value-passing processes, focusing on bisimulation equivalences. The emphasis is on the symbolic method. Both operational and proof theoretic approaches are described and their expressiveness compared.
A symbolic approach to value-passing processes
429
1. Introduction In the pioneering work of Milner [29] on CCS and Hoare [22] on CSP, exchange of data appeared as a natural feature of these languages. Subsequently, although some work was done on their semantics, see, e.g., [6,21,28], most of the research effort was devoted to the pure versions of these languages such as pure CCS [29,32] and theoretical CSP, TCSP [2]. The focus was on the behavioural properties of processes where no data are involved and the only form of communication considered was pure synchronization. In particular, structural operational semantics by means of inference rules [40] and more abstract behavioral equivalences based on these were defined and their properties studied in detail. About a decade after the introduction of CCS and CSP, the theory of pure processes was considered as being well established and research on semantic theories for value-passing processes was back in focus [13-17]. Not so surprisingly, it turned out that allowing transmission of elements from a possibly infinite value domain introduced some technical compHcations, with the consequences that some of the already established theories for the pure calcuH could not be applied directly. In this chapter we will try to give the reader some insight into the theoretical complications that arise when such value-passing processes are described semantically, as well as solutions to those. Our main focus will be on techniques for checking semantic equivalences between processes. In particular, we are interested in investigating equivalences based on the idea of bisimulation due to Milner and Park [30,37]. For this purpose symbolic operational semantics and the corresponding notion of symbolic bisimulation are introduced. These are abstractions of the standard semantics which allow us to perform case analysis on the input values and thus, in many cases, to resolve the infinity arising from an infinite value space. We start the chapter by providing the readers with some motivation, mainly inspired by examples. Based on the acquired intuition we give an informal introduction to our example language, which is basically the original CCS as it was introduced by Milner in [29].
1.1. Some examples In standard sequential programming, manipulating and exchanging values with the environment occurs naturally, as illustrated by the following example. EXAMPLE 1.1. The program P r o g below is a simple sequential program that reads two numbers, calculates their sum and multiple, divides the sum by the multiple and outputs the result:
Prog: begin input(x, j);
t \z=x^y\ u \=x ' y; output(r/M) end.
430
A. Ingolfsdottir, H. Lin
This program interacts or communicates with its environment, i.e., the user, by receiving the input values x and y from him and giving him back the result of the computation. In concurrent computations, value-passing occurs just as naturally and processes cooperate with each other by exchanging messages, typically through communication channels or ports. A synchronous communication event, which is the type of communication we consider in this chapter, usually consists of two complementary actions: input and output. A process rec, which is ready to receive or input a message from a channel c, may be given by rec = clx.rec' where typically x occurs free in the sequel rec'\ when inputting a value i; from channel c this process evolves into rec'[v/x], i.e., the process rec' with all free occurrences of the variable x replaced by the value v. Similarly a process send that prepares to send or output a value v on the same channel and by sending evolves into its sequel send\ may be expressed as send = c\v.send'. When these two processes are running in parallel, denoted by rec \ send, a communication event can take place, with the consequence that the composite system evolves into a new state rec'[v/x] \ send' where the "passing" of the value v from send to rec is modeled by substitution, as explained before. Furthermore, once these processes have agreed to communicate, the communication is private and no other processes can take part in it; this kind of communication is called handshaking. More formally the event described above may be given by a transition relation induced by rec - ^ rec'[v/x] and send - ^ send' imply rec \ send —^ rec[v/x] \ send'. Here r is a special invisible action indicating that synchronization and exchange of values between processes is not observable and therefore it can not take part in a further synchronization with the environment. EXAMPLE 1.2. In the above example, noting that the commands t := x -\- y and u := X ' y may be performed independently, the program P r o g may be rewritten in the process description language CCS as a concurrent process by
p = {inilx.in2'^y.{c\(x -h y) \ d\(x • y) \ dlu.clt.out\{t/u)))\[c,
d],
where the restriction operator _\{c, d) indicates that p can use c and d only for internal communication, but that it is not allowed to communicate with its environment via these channels. We note that the process calculus CCS is applicative in the sense that it does not allow for assignments. Thus the results of the calculations of x -I- >' and x • y are output directly without assigning them to a variable first. The next example shows how processes with infinite behaviour may be given using recursive definitions parameterized over data. EXAMPLE 1.3. A counter is a process that outputs the natural numbers, one after the other in increasing order on a given channel, say c. To express this we let
C(n)^c\n.C{n^\)
A symbolic approach to value-passing processes
431
meaning that the parameterized recursive process C(n) behaves Hke the right hand side of the defining equaHty, i.e., it outputs the number n on channel c and afterwards behaves like C(n + 1). It is not difficult to see that C(0) has the expected behaviour of a counter as described above. To obtain two distinguishable copies of the counter, instead of giving two copies of similar recursive definitions, we apply a so-called renaming operator on C{n). Thus Cin)[c (-^ c'], the process C(n) with c renamed to c\ behaves like C{n) with all occurrences of c replaced by c\ i.e., like the counter that makes use of the channel c' instead of c. The following example shows how parameterized recursive processes over an inductively defined data domain may be defined inductively. EXAMPLE 1.4. In what follows let Stack{h\b2 .. .^/j) denote a stack over an alphabet L. We represent the content of the stack as a string b\b2...bn ^ L* where b\ is the top element of the stack. Let e denote the empty string, b e L and s e L*. Furthermore, let pusWlx denote the action of inputting an element from channel push and assigning it to x, and pop\b the action of outputting the element b on channel pop. Then we may model Stack(s), s e L"^, inductively as follows:
Stack{e) ^pushlx.Stack(x), Stack(bs) <=pop\b.Stack{s) -^pushlx.Stack{xbs). Here the operator -h {choice) indicates that the the process Stack(bs) nondeterministically chooses between behaving like one of its components, i.e., either like poplb.Stack(s) or like pushlx.Stack{xbs). The intuitive behaviour of the process Stack is that if it is empty (Stack(e)) its only possible action is to push onto it an element received from the environment via the channel/7M5/Z. If the stack is not empty, i.e., it contains a string of the form bs (Stack(bs)) with b as its top element, then either the element b can be popped off the stack and returned to the environment via pop, or the environment can push a new element x onto the stack Vmpush whereby it evolves to the stack Stack{xbs). \J1. Late and early semantics A standard way of describing each computational step of a concurrent or reactive system is by assigning to it a so-called Structural Operational Semantics as described in [7] and [1] in this Handbook; the semantics we have introduced informally in this section is based on this approach. However it is a widespread opinion amongst researchers in the area that this kind of semantic description is in general too concrete to reason about the behaviour of processes on a more abstract level, for instance to decide when two processes are behaviourally or semantically equivalent. In [30] Milner overcomes this inadequacy by describing a general idea to model observational equivalence of processes referred to as black box testing (see [7] in this Handbook for further motivation); a process is considered to be a black box provided with an interface containing buttons, one for each (observable) action it can perform, plus possibly some other control devices such as lights or buttons. An
432
A. Ingolfsdottir, H. Lin
external observer can interact with, and thus perform experiments on, the process by pressing these buttons and observing its reactions. Two processes are said to be behaviourally equivalent if the observer is not able to distinguish between their reactions to his experiments. A variety of preorders and equivalences are defined in the literature based on the black box model, but with different notions of observers, observable actions and experiments. A standard class of equivalences, and probably the most studied one, consists of Milner's equivalences based on the idea of bisimulation, which may briefly be described as follows (see also [7] in this Handbook for a more detailed explanation): Two processes p and q are bisimilar if whenever one of them, say /?, reacts when the button labelled by a is pressed by evolving to some state p' (i.e., p - ^ p') then q also reacts when some button, labelled by a, is pressed and by doing so it evolves to some state q' where p' and q' are again bisimilar. Originally the idea of bisimulation only concerned pure processes. Extending the idea to value-passing processes raises some questions about what we mean by an (observable) action and consequently how processes are supposed to synchronize. We will try to explain this by the following example. 1.5. Let c, c\ and C2 be three different channel names and the processes p, pi, P2 and q,q\,q2bc defined by EXAMPLE
p\ =clx.if
jc ^ 5 thenciljc e l s e C2\x,
P2 =clx.if
X ^5 thenc2!jc e l s e
qi
CI!JC,
=clx.c\\x,
q2 = C?JC.C2!JC,
P = P\ -^ P2,
q=q\
+^2.
Obviously p and q are bisimilar according to Milner's original semantics as they have isomorphic transition graphs. However we also note that different moves of p due to the same component, say p\, have to be matched by q by moves coming from different components. Thus p —^ i f u ^ 5 t h e n c i l i ; e l s e C2lv for i; = 1 and v = 6 because p\ —^ i f i; ^ 5 t h e n c i ! i ; e l s e Qlf for i; = 1 and v = 6. On the other hand, to match these moves by q we need one move from each of its components^! and ^2. i-e-7 q-^
c\\\
because
^i-^ci!l
A symbolic approach to value-passing processes
433
and q-^
C2\6 because
^ 2 - ^ Q-6.
In terms of black box testing the semantic approach described in the examples above corresponds to the situation in which the buttons for the input actions are marked with c?i;, i.e., with labels consisting of both c?, to indicate that the value should be received along the channel c, and also the concrete value v that is to be received along that channel. This semantic approach has been referred to as early semantics due to the early instantiation of the value variable that is involved in the communication. Another approach would be to consider input actions of the form c? for the action of inputting some value on the channel c. In the black box interpretation this means that we only mark the corresponding buttons for input actions with labels of the form c? and leave out the concrete value u. This entails that the result of pressing such a button or performing an action of the form c? is an incomplete process as the information about the concrete value the process is about to receive from the environment is still missing. In this introduction we consider this incomplete state as a function that inputs a value and delivers a completed process. (In the main body of this chapter these incomplete states are given as process terms with possibly free value variables.) Such functions are referred to as abstractions in [34]. Syntactically abstractions are denoted by {x)p where jc is a value variable and p is a process term. They can be interpreted as a shorthand for the A-abstraction kv.p[v/x]. Two such abstractions match each other semantically if they do so pointwise, i.e., if whenever they are both applied to the same value, the results are indistinguishable. This semantic approach has been termed late semantics due to the delayed instantiation of the value variables. EXAMPLE 1.6. To show that p and q from the previous example are not strongly bisimilar according to the late approach, we proceed as follows. The process p has the late transition
p —^ XvAf V ^5 t h e n c i ! i ; e l s e C2\v = / . The possible c? transitions for q are q—-^ kv.c\\v = f\
and
q—-^ Xv.cilv = fj.
For p and q to be bisimilar in the late sense it is necessary that either / and f\ match completely pointwise or otherwise / and /2 must do. So either we have that for all f, f(v) and f\ (v) are bisimilar or that for all v, f(v) and f2(v) are. To see that this is not the case we observe that /(6) = i f 6 ^ 5 t h e n a !6 e l s e C2I6 - ^
while
f\ (6)
^
and that /(l)-^
while
/2(1)-^,
where p —^ means that p —^ p' for some p' and p - ^ means that no such p' exists.
434
A. Ingolfsdottir, H. Lin
The two semantic approaches described above lead to two different notions of bisimulation: the early bisimulation and the late one, which is strictly finer. However we want to point out here that if we look at the rules for communication, it turns out that the early and the late semantics yield exactly the same result. EXAMPLE
1.7. In the example above, iir — c\v then the late semantics yields
^ k - ^ / i ( i ^ ) | 0 = ci!i;|0
and
(7 | r - ^ / 2 ( i ; ) | 0 = C2!i; | 0.
It is not difficult to see that the early semantics gives exactly the same transitions. In more general terms only the intermediate states which the processes reach immediately after an input action can be distinguished by the late and early semantics but after a completed communication they are syntactically the same for these two approaches. This implies, as shown in [24], that although behavioural equivalences that involve investigation of these intermediate states are different for the late and early semantics, the equivalences that do not involve observations of states that occur as a result of input actions cannot be told apart. An example of a semantics, where the late and early versions coincide is the testing based semantics due to De Nicola and Hennessy. 1.3. Infinite branching As pointed out at the beginning of this section, the main technical difficulties associated with introducing value-passing into the semantic theory of pure processes is due to the infinite branching of the input transitions. For example, the process clx.p has the transitions clx.p - ^ pi^/x] where v ranges over the value domain which in general may be assumed to be infinite. However, in CCS the only control structure that allows branching on input values is the construction i f _then_else_ and obviously each process can only contain finitely many of those. Therefore, by applying a case analysis on the input values, in many cases this infinite branching can be resolved and reduced to finite branching. To explain this point let us first have a look at the following example from sequential programming. EXAMPLE
1.8. Let us consider the following two sequential programs.
Programl\ i n p u t jc; i f X > 1 t h e n jc := JC — 1 e l s e JC := JC + 1; o u t p u t JC. Program!', i n p u t JC; i f X ^ 3 t h e n jc := jc — 1 e l s e ( i f JC = 1 t h e n jc := 2 e l s e JC := 1); o u t p u t X.
435
A symbolic approach to value-passing processes
The actions of these two programs are given by the data flow diagrams below. Program
C
x>I
1
Program
2
>
^r
^ f
x:=x-l
x:=x+l
out X
By case analysis on the input value for the variable JC, considering the cases 0 ^ x < 1, x = l , l < j c < 3 and JC ^ 3 the reader should have no difficulties in convincing himself that these two programs are equivalent in the sense that for a given input x they will both return exactly the same output. As pointed out before, CCS does not allow for assignments. However the action of these two programs may be simulated by the following CCS processes. p\ = inlx.if
X > I t h e n out\(x — 1) e l s e out\(x + 1),
P2 = inlx.if
JC > 3 t h e n out\{x — 1) e l s e ( i f JC = 1 thenoMr!2 e l s e outW).
Based on the same idea as the data flow diagrams, an abstract or symbolic transition graph for these processes may be given as below. We note that these graphs have finite branching.
Pi
P2
-•X^3A^X=1
out!!
Again, using the same kind of case analysis, based on the same cases as before, the reader should be able to check that these two processes are bisimilar both in the early and the late sense.
436
A. Ingolfsdottir, H. Lin
One of the main purposes of this chapter is to describe formally a symbolic semantics that realizes the ideas described above and thus provides a theoretical framework that allows us to formally reason about equivalences between value-passing processes by only investigating finitely branching transition graphs.
1.4. Axiomatization Providing sound and complete axiomatizations for various equivalence relations has been one of the major research topics in the development of process theories. A complete axiomatization not only allows us to reason about process behaviours by syntactic manipulation, but also helps to understand the properties of the operators used to build complex processes from simpler components. Traditionally, axiomatizations in process calculi are based on pure equational reasoning, namely replacing equals by equals. For value-passing processes, however, this approach is in general not adequate, because, for instance, input prefixing introduces the notion of bound variables which is beyond the realm of pure equational reasoning. To be able to deal with such "non-algebraic" constructs we generalize equational reasoning by introducing inference rules while preserving the equational laws that are at the core of the axiomatizations in pure calculi. ^ As data play an important role in value-passing processes, it seems that any axiomatization for such processes would have to involve axiomatizations for the data domain. However, it turns out that we can factor out data reasoning from process reasoning, by employing conditional equations of the form b\> t = u, where t and u are process terms and Z? is a Boolean expression representing the condition on the data domain under which t and u are equal. An example of a proof rule of our inference system is
b' Ab\>t = u b' A^b\>0 = u b' > if b thent = u It captures the intuitive meaning of the (one-armed) conditional construct: if b t h e n t behaves like t when b is true, and like 0 (the "empty" process) otherwise. In fact this rule is all we need to know about the i f _ t h e n _ construct when manipulating syntactical terms. Looked upon from a "goal-directed" point of view, it moves the parts involving data (b) from the process term ( i f Z? t h e n t) to the conditional part of the judgment. Such conditions can be used to discharge constructs involving data when some other inference rules are applied. For instance, the following rule for output prefixing: OUTPUT
^Ne=:.', b>,^u b > cle.t = c\e'.u
For a treatment of these matters that stays closer to equational logic see [8].
A symbolic approach to value-passing processes
437
allows us to conclude that clej and cle'.u are equal under b, provided that / and u are equal under b and that ^ = ^Ms implied by b. As the last condition only relies on reasoning over data, it is factored out from the main proof system. This is manifested by using the notation b\=e = e\ Using inference rules in this style, together with the usual equational axioms, a spectrum of proof systems for value-passing processes can be obtained which are sound and complete (relative to data domain reasoning) with respect to the various bisimulation-based equivalences.
1.5. Outline of the chapter The rest of this chapter is organized as follows. In Section 2 we formally introduce the syntax and operational semantics for our example language, full CCS, whereas Section 3 is devoted to defining the various bisimulation based equivalences we investigate. Symbolic operational semantics and symbolic bisimulations are studied in Section 4. In Section 5 we formulate proof systems to reason about value-passing processes, one for each of the congruences mentioned above, and we give some soundness and completeness results. The main content of this chapter is summarized in Section 6 where pointers to relevant works are also given. We will omit detailed proofs as much as possible in this chapter by referring to the literature, and will only supply them when they are not available in published papers.
2. The value-passing language In this section we introduce the syntax for the language we consider in this chapter together with its operational semantics. The language is essentially the same as the one originally proposed by Milner in [29, Section 2.8], often referred to as full CCS or value-passing CCS.
2.1. The syntax The language we consider is rather abstract as we want to focus on aspects which do not depend on the properties of the data domain. Therefore we simply assume a predefined syntactic category DExp of data expressions, ranged over by e, e\ etc. This should include, at least, an infinite set Val of values, ranged over by f, v\ etc. and a countably infinite set Var of data variables, ranged over by JC, >', etc., which is disjoint from Val. We also assume a similar syntactic category BExp of Boolean expressions, ranged over by b, b\ etc. with the usual set of operators true, false, --, v, A and -^. Furthermore, for every pair of data expressions e, ^' we assume that ^ = ^' is a Boolean expression. We also assume that each data expression e and each Boolean expression b has associated to it a set of free data variables,/v(^) and fv(b) respectively, and that only data variables can occur free in these expressions.
438
A. Ingolfsdottir, H. Lin t ::=
0\oi.t\t-htlifbthentlr\tlt\L\t[f]\P(e)
a ::= r \clx \c\e Fig. 1. Syntax.
In general we do not worry about the expressive power of these languages although the results on symbolic bisimulations require that the language for Boolean expressions is sufficiently expressive to characterize any collection of evaluations over which two open terms are bisimilar. The definition of the language also assumes a countably infinite set of channel names Chan, ranged over by c, c\ etc., which is disjoint from Val and Var. To define recursive processes we use a set of process identifiers /C, ranged over by P, Q, etc. Each identifier is assigned an arity, a non-negative integer, indicating the number of parameters it should take to form a process term. Our language is given by the BNF-definition in Figure 1 and contains the operators listed below. 0 is the inactive process capable of doing nothing; a.t is action prefixing where we have three kinds of actions: the invisible action r, representing internal communication, and the input and output actions clx and c\e respectively; if b t h e n t is the (one armed) conditional construction; t -\- u is nondeterministic choice (or summation); t \u is parallel composition; / \ L , where L is a finite subset of Chan, is channel restriction; t[f], where / is a partial function from Chan to Chan with finite domain, is channel renaming. P(e), where P e JC and the length of e equals the arity of P, is a process which is defined recursively by associating to each such identifier a defining equation of the form P(Xu...,Xn)^t.
This way of giving the syntax of recursive processes turns out to be quite intuitive and therefore easy to apply. However, for theoretical purposes, it is sometimes more convenient to have recursion directly in the syntax by introducing an operator of the form fix X._ where X is a process variable. This will be discussed in Section 5.5 and for the time being we will use the version based on identifiers and defining equations. In the sequel we will often abbreviate a.O as a. In our studies we need the notion of an evaluation p which is a total mapping from Var to Val. We use the standard notation p{v/x] to denote the evaluation which differs from p only in that it maps x to v. We assume that an application of p to a data expression e, denoted lejp, always yields a value from Val and similarly for Boolean expressions, Ibjp is either true or false. Applications of evaluations also generalize to process terms, denoted tp, in the obvious way. We assume that these evaluations satisfy some standard properties such as that whenever p and p' agree on/v(^) then le^p — ie^p'. If an expression e has no free variables, namely it is closed, then |[^]p is independent of p. Consequently we simply write \ej to denote its value and use a similar convention for Boolean expressions. We will use the suggestive notation p ^b Xo indicate that [Z^Jp = true, and ^ (= Z?^ to indicate that for every evaluation p, p \=b implies p |= ^^ Of course we could equally
A symbolic approach to value-passing processes
439
well say that Z? ^- Z^Ms a logical theorem but our notation emphasizes the fact that we wish to describe our theory modulo the semantics of expressions. We will write b = b' for b\=b' and b' \= b. We will also refer to substitutions of data expressions for data variables, and assume that they satisfy the expected properties. We use e[e'/x] to denote the result of substituting e' for all free occurrences of JC in ^. More generally a substitution a is a partial mapping from Var to DExp and we use ea to denote the result of an application of a to the expression e. An input prefix is a binding operator in the sense that c?x.t binds jc in r. This gives rise to the usual notions of bound and free variables. We will write bv(t) and/v(r) for the sets of bound and free variables in r, respectively. Bound variables lead to the standard notion of Of-equivalence =a over terms and to that of substitution, t[e/x] denoting the result of substituting all free occurrences of JC in r by ^. The definition of substitution in process terms obviously relies on the definition of substitution in data expressions and may involve renaming of bound variables when necessary to avoid variable capture. A term is closed if it contains no free variables, and is open otherwise. In a defining equation P(x\,.. .,Xn) <=t it is required thatyv(0 ^ {x\,.. .,Xn}. We let T denote the set of all process terms, ranged over by r, M etc., and let V denote the set of all closed terms, ranged over by p, ^ etc., which we refer to as processes. We assign the following precedence to the operators (in decreasing order): restriction and renaming, prefix, conditional, parallel composition, choice. Although we only have the one-armed conditional if b t h e n _ in the language, with the help of -h the conventional two-armed ifb t h e n _ e l s e _ expression can be defined by ifb
then / else M = if Z? then t -\- if ->b then u.
In what follows we will use the i f _ t h e n _ e l s e _ construction freely without further comments.
2.2. Operational semantics Our language is given an operational semantics in the usual way by assigning to it a labelled transition system, i.e., a triple (S, L, ->) where S is a set of states, L is a set of labels and - > C S x L x S i s a transition relation. Usually we use the more intuitive notation s\ —> si in place of (^i, /, 5-2) € ^•. The standard operational semantics for our language is obtained by taking the set S to be V, the set L to be the set of actions Actj, where Act = {c\v, civ \ c e Chan, v e Val} andActr =ActU{T}, ranged over by a, and the transition relation to be the relation ->e ^ V X Actr X V defined by the rules in Figure 2. The function chan used in the definition is defined by chan(clv) = chan(c\v) = {c} and chanir) — 0. As explained in the introduction this semantic approach is usually referred to as the early operational semantics (hence the
440
A. Ingolfsdottir, H. Lin
TAU INPUT SUMl PARI
^9^
COM
V kz \al
clx.t —^e t t^^t' t + U^^et'
>e t
. c?i; ./ t ^e ^
t \u^^^t'
COND
SUM2
PAR2 1 U W
j^
if b t h e n r U
U
, >-e W
\u'
RES
REC
= true
^-e W ^e " |M'
t^et' t\L-^et'\L
t-^et'
tin^^.nn
-lbj
>e U
t \U - ^ e t
c\v
here v = iej^
cl^.r —>e t
t -\- U
t^et' t \U
REN
OUTPUT
X.t-^et
P(e) ^ e t'
•chan(a)nL = 0
-P(x)^t
Fig. 2. (Early) operational semantics.
subscript e), because, when an input term such as clx.u performs the input action, the value received is immediately substituted for the variable jc in M. In Section 3.2 we will consider its late counterpart where this substitution is delayed. By transition induction it is easy to show that a-equivalent processes have the same transitions (up to a-equivalence) in the following sense. LEMMA
2.1. If p =c^ q and p - ^ e p' then q —^e q' for some q' such that p' =a q'.
3. Bisimulation equivalences In this section we introduce the bisimulation based equivalences investigated in this chapter. We shall consider both the late and the early semantics and in each case we also distinguish between the strong version of bisimulation, where r actions are considered observable, and the weak one where they are not. In what follows we refer to the equivalences introduced in this section as the concrete equivalences as opposed to their more abstract versions, the symbolic equivalences, that will be introduced in the following section. We start with the early case.
3.1. Early bisimulation Using the operational semantics introduced in the previous section we can define the notion of bisimulation in the standard way.
A symbolic approach to value-passing processes
441
3.1. A symmetric relation R over V is an early strong bisimulation if it satisfies: (/?, q) £ R implies that
DEHNITION
if p - ^ e p' then q - ^ e q^ for some q' such that {p\ q') G R. We write p ^^ q if {p, q) e R fox some early strong bisimulation R. Like in the pure case, it is easy to show that the union of any collection of early strong bisimulations is again a bisimulation, and that --e is the union of all early strong bisimulations and therefore the largest such bisimulation. The relation --^e turns out to be an equivalence relation and is preserved by all the operators of the language. The proof of these properties is exactly the same as in the pure case and may be found in [32, Section 4.4]. From Lemma 2.1 we get directly that a-equivalent processes are bisimilar in the early strong sense. PROPOSITION
3.2. ifp =a q then p ^e q.
A more abstract and more realistic way of relating processes behaviourally is by means of weak bisimulation where r-transitions representing internal communications are abstracted away. The standard way of defining this relation is to replace the original transitions with the corresponding weak transition relations in the definition of bisimulation. For this purpose let =>e be - ^ | and = ^ e be =^e-^e==>e for ^ ^ Actr. Let also ^=^e be =>e and =^e be = ^ e for a e Act. The early weak bisimulation is then defined as usual. 3.3. A symmetric relation R over V is an early weak bisimulation if it satisfies: (/7, q) e R implies that DEFINITION
if p - ^ e p' then q = ^ e q' for some q' such that (p\ q') G R. We write p ^Q q if {p, q) e R for some early weak bisimulation R. Again, like in the strong case, ^ e is the largest early weak bisimulation and is obtained as the union of all early weak bisimulations. PROPOSITION 3.4. ^ e i^ an equivalence relation. PROOF.
See [32, Section 5.2, Proposition 2].
D
As in the case of the pure calculus, ^ e is not a congruence since it is not preserved by +. Therefore we introduce the following modified relation: 3.5. For closed terms p and q, p^i^q if and only if • whenever p - ^ e p' then q = ^ e q' for some q' such that p' ~e q'\ • whenever q - ^ e q' then p =^e p' for some p' such that p' ~e q'DERNITION
442
A. Ingolfsdottir, H. Lin
Note that the only difference between the definition of the relations ^ e and ::^e is that in the latter q = ^ e q' is replaced by q =^e q' on the "top leveF' of the definition, i.e., the matching move for an initial r-move has to be a real r-move. PROPOSITION 3.6. —e ^^ preserved by all the operators in the language and is the largest congruence relation contained in ^e-
PROOF. See [32, Section 7.2].
D
We refer to :^e as early observational congruence.
3.2. Late bisimulation In the definition of early bisimulation in the previous section, input variables are instantiated inmiediately when input actions take place and thus before processes are compared for equivalences. As a consequence, input transitions of the form civ for different values f, arising from a single input prefix clx from one process, can be matched by transitions inferred from more than one input prefix from the other process. Let us examine this in more detail with an example. EXAMPLE
3.7. Consider the following two processes where x ranges over integers. P ^
{clx.it
x = OtheTia\\x
Blsea2\x)-{-clx.a},\x,
Q <= (c?^.if jc = 0 then^aljc e l s e a2!jc) + (c?jc.if jc = 0 thena\\x
e l s e a2,\x),
where a\,a2 and a^ are different channel names. Obviously P and Q are bisimilar in the early strong sense as they have isomorphic transition graphs. For instance, a move P - ^ a^lv can be matched by Q - ^ a^lv using Q's first summand when v is 0, and using its second summand when i; is different from 0. In the late semantics we take a more restrictive view of input transitions by requiring that an input prefix gives rise to a single transition. Thus we replace the rule INPUT in Figure 2 with LATE-INPUT -
clx.t
We note that the resulting term / is an open term in which JC may occur free. Thus the states in the resulting transition system are elements from T, the actions are from the set of late actions Aci^ = {c\v I c € Chan, v e Val} U {clx \ c € Chan, x e Var] U {r}
A symbolic approach to value-passing processes
443
also ranged over by a, and the late transition relation - ^ i , defined by the modified rules, has the functionality
The free variables in the residuals of input transitions are instantiated when two terms are compared for equivalence, i.e., after the transitions have taken place (hence the adjective late). 3.8. A symmetric relation R between closed terms is a late strong bisimulation if it satisfies: (/?, q) e R implies that DEFINITION
• whenever p - ^ i / then q - ^ i u for some u such that (t[v/x], u[v/y]) e R for all V € Val; • whenever p - ^ i p\a e{z, clv\c e Chan, v e Val], then q - % i ^' for some q' such
ihsii(p\q')eR. We write p^iq'if
(p, q) e R for some late strong bisimulation R.
Note that, although - ^ i is defined between open terms, the relation ^ i is between closed terms only, because input variables get instantiated when input transitions are matched for bisimulation. According to this definition the two processes P and Q in the above example are not bisimilar, because, for instance, Q can not match P - ^ a},\x using either of its two input transitions. It is not difficult to see that the union of any collection of late strong bisimulations is again a late strong bisimulation. Furthermore --i is the union of all late strong bisimulations and thus the largest such bisimulation. It is also easy to see that =« is included in ^ i , and that ^ i is included in '^e, i.e., that late bisimulation is a finer relation than its early counterpart. This inclusion is strict as the above example demonstrates. It can also be shown that ^ i is an equivalence relation which is preserved by all the operators of the language. The proofs of these two facts are similar (and simpler) than those of Propositions 3.12, and 3.15, and are omitted. If we exchange the existential and universal quantifiers in the first clause in the above definition, that is, if we change the clause to • whenever p - ^ i t then for all i; € VaU q - ^ i u for some u and y such that
{t[v/x],u[v/y])eR, then it can be shown that the resulting relation, which we refer to as V3-bisimulation here, coincides with the early bisimulation of Definition 3.1. PROPOSITION
3.9. A relation R over V is a ^^-bisimulation if and only if it is an early
bisimulation. First, by a simple transition induction, we can prove that the following relationship holds between the early and the late transitions:
PROOF.
444
A. Ingolfsdottir, H. Lin
1. If/> - ^ 1 1 then p - ^ e t[vlx] for any i; G Val. If /? - ^ e p' then /? - ^ 11 for some jc and t with /?' = /[u/x]. 2. For a 6 {T, c!i; I C € Chan, v G Va/}, /? - ^ i q if and only if/? -^^q. The statement of the proposition then follows easily from these properties.
D
Now we turn towards defining the weak version of the late bisimulation. As usual we shall base our definition on a weak version of the transition relations. However here care must be taken in the case of input actions, because now the residual may be an open term which has no transitions. Thus, in the definition of the late weak transitions, an input transition can not absorb T moves that occur after it. These r moves will be absorbed when processes are compared for equivalence. Let =^1 be - ^ I , = ^ i be = ^ i - ^ i , and ==^i be = » i - % i ^ i for ^ € {r,c!u | v e Val]. These weak transition relations can now be used to define the late version of the weak bisimulation relation. 3.10. A symmetric relation R over 7^ is a late weak bisimulation if it satisfies: (/?, q) e R imphes that • whenever p - ^ i t then q = ^ 1 u for some u such that for all v e Val there exists q' such that u[v/y] => q' and {t[v/x], q') e R\ • whenever p - % i p', where a € {r, c\v\c e Chan, v e Val), then q = ^ i q' for some q' ^uc\\\hdX{p',q')e R. We write p^iq if (p, q) £ R for some late weak bisimulation R. DEFINITION
Note in this definition how r moves following an input transition are absorbed after the input variable gets instantiated. Again the union of any collection of late weak bisimulations is also a late weak bisimulation. Hence, as ^ i is the the union of all late weak bisimulations, it is the largest such bisimulation. To show that ^ i is an equivalence relation we need a lemma. LEMMA 3.11. Suppose that R is a late weak bisimulation and that (p, q) e R. Then the following holds: \. If p = ^ 1 t then q = ^ i u for some u such that for all v e Val there exists q' such that u[v/y^ =^1 q' and (r[u/x], q) € R. 2. If p = ^ 1 p', where a e {r, c\v \ c e Chan, v e Val}, then q = ^ 1 q' for some q' such that (p\ q') e R. PROOF.
Follows by induction on the definition of the late weak transition relation.
Now we have the following. PROPOSITION 3.12. ^i is an equivalence relation.
D
A symbolic approach to value-passing processes
445
PROOF. The only non-trivial part is to prove that ^ i is transitive. To this end we show that if both R and S are late weak bisimulations then so is their composition RS. Assume (p, q) € RS. Then there is an r such that (/?, r) £ R and (r, q) € S. We need to show that every transition from p can be matched properly by ^. We only consider the case when the transition is an input transition. Assume that p - ^ i t. Since (/?, r) e R, r = ^ i w for some w and z such that for all V € Val there is an r' with w[v/z\ =>i r' and {t[v/x],r') e R. Since {r,q) € S, by
Lemma 3.11 we have that q =±>>i u for some w and y such that for all v € V^/ there is a ^'' with M[I;/JC] =>! q" and (u;[i;/x],<7'0 G 5. Since w[v/x] =>i r', by Lemma 3.11, there is a q' such that ^'^ =^i q' and (r', ^') G S. Furthermore we have that u[v/x] =>i q' because u[v/x] =>i q^' and ^'' =>i q . Finally {t[v/x], q') G RS follows from the fact that {t[v/x],r') ^ R ?ind{r',q') ^ S. D PROPOSITION 3.13. ^\is preserved by all operators in the language except +. PROOF. We only prove that ^ i is preserved by the parallel operator as the remaining cases are similar. Assume that /? is a late weak bisimulation. We show that the relation R' = {{p\r,q\r)\ (p, q) e R, r eV] is also a late weak bisimulation. To this end assume p I r - ^ 1 p' \r'. The only interesting case is when a has the form clx. There are two possibilities:
• p - ^ 1 p' and r = r'. Since (/?, q) G /?, there exist y and q' such that q = ^ i q' and for all V G Val there is some q" such that q'[v/y] ==>! <7'' and (/^'[i^/x],^'') G /?. This implies ^g^ | r = ^ 1 ^' | r and, since r is a closed term, {q' \ r){v/y] = q'[v/y] \ r =>i q'' I r. Furthermore {{p' \ r)[v/x], q" \r)eR' because {p' \ r)[v/x'\ = p'[v/x] \ r and {p'[v/xlq'^)eR. • p = p' and r - ^ i r'. Straightforward. The relation ^ i is not a congruence; it is not preserved by + as shown by the following standard example: T.clx ^ 1 clx
but
T.clx + dlx 761 clx -\-dlx.
D
To obtain a relation which is preserved by all the operators we follow the same approach as in the early case, introducing a modified version of ^ 1 : 3.14. Vox p,q eV, pc^iq if and only if • whenever p - ^ 11 then q ^=^1 u for some y and u such that for all v G Val there exists some q' such that u[v/y] =^1 q' and r[i;/jc] ^ 1 q'\ • whenever a G {r, c\v\c e Chan, v G Val] and p - ^ 1 p ' then q = ^ 1 ^' for some q' such that p' ^iq' and similarly for ^.
DEHNITION
The following proposition gives an alternative characterization of ~ i in terms of ^ 1 .
446
A. Ingolfsdottir, H. Lin
PROPOSITION
3.15. p : ^ ! ^ if and only if p -^ r ^i q ^- r for all r eV.
The "only i f direction can be established by showing that {{p -\- r,q -\- r) \ p,q,r eV and /? :^i ^} is a late weak bisimulation, which is straightforward. For the "if" direction, we prove the contrapositive. Assume that p^i q\y^c will prove that p -\~ r ^i q -\- r for some r. By the assumption there exist, for example, a and t such that p - ^ 1 1 and the following holds: • If « is r or an output action, then q =^i u impHes t ^\u\ PROOF.
• If a = clx and q = ^ i M, then there exists some i; e Val such that u[vly] =>iq implies t[v/x] ^i q'. Now choose r to be J?jc.O where d does not occur in p ox q or in the codomain of any renaming functions used in these terms. We show p -\-r qi^i q -\- r. From the assumption we have p -\-r - ^ i t and we will prove that this move can not be matched properly by q -\-r. There are two cases to consider. • lfa = T and u=q -\-r, then t ^i u because the transition u —41 0 cannot be matched by r. • Otherwise, - If a is not an input action then for all u such that q -^r =^ i M we also have q = ^ i u and therefore, by the assumption, t ^\u\ - If ^ is an input action of the form clx then c ^ d. Therefore for any u such that q-\-r =±^1 u it is also the case that q =±>i u. Hence there is some v e Val such that whenever u[v/y] =^i q' then t[v/x] ^i q'. This proves that p-\-r qf^i q-^ r and thus the proposition follows by contraposition. D It follows from Proposition 3.15 that :^i is a congruence relation and that it is the largest such relation contained in ^ i . We refer to ~ i as late observational congruence. There is an alternative way of presenting the late semantics. Instead of using the input transition rule clx.t - ^ i t where the input variable is carried in the transition and the residual is an open term, one can define c?jc.r - ^ i (x)r where the input variable is abstracted away from the transition and (jc)r is a new syntactical category called abstraction. Semantically an abstraction is a function from values to processes. Then the input clause in Definition 3.2 is changed accordingly: If p - ^ 1 / then, for some g, q - ^ i g and (/v, gv) G R for all i; € Val. Abstractions have been used extensively in the study of the TT-calculus [34]. We have chosen to use the open terms presentation because it is in harmony with the symbolic approach, the main subject of this chapter. The bisimulation-based equivalence relations we have studied so far are summarized in Figure 3 where arrows stand for inclusion. 3.3. Translating into pure processes In this section we explain briefly how the language for value-passing processes may be translated into the "pure" language, as proposed in [32, Section 2.8]. We assume the stan-
A symbolic approach to value-passing processes
447
Fig. 3. The relationship between equivalences.
dard notations for pure CCS as in [32]. The key step in the translation is to compile an input prefix into a summation over all possible values in the data domain. So, for each channel name c we introduce a set of action labels {civ, civ \ c e Chan, v e Val} in the pure calculus. The complement of civ is civ, and vice versa. Also for each process identifier P of arity n in the value-passing language we introduce a set of indexed process identifiers {Py\v£ Val"} in the pure language. The translation is defined by induction on the structure of process expressions and is given in Figure 4 where p is the original value-passing process and p its translated form. Furthermore, each parameterized definition P(x) ^ t is translated into a set of nonparameterized defining equations
{P^^t[u/x]\veVar}. Note that this translation is only defined for closed terms. This is sufficient because the only construction which may introduce free variables is input prefixing, and in the translation each input variable is instantiated with a value. Also note that, when Val is infinite, an input prefixing is translated into an infinite summation, and a parameterized definition into an infinite set of non-parameterized equations. Now the resulting terms of the translation are terms in the underlying pure process calculus (pure CCS in this case) which is equipped with a well-defined operational semantics and the standard notion of bisimulation. This provides a simple way of giving semantics to value-passing processes via translation (at the cost of infinity). It is easy to check that the semantics so obtained coincides with the early semantics. To be precise, let -> be the transition relation corresponding to the standard operational semantics of pure CCS (as defined in [32, Section 2.5]). We have the following exact correspondence between the early operational semantics defined in Figure 2 and -^:
448
A. Ingolfsdottir, H. Lin
clx.t
Y^clv.t[v/x] veVal
c\e.t
cllej.t
TJ
T.i
t -{-u
t-\-u
t 1u
t\u
t\L
t\{clv,c\v\ceL]
t[f]
t[fl
where/(c?i;) =/(c)?i;, /(c!i;) == f{c)\v
1f 10
if 1^1 = true otherwise
ifb
thent
P(e) Fig. 4. The translation rules.
LEMMA
3.16. For p,q G V and a eActj, p - ^ e q if and only if
PROOF.
Follows by transition induction, using the definition of p^.
p^-^'q. D
Let ~ be the bisimulation relation as defined in [32, Section 4.2]. The following proposition describes the relationship between ^ e and ^ : PROPOSITION
3.17. For p,q eV, p--eg if and only if ^--g^.
Suppose R is an early bisimulation with (/?, q) e R. Define R = {(p,?) | (/?, q) e R). By Lemma 3.16 it is immediate that ^ is a pure-CCS bisimulation. For the other direction, let ^ b e a pure-CCS bisimulation. Define R = {(/?, q) \ (^,q) e R}. Again it is immediate that R is an early bisimulation. D
PROOF.
The translation approach has been implemented in a tool named VP [3] which acts as a front-end for the verification tool Concurrency Workbench. It takes an input file written in full CCS (with finite data domain) and translates it into pure CCS in a format that can be accepted by the Concurrency Workbench. The translation is carried out exactly according to the rules in Figure 4. 4. Symbolic bisimulations As explained in the introduction, the main problem in connection with the traditional semantics for value-passing processes is that in general it leads to infinitely branching transition graphs. Therefore, to check for equivalence, infinitely many transitions have to be investigated. The aim of this section is to give a more abstract version of the concrete
A symbolic approach to value-passing processes
449
semantics we have considered so far which allows us to check for equivalence by only investigating finitely branching graphs.
4.1. Symbolic operational semantics To motivate the rules for the symbolic operational semantics let us look at a simple example. Let P be defined as
P <= clx.if X >0 then d\x e l s e d\{-x), where x ranges over integers. According to the operational semantics in Figure 2, P has a transition - ^ for each integer «, hence its transition graph has infinitely many branches. This seems counter-intuitive since all P can do is first to input a number from channel c and then output on channel d either the number itself or its negation, depending on whether it is positive or not. This is a finitary description and conceptually we could take P - ^ i f jc > 0 t h e n d\x e l s e d\{-x) as a single abstract transition, without instantiating x. This kind of transition has been used in defining late bisimulation in Section 3.2. However, there the instantiation is only delayed and in the input clause of the definition of late bisimulation, infinitely many comparisons for the residuals are still required, one for each possible value of the data domain. Here we want to go further, to avoid such infinite comparisons as well. As the residual of such an abstract input transition is in general an open term, we will neither be able to evaluate Boolean conditions nor data expressions in output prefixes. Instead we shall allow these expressions to be carried around unevaluated, i.e., symbolically, in the transitions. So in the above example we shall have that i f x > 0 t h e n d\x e l s e d\{—x) ——^-^ 0 and i f jc> 0 t h e n d\x e l s e d\{-x) ^^-^>Q)'^^-^-^^> Q jhis leads to the notion oi symbolic transition relations which have the form - A where ^ is a Boolean expression and a a symbolic action, namely a £ Actf'"^^ = {r, c\e, clx\ce
Chan, e e DExp, x € Var}.
Intuitively t -^ u means that, under circumstances in which b holds, t can perform a and thereby evolve into u. We will abbreviate ^^^*^'^> as - ^ . The set of bound variables of a symbolic action is defined thus: bv(clx) = {x} and bv(T) = bv(cle) = 0. Formally the symbolic operational semantics for the language is obtained by taking T as the set of states, BExp x ActT'''' as the set of labels and -> c T x (BExp x Actf'""^) x T as defined in Figure 5. These relations are defined up-to a-equivalence. The rule PARI has a side condition which ensures that, in the case when a is an input action of the form c?x, the variable x which is local in / will not be confused with any free variables in u. This comment applies to PAR2 as well. The rule COND also has a side condition to make sure that whenever t ^^'^> t' the Boolean condition b does not mention x\ the occurrence of clx in the label of the transition means that typically we are about to introduce x as a
450
A. Ingolfsdottir, H. Lin
PRE
^ true,a
a.t SUMl
t^^f
COND
^
±fb t h e n t
>t
/ > U h,(x I t -\-U > U
SUM2 ^ ,
t +u ^ t ' r
bv(a) nyv(M) = 0
PAR2—^
t\u-^t'\u COM
^ b,c?x ^f t >t
t Iu
REN
h.a
U
PARI
-yv(Z?)nMa) = 0 >t
bv(a) njviO = 0
t\u-^t\u' U
b\c\e
I > U
RES
> t [e/x] I u
r
Chan(a) ^ L
r\L ±^ t'\L
t^t^
REC
t[f] ^-^ nn
' \ P{x) ^ t Pie) ^ t '
Fig. 5. Symbolic transitional semantics.
fresh variable in the sequel t' and therefore x should not be constrained by the already existing b. As an example, the process P defined above has the following (finite) symbolic transition graph derived from the rules in Figure 5.
Note that we do not subscribe these symbolic transition relations because they will be used to define both the early and the late versions of strong symbolic bisimulation. bM
It is easy to check that whenever t —^^ t' then jvQy) £ Pit), bvia) njvib) = 0 and
A symbolic approach to value-passing processes
451
4.2. Early symbolic bisimulation Based on symbolic transitional semantics we now set to define symbolic bisimulation. To motivate the definition, let us consider the two processes P ^ c?jc.((T.ifjc = 0 then J!0 else J!l) + r.J!2), Q ^ c?jc.(T.(ifjc = 0 then J!0 else t/!2) + r.(if x=0 t h e n d \ 2 else
d\\)).
Their corresponding symbolic transition graphs are shown in Figure 6. It is easy to check that p ^e q directly using Definition 3.1 but let us instead have a look at how this fact might be deduced from the symbolic transition semantics. The symbolic move p - ^ Pi can be matched by the corresponding move q - ^ Q\ if we can show that Pi and Q \ are symbolically equivalent. Here special care must be taken as we can not expect, for example, the move Pi —^ Pi i to be entirely matched by one move from Q\, say Q\ —^ g i i . These two moves actually only match one another in the case when the value associated with x is 0. For other values of x this move from Pi has to be matched by Q\ —^ Q\2. In general we must allow a symbolic move from one (open) term to be matched by symbolic moves arising from different components of the other for different subsets of the value space associated with their free variables. We can use Boolean expressions to represent such subspaces. For instance the Boolean expression jc > 1 indicates that jc should be instantiated with integers which are greater than 1. This leads us to considering a symbolic equivalence parameterized by Boolean expressions, ^^. In the present example we will have that Pi i ^^^ Q\\ in the case where b implies X = 0 and that Pi i -^^ gi2 when b implies x i^O. Let us now reexamine how the nodes Pi and Q\ can be properly matched, i.e., why we can claim that P\ ^^ Q\ for a particular b. The most we can hope for in matching the typical move Pi —^ Pi i is that the case we are investigating, represented by b, can be divided up into finitely many different sub-cases Q
Qi
Q 12 x-0. ^!0
.r=0.d\2 / r / 0 . rf!2
Fig. 6. Symbolic transition graphs for P and Q.
\.r^0.rf!l
452
A. Ingolfsdottir, H. Lin
and for each sub-case the move can be properly matched by Q. Such a set of sub-cases can be given by a finite set of Booleans B such that b = \/ B. For example if we are trying to check if P\ ^^''"^ Q\ then we can consider the cases given by 5 = {x = 0, x 7«^ 0}; in the case jc = 0 the move is matched by Q \ —^ Q \ \ while in the case jc 7»^ 0 it is matched by A finite set of Boolean expressions B is called a b-partition if\/B = b. Semantically B can be regarded as a partition of the value space represented by b, or more precisely for any evaluation p, p\=b if and only if p]=b' for some b' e B. In what follows we write a =^ a' to mean that if a = c!^ then a' has the form c\e' with b\=e = e\ and a' = oi otherwise. DEFINITION 4.1. A ^£jc/7-indexed family of symmetric relations S-{S^ \b e BExp} is an early strong symbolic bisimulation if it satisfies: (t,u) e S^ implies that if t — ^ t' with bv(a) njv(b, r, u) = 0, then there is a /? A Z?!-partition B such that for each b' e B there exist ^2,01' and u' with b' \=b2.(x =^' a\ u
~'^> u' and (t\ u) G S^ .
We write r ~ | M if {t, u) e S^ eS for some early symbolic bisimulation S. As an illustration let us consider again the example introduced at the beginning of this section. Let
A2 =
{(P\\,Qu)AP\2,Q\2)}.
A3 =
{PluQl2)AP\2,Q\l)}.
Set S''""' = Ai U A7^ Uid,
5-'=^ = A2 U A - ' U id,
S'^^ = A3 U A"^ U id,
where id is the identity relation. Then S = [S^''"^, 5^^^, 5""^^} is a symbolic early bisimulation. To check this let us investigate (P\y Q\) e S^^"^. We know that Pi -^^^^^^ P\\ and we must show that Q\ can match this move properly. For this purpose we use B = {x =0,x ^0} as the partition for true. Then we have two cases to investigate: x =0 and X 7«^ 0. As an example we consider the first one, JC = 0. If we take ^2 = f^i^^ in the definition then we see that JC = 0 |= rrw^, r = ' = ^ T , Q\ ^'"^'''y Gil and (Pi 1, Gil) € 5'^^, as required by the definition. The reader is encouraged to investigating the other cases keeping in mind that ^ = 0 is a partition for false or any Boolean equivalent to false. In the above example, the need for a partition arises from the Boolean guards carried around in the symbolic transitions. However, this is not the only reason why partitions are needed. Consider, for instance, the following definitions (where jc ranges over integers): P, (JC) ^ c\x -h c!|x| + c!-|jc|, P2(jc)<^c!|x|+c!-|jc|.
A symbolic approach to value-passing processes
453
To establish P\ (x) ^^{^^ P2(x) we need to use a partition {x ^ 0, x ^ 0} (or, equivalently, {x = |x|, X = — |x|}) for true, although all symbolic transitions involved carry only the trivial Boolean guard true. It is w^orth pointing out that when a is an input action of the form c?x, i.e., when * '"^^^ t\ the input variable x may occur free in the partition B. This allows one to perform a case analysis on the value space associated with x before the input transition takes place, thus permitting to use different matching transitions from u for different cases. This reflects the "early instantiation" strategy. As an illustration let us consider again Example 3.7 introduced at the beginning of Section 3.2: P 4= (clx.if
X =0 thena\lx
else
a2^'X) -j-clxMslx,
Q ^ (c?jc.if jc = 0 t h e n (13!JC e l s e «2'-^) + (c?jc.if jc = 0 then^iljc else^sljc). As mentioned before P and Q are early bisimilar. To show that P ^^"^ Q, we need to match the symbolic move P ^^^^^'^'S a^lx by moves from Q. We can use the partition B = {x = 0, JC ^ 0} for true. In the case of JC = 0, this move is matched by Q ^"^^^-ly, i f JC = 0 thenasljc else
a2lx
while in the case of jc 7«^ 0 it is matched by Q ruex.x^ i f JC = 0 thenailjc
elsea^\x.
Here it is essential to use a partition in which x occurs free. Should this be disallowed it would not be possible to establish P "^^"^ QNext we will determine the relationship between the symbolic and the concrete versions of the bisimulations. We start by showing the connection between the symbolic transitions and the concrete ones. Since symbolic transitions are defined for open terms, we need an evaluation mapping which assigns values to data variables. LEMMA 4.2.
For all t, M, p and
p,
(1) tp —^e P if and only if there exist b, t' such that p\=b, p ^a t' p and t - ^ t', (2) tp - ^ e P if and only if there exist b, e, t' such that p\=b, lejp = u, p =a t' p J ^
b,c\e
,
and t > r, (3) tp - ^ e P if and only if there exist b, t' and x ^fv(t) t'p{v/x}andt-^^t\ PROOF.
p. 389].
such that p \= b, p =a
Follows by transition induction. The details of the proof can be found in [17, D
The early strong symbolic bisimulation corresponds to its concrete counterpart in the following sense:
454
'
THEOREM
A. Ingdlfsdottir, H. Lin 4.3. t ^^u if and only iftp ^ e up for every evaluation p such that p\=b.
PROOF (Outline). To prove the "only if" direction assume that S = {S^\be early strong symbolic bisimulation and let
/?s = [{tp, up) \^b,p[=b
BExp]
IS an
and (r, u) e 5^}.
The result follows immediately if we can prove that Rs is a bisimulation. For the "if" direction, assume that R is an early strong bisimulation and let SR = {(t, u)\yp.
p^b
implies (tp, up) e R]
for any Boolean expression b. Again the result follows if we can show that SR = {S^ \b e BExp} is a symbolic bisimulation. Details can be found in [16, Theorem 6.5]. D It follows from this theorem that for closed terms p and q, p ^Q q if and only if As a further corollary to this theorem, if r --^l M then t[y/x] -^E u[y/x] for any y ^fv(b, t,u). Thus symbolic bisimulations are invariant under renaming of free variables. Definition 4.1 requires that, for t and u to be symbolically bisimilar, if t ''^ ^^ t' then u must match this transition with an input transition u ^''"^'S M', on the same channel, using the same input variable. Since the rule PRE in Figure 5 asserts a.t ''"^'"> t, the reader may wonder how to establish that, for instance, clx.dlx and cly.{d\y + d\y) are symbolically bisimilar according to this definition. Since symbolic transitional semantics is defined up to Qf-equivalence, we may choose, for instance, clx.dlx ~a cly.dly
'—^ d\y which can
be matched by cly.{d\y-\-d\y) ^^^'^'\ d\y-\-d\y. Of course we may use any data variable z in the input action, provided it is not free in the terms under investigation. The important fact is that, when comparing a pair of input transitions for symbolic bisimulation, only one such variable is needed. It is immaterial which one is chosen. In general, if t ''"^'^ t\ u ^'^ ^ u' and /' ~ | ' u\ then for any z ^fv(t, w), / ''^'^> t'[z/x], u ~'^'^> u'[z/x], and we also have t^[z/x] "^E U'[Z/X], because symbolic bisimulations are invariant under renaming of free variables. This remark applies to all symbolic equivalence relations discussed in this chapter.
4.3. Late symbolic bisimulation Recall that in Section 3.2, when defining late bisimulations, we have to modify the transition semantics for input prefixing to allow abstract input transitions of the form —^, so that the instantiation of values for input variables can be deferred after input actions are matched for bisimulation. Since the symbolic operational semantics of Figure 5 already uses abstract actions, the same rules can be adopted to define the late version of symbohc bisimulation.
A symbolic approach to value-passing processes
455
4.4. A BExp-indexcd family of symmetric relations S = {5^ | ^ € BExp} is a late strong symbolic bisimulation if it satisfies: (t,u) e S^ implies that
DERNITION
if r - ^ e t^ with bvia) njv(b, r, u) = 0, then there is a ^ A /?!-partition B withyv(5) c Jv{b, t, u) such that for each b' ^ B there exist bi. a' and u' with b' |= bi, a =^ a\
u^-^^u'2ind
{t\u')eS^\
We write t ^^u if {t,u) e S^ eS for some late symbolic bisimulation S. It is important to note that we now require/v(5) c.Jv{b, r, u) (and this is actually the only difference between the definitions of the late and the early symbolic bisimulation relations). This implies that, when a = c?jc, it is guaranteed that x ^fv{B). Therefore case analysis on the value space associated with x is not allowed before input actions are compared for bisimulation. As a consequence, an input transition from one process has to be matched by a single such transition from the other. This reflects the "late instantiation" strategy, and makes all the differences between late and early bisimulations! As an illustration let us consider Example 3.7 again: P ^ (c?jc.ifjc = 0 t h e n fliljc e l s e (32!x)-|-c?x.fl3!x, Q -^ (c?:\r.if jc = 0 t h e n aalx e l s e a2!x) -h (c?jc.if jc = 0 thenai'.jc elsea3!jc). Now it is not allowed for Q to match the move P ^''"^-^'•^ aslx, as any partition that permits this move to be matched by Q inevitably involves x which is not allowed according to the new definition. As in the early case, late strong symbolic bisimulation captures late strong bisimulation in the following sense: THEOREM
4.5. t ^^u if and only iftp ^ i up for every evaluation p such that p \=b.
PROOF. See [16, Theorem 4.5].
D
In Definition 4.4 we note that, whenever / -^^ " holds, each symbolic transition from t may induce a different partition of b. Similarly, different transitions from u may induce different partitions of b. Sometimes it is more convenient to combine these partitions into a fine grain one which works uniformly for all symbolic transitions from both terms (as in the proof of Proposition 5.19). This is possible because there are only finitely many symbolic transitions from each term, as shown in the following lemma. LEMMA 4.6. Assume that t = Y^jOii.ti and u = J2j Pj-^j ^here bv{ai) fl bv(Pj) fl fv(b, t, u) = 0. Then t ^^ u if and only if there exists a disjoint b-partition B with f^{B) ^p(b, r, u) such that for each b' e B the following holds: • For each i e I there is a j e J such that at =^ fij and tj ^^ Uj\ • For each j e J there is an i e I such that a, ='' fij and ti ~ L ";•
456
A. Ingolfsdottir, H. Lin
PROOF. The " i f part of the proof is trivial and we only consider the "only if" direction here. Since t ^^ M, for each / G / there exists a ^-partition Bj with/v(5/) c/v(r, u) such that for each bi e Bi there exists j e J with a/ =''' Pj and r, --'L "y^ similarly for each j e J there exists a ^-partition B'. with fv(B'j) c/v(Z?, r, u) such that for each b'j e Bj, b'
^'i
there exists / e I with a, = J Pj and // ^ L " J Let D/ denote the set of Booleans {A/e/^ I bi e Bi}, Dj the set {Ajejb'j | ^^ G ^y} and set B = {b\Ab2\b\eD/,b2e Dj}. Then y B = b, jv{B) <^jv{b, /, w) and each b' e B has the form (A/^/) A (AyZ?') with bi e Bi, b'j G B'j. For each / G /, ^' |= ^ for some bi G i5/ and therefore there is a 7 G 7 such that a, =^ )Sy and // --^ My. For each j e J b' \= b'j for some b'. e B'. and thus there is an / G / such that a, =^ )Sj and r, "^^ Uj. D A similar lemma holds for early symboUc bisimulation as well.
4.4. 1^(3^; symbolic equivalences Our next task is to define the symbolic counterparts of the weak equivalences we have defined in Section 3 and study their relationships. Unlike in the strong case (but like in the concrete semantics) we need slightly different versions of the weak transition relations to define each of the early and late versions of weak symbolic bisimulation. Therefore we index the early weak transition relations with E and its late counterpart with L. The early weak symboUc transition relations are defined as the least relations over T which satisfy: • t —> u implies t
>E M;
• t —4-==»E M, where bv{a) C)Jv(b) = 0, implies t =^E ^ b,a ^
b\T
.
,.
U\
^ bAb'.a
• / >E—> u implies / >E w. Concerning bound variables we now have: LEMMA
4.7. Ift i ^ E t' thenjv{b) ^MO
U {x} andx ^/v(r).
We have the following relationship between the concrete and the symbolic early weak transitions, similar to the strong case. LEMMA 4.8. Forallt, u, b and p,
(1) tp =^e P if and only if there exist b, t' such that p\=b, p=oi t' p and t = ^ E t'. (2) tp = ^ e P if and only if there exist b, t' such that p\=b, p^a t' p and t = ^ E t'. (3) tp = ^ e P if and only if there exist b, e, t' such that p \= b, le^p = v, p=a t'p and t
>E I '
(4) tp r ^ e P if and only if there exist b, t' and x ifv(t) such thatfvib) ^fv{t) U [x], p{v/x} \=b, p=a t^p{v/x} and t '^ >E t\
A symbolic approach to value-passing processes
457
PROOF. Follows by induction on the definitions of the weak transitions. See [17, Lemmas 4.3-4.6] for the details. D DEHNITION 4.9. A BExp-inde\ed family of symmetric relations, S = {S^ \ b e BExp}, over T is an early weak symbolic bisimulation if it satisfies: {t,u) e S^ implies that
if t -^
t' with bv{a) C\jv{b, t, u) = 0, then there is a ^ A Z?I-partition B such that for
each b^ e B there exist Z72, a' and u' with b' \= bi, a =^' a\ u = ^ ^ E W' and {t\ u') € We write t ^^u'\f
(/, M) G 5^ € S for some early weak symbolic bisimulation S.
Again we have to modify ^ E SO that it is preserved by H-. DEFINITION
4.10. For r, w € T, r ::^| M, if and only if
whenever t ^
t' with bv(a) f)fv(b, r, u) = 0, then there is a ^ A Z?!-partition B such
that for each b' e B there exist bi, a' and u' with b' [= bi, oi =^ a\ u t' ^ ' u'
^'^>E U' and
and symmetrically for u. We refer to : ^ | as early symbolic observational congruence with respect to b. Note that in the definition above it is still essential to use partitions when matching moves. For example T.p cr:^"^ i f /? t h e n z.p e l s e x.r.p but the symbolic move x.p ^^"^''^> p of the left hand side can not be matched properly by a single symbolic move from the right hand side. The two versions of early weak bisimulation equivalence/congruence can be related as in the case of strong bisimulation. THEOREM 4.11.
(1) t ^^u if and only iftp ^ e up for every p such that p \= b. (2) t c:^^u if and only iftp 2::e up for every p such that p\=^b. PROOF. See [17, Theorem 4.2].
D
In the rest of this section we introduce the late version of weak symbolic bisimulation. Again, care must be taken when defining the corresponding weak symbolic transition relations and, like in the definition of =>i, we should not allow input moves to absorb r moves that occur after them. The late weak symbolic transition relations are defined as the least binary relations over T satisfying the following rules.
458
A. Ingolfsdottir, H. Lin true. ^Lf,
• t —> u implies t ==^L «; • t
b,T
b',a
> = ^ L « , bvia) njv(b) = 0, implies t = = ^ L W;
• if Of is not of the form clx then t = ^ L — ^ w implies r = = ^ L "• The late counteipart of Lemma 4.7 is stated as follows: LEMMA 4.12. Ift ^ ^ L t' thenjv(b) £M0
^ndx
^p{t).
DEFINITION 4.13. A BExp-'mdexcd family of symmetric relations S = {S^ \b£ BExp] is a late weak symbolic bisimulation if it satisfies: (r, u) G 5^ implies that if t — ^ r' with bv{(x) npib, t,u) = 0, then there is a /? A ^i -partition 5 with/v(^) c Jv(b, t, u) such that for each b^ e B there exist Z?2, «' and M' with b' |= Z?2, a =^ a\ u = ^ ^ L "' and such that • if a = clx then there is a /^'-partition ^ ' such that for each b'' e B' there are ^2 and u" with ^'^ h ^2' "' ^ L • otherwise (/',«') e S^'.
"'' and (r^ M^') G 5^";
We write / ^ | M if (^ M) G 5^ G S for some weak late symbolic bisimulation S. In the above definition another partition ^', in which the input variable x may occur free, is needed after two input transitions are matched, and for each b" in B' (symbolic) r-moves after the matching input transition are abstracted away. This concurs with the input clause in the definition of late weak concrete bisimulation where r-moves following the matching input transition get absorbed only after the input variable is instantiated. As usual late symbolic observation congruence is defined in terms of late weak symbolic bisimulation: DEnNiTiON 4.14. For f, M G T, r :^^ M, if and only if whenever t ^ t' with bv{a) njv(b, /, u) = 0, then there is a Z? A Z?i-partition B with yv(5) ^jv(b, t, u) such that for each b' e B there exist bi. oi' and u' with b' \= ^2, a =^ a\ u = = ^ L w' and such that • if a = clx then there is a /7'-partition B' such that for each b'' G B' there are b2 and M'' such that b'' |= ^2. "' ^ ^ L U" and t' ^ t ' "''^ • otherwise t' ^^ u' and symmetrically for u. We refer to —^ as late symbolic observational congruence with respect to b. We have the late counterpart of Theorem 4.11:
A symbolic approach to value-passing processes THEOREM
459
4.15.
(1) t ^^u if and only iftp ^ i up for every p such that p \= b. (2) r :^L " if and only iftp2:ii up for every p such that p\=b. PROOF. See [17, Theorem 5.1].
D
5. Proof systems This section is devoted to developing proof systems for the bisimulation-based equivalences over various fragments of our value-passing language. We will consider finite, i.e., recursion-free, processes first and also postpone the parallel composition, renaming and restriction operators to a later section. For technical convenience we start with late bisimulation.
5.1. The Core system A neat equational axiomatization for strong bisimulation was presented in [20], as shown in Figure 7. This set of axioms is sound and complete for recursion-free pure CCS with 0, prefix and choice operators, in the sense that two finite processes are strongly bisimilar if and only if they can be proven equal from these axioms using equational reasoning. To generahze it to value-passing processes a key issue is how to deal with input prefixing, because this is exactly where data variables are introduced. A possible solution is to add the following rule: CO-INPUT ^[^Al = i^[v/y] for each i; e Val clx.t = cly.u In fact it can be shown that the resulting proof system is sound and complete for early strong bisimulation over recursion-free value-passing processes. However the problem here is that to apply the a;-iNPUT rule we have to inspect an infinite number of premises when Val is infinite, and therefore this rule is of little practical use. To obtain an effective proof system we need to replace the rule CD-INPUT with a finitary one. As the infinity in the rule is caused by instantiating input variables with all possible values from the data domain, to avoid such infinity we should be prepared to deal with open terms. Inspired by the work on symbolic bisimulations, which are indexed by Boolean
51 52
X-hO = X X -h X = X
53 x - f y = y + x
54 (x-hy) + z = x-h(y-fz) Fig. 7. The axioms for strong bisimulation.
460
A. Ingolfsdottir, H. Lin EQUIV a-CONV AXIOM
t —U t =zt
clx.t
t = U
U=t
y iMt)
=^cly,t[y/x]
true t> t = u
M = U
t — V
r = M IS an axiom instance
CHOICE
b\>t = t' b[>t-^u = t'-^u
INPUT
b[>t = u b[>clx.t = clx.u
OUTPUT
b\=e ^e', b> t = u b > de.t — cle'.u
TAU
b>t = u b\> r.t = XM
COND
b Ab' >t=:u bA'-^b'[>0 = u b> if b' t h e n r = u
PARTITION ABSURD
b\=zb\Vb2,
X
b\C>t=:u b[> t = u
iHb)
b2>t — u
false [> t = u Fig. 8. The inference rules.
expressions, instead of pure equations we employ conditional equations of the form b t> r = M, where the condition ^ is a Boolean expression, as judgments of our proof system. The intended meaning of Z? t> r = M is that "r ~^^ u'\ or *7 and u are bisimilar when the variables that occur free in these terms are instantiated with values satisfying b'\ In this setting ordinary equations are regarded as special conditional equations with the condition being true, i.e., r = M is taken to be an abbreviation for true t> r = M. Reasoning about value-passing processes will inevitably involve reasoning about data. However, instead of inventing proof rules for all possible data domains, we would like to factor out reasoning about data from reasoning about processes as much as possible. Therefore our proof system will be parameterized over data reasoning of the form ^ |= ^ \ with the intuitive meaning that whenever b is true then so is b'. Asa. consequence, all the completeness results in the following sections are relative to data domain reasoning. The proposed inference rules are listed in Figure 8. Before starting to investigate properties of this proof system, some informal discussion about these rules are in order.
A symbolic approach to value-passing processes
461
The set of inference rules we put forward can be seen as a natural generalization of pure equational reasoning. For each construct in our language there is a corresponding introduction rule. The OUTPUT rule refers to reasoning about data domains by including b \= e =:e^ in the premise. It says that if we can deduce a statement b \> t =^ u from this proof system, and we know that b implies e = e' from the knowledge about data, then we can conclude that b t> cle.t = c\e\u. The INPUT rule requires a side condition which guarantees the input variable to be "fresh". This is crucial to the soundness of the rule. Without this proviso we could, for instance, derive x = 1 \>clx.c\\ =c?jc.c!x from jc = 1 [> c!l =c\x. The premise is true but the conclusion is false. With the side condition this derivation is not possible because x is free in the condition JC = 1. The introduction rule for the conditional construct is COND which performs a case analysis; an identity of the form if b t h e n / = u can be established by considering two cases, one when b is true and the other when it is false. Finally there are two "structural rules", PARTITION and ABSURD, which do not deal with any specific constructs in the language, but are useful to "glue" pieces of derivations together. The PARTITION rule allows partitioning of the current value space, represented by b, into two subspaces, represented by b\ and b2, respectively. Like OUTPUT, this rule also requires the establishment of facts about the data domain. Taking b\ =b2=b' \i specializes to a useful rule
CONSEQUENCE-^ ^^''^'^' = " b\>t — u
We write \-b\> t = uio mean that b> t = u can be derived from axioms S1-S4 using the rules in Figure 8. With a slight abuse of notation we will also use h to denote this set of rules and axioms. The soundness of h is stated below: THEOREM
5.1. If\- b>t = u then tp ^i up for any p such that p\=b.
PROOF. The proof follows by induction on the derivation ofb>t on the last rule used.
= u and a case analysis D
Before embarking on the task of proving the completeness result, we first establish some useful facts about the proof system. PROPOSITION 5.2.
(1) Ifb [= ^b' then V-bt>itb' t h e n t = 0; (2) ifb (= b' then \-b>t = ifb' t h e n r;
462
(3) (4) (5) (6) (7) (8)
A. Ingolfsdottir, H. Lin
h i f /? t h e n ( i f b' t h e n t) = ±lbAb' t h e n t\ l-r = r H - i f ^ t h e n r ; \-b Ab' >t ^u implies \-b[> if b' t h e n r = i f ^' t h e n M; f - i f Z? t h e n ( r + w) = i f / ? t h e n / + i f 6 t h e n w ; \- if b t h e n w + i f b' t h e n M = ifb\/b' thenw; if Mb) n bv{a) = 0 then \-if b t h e n a.r = i f ^ t h e n Qf.(if b t h e n t).
We only give the details of the proof for three of these statements. (1) An application of COND reduces the goal to
PROOF.
^ A ^' > r = 0
and
bA^b'>0
= 0.
The first subgoal can be settled by CONSEQUENCE and ABSURD, while the second follows by EQUIV. (4) Because true \=bv -^b, by the PARTITION rule it is sufficient to prove the two statements |-Z?i>r = r + i f ^ t h e n r
and
f---Z? t> r = / 4 - i f Z? t h e n r .
(1)
By S2 and CHOICE the first part of (1) can be reduced toh b\>t = if b t h e n /. By COND this can be further reduced to hb Ab[>t = t
and
b A'-'b^t
=0
which are simple consequences of EQUIV and ABSURD, respectively. The second part of (1) can be derived from S1 and Proposition 5.2.1. (8) Two applications of COND and ABSURD reduce this to \- b[>a.t =Qf.(if b t h e n r ) . The proof then proceeds by a case analysis on the form of a. For example if it is c?jc, by assumption jc ^Jv(b) and therefore, by INPUT, it can be reduced to h ^ > r = i f ^ t h e n r, which follows from Proposition 5.2.2. If a is r or c\e the reasoning is even more straightforward. D This proof system is complete for late strong bisimulation over the recursion-free subset of our value-passing language, as stated in the following theorem. THEOREM
5.3 (Completeness of h). t ^^ u implies \-b\> t = u.
As in the case of pure CCS, the proof of this theorem proceeds by induction on the heights of terms and relies on the notion of a normal form. DEFINITION 5.4. The height of r, denoted |r|, is defined inductively as follows: (1) | 0 | = 0 ;
A symbolic approach to value-passing processes
463
(2) |r + M|=max{|rUM|}; (3) | i f Z7then/| = |r|; (4) \a.t\ = l-h\t\. 5.5. A process term / is a normalform, or is in normalform, if it has the form J2i^i i f bi t h e n a/.r, where each // is in normal form (by convention the sum above is taken to be 0 when the index set / is empty). DEFINITION
5.6. For every term t there exists a normal form t' such thatfv(t) =fv(t'), \t\ = \t'\ and \-t = t'.
LEMMA
PROOF. By structural induction using the elementary facts about the proof system given in Proposition 5.2. D PROOF OF THEOREM
5.3. By Lemma 5.6 we may assume that t and u are in normal
form: t = 2 j i f ^/ t h e n a/.//,
u = T ^ i f dj t h e n Pj MJ .
iel
jeJ
The proof proceeds by induction on |r| + |M| where the base case follows immediately. For the inductive step we first show that \- b ACi [> M + i f c/ t h e n of/ .r,- = u
(2)
for each iel. For the proof of (2) we only examine the case a, = c?x (the remaining cases are similar). By a-conversion we may assume x ^fv(b, t, u). Since t ^i^u and t " > //, there exists a Z? A c/-partition B such ihdXfv{B) ^fv{b, t, u) and for each b' e B there is a j e J such that b^ \=dj,u
^' "> Uj and // ^^ Uj. By induction
\-b' \>ti =Uj.
Since x ^fv(b^), applying INPUT we obtain \- b' [> clx.ti = clx.Uj. Since b' \= Ci and b' \= dj, by Proposition 5.2.2 and transitivity \- b' [> if Ci t h e n clx.ti = if dj t h e n clx.Uj. Using S2 we derive that \- b' \> u -\- if Ci t h e n clx.ti = u.
464
A. Ingolfsdottir, H. Lin
Since V ^ = ^ A c/, by a repeated use of PARTITION \-b /\Ci O M H- i f c/ t h e n clx.ti = u. This is the required (2) above. Now we proceed with the completeness proof as follows. By Proposition 5.2.1 h ^ A ->Ci > i f c/ t h e n «/ .f/ = 0 and thus, by CHOICE and S1 h ^ A -"C/ [> u -\- if Ci t h e n a,-.// = M .
(3)
By (2), (3) and PARTITION h b\> u-\- if Ci t h e n a/ Jj = u. This is true for each / € / . By repeated use of this property we get hb>u-^t
= u.
Symmetrically we can derive \-b>u-ht
=t
and the result follows by transitivity.
D
5.2. The axioms for early bisimulation As explained in Section 4.2, early bisimulation differs from late bisimulation only in that, when matching an input transition from one process, it is possible to use input transitions from different components of the other for different input values. Reflected at the syntactical level, to obtain a proof system for early bisimulation from the late one, what is needed is a rule which allows us to "break" the scopes of input prefixes at the same level. This can be achieved in two ways: either by adding a rule schema or an axiom schema to the proof system for late bisimulation. The axiom schema for early bisimulation was first proposed in [39] for an axiomatization of the TT-calculus, and is adapted for value-passing processes in [17]. The rule schema was used in [17]. Here we first include into our system the axiom schema which has the following form: EA
clx.t -h clx.u = clx.t + clx.u + c?jc.(if b t h e n r -h i f --Z? t h e n u).
Note that here b is an arbitrary Boolean expression. It is not difficult to see that the proof system is sound with respect to ^ g . Let us write h-E ^ t> / = w to mean that b> t = u can be deduced from the proof system of the previous section extended with EA. EA can be generalized to allow arbitrary summations as follows.
A symbolic approach to value-passing processes
5.7. For any finite set ofBooleans [bi \\ ^i ^n) such that = b and bi A bj = false for i ^ j ,
PROPOSITION
l-E^>
PROOF.
^
clx.ti=
^
c?jc.r/+c?jc. ^
465 VI^/^AZ^'
itbithenti.
See [17, Proposition 3.1].
D
Now we have the following counterpart of Theorem 5.3. THEOREM
5.8 (Completeness of HE), t ^ ^ u implies \-^b\>t = u.
PROOF. The proof follows the same pattern as the proof of Theorem 5.3, using Proposition 5.7. See [17, Theorem 3.2] for the details. D
Another way of dealing with the early case is to replace E A by the following rule schema
E-INPUT .J'^^%'\''^J'^'iY^
. ^iMb).
This also is quite general but at least its application only depends on the structure of the terms in the proof being elaborated. Note that the use of r in this rule is essential. If r is omitted then the rule becomes X ifv{b) which is not sound with respect to early strong bisimulation. For example since (p 4- ^) 4r = / 7 4 - ( ^ + / ' ) w e could use this rule to derive clx.{p + ^) + clx.r = clx.p + c'?x.(q + r) for which there are obvious counterexamples. With the help of COND and PARTITION, EA can be easily derived from E-INPUT. Hence the proof system obtained by replacing the axiom schema EA with E-INPUT is also complete.
5.3. The T laws One of the classical results in the theory of bisimulation is that, adding the three r laws, presented in Figure 9, to the complete axiomatization of strong bisimulation results in a complete axiomatization of observational congruence. The aim of this section is to show that this result carries over to value-passing processes. We start with the late equivalence.
466
A. Ingolfsdottin H. Lin
Tl
a.r.X=a.X
T2
X - f r . X = r.X
T3
a.(X + r.y) - h a T = a.(X + r.F) Fig. 9. The r laws.
Let us write I-^L b [> t = U to mean that b\> t = u can be deduced from the core system extended with the r laws. The structure of the completeness proof below follows closely a corresponding proof in pure CCS [32]. As in that reference, the proof relies on a notion offull normal forms which are r-saturated. But again here we need to be careful with the r transitions occurring after an input action; they should not be absorbed. These r actions will be dealt with in the proof of the main theorem. DEFINITION
5.9. A normal form t = J2ie/ ^^ ^' t h e n of, .r, is a late full normal form if
/ = > L t^ imphes / - ^ /' and each /, is in late full normal form. To show that every term can be transformed into a late full normal form we need a lemma permitting the absorption of r actions by syntactic manipulation. This lemma requires a generalization of T3: 5.10. Iffv{b)r\bv{oi) = 0 then I-^L c(Xt -hifb T.u) + i f Z? t h e n a.u.
LEMMA
PROOF.
See [17, Lemma 4.7].
5.11 (Absorption). / / t t h e n Of.r^
LEMMA
ifb
PROOF.
t h e n r.u) = a.(t -\-if b t h e n
D ^ L
t'^ ^ith fv{b) n bv{a) = 0, then h^^^ t = t -\-
See [17, Lemma 4.8].
D
With the absorption lemma it can be easily shown that every term is equivalent to a late full normal form: 5.12. For any normal form t there is a full normal form t' such that p(t) \t\ = \t'\andY-^i,t = t'.
LEMMA
=p{t')y
By this lenmia and Lemma 5.6, every term can be transformed into a full normal form of equal height. We need one more ingredient for the completeness proof. PROPOSITION
r ~ | uort:^^
5.13. t^^u if and only if there is a b-partition B such that for all b' e B, r.u or r.t :^| u.
A symbolic approach to value-passing processes PROOF.
See [17, Proposition 4.2].
THEOREM
467 D
5.14 (Completeness of I-WL)- l —t w implies hwL b\> t = u.
PROOF. See [17, Theorem 5.3].
D
As in the case of strong equivalence, to obtain a complete proof system for early observation congruence, all we need is to add either the axiom schema EA or rule schema E-INPUT to the proof system. For the sake of variation here we use E-INPUT. So let us write hwE b[>t = uio mean that b\>t — u can be deduced from the proof system for f-^L plus E-INPUT. As can be expected, the proof of the completeness result for early congruence differs from that for late only in the case of input prefixing. The E-INPUT rule has a generalized form: PROPOSITION
5.15. Suppose x ^fvib.a.dj),
i el, j e J. Then from
l~wE b > ^ i f Ci t h e n r.r,- = Y ^ i f dj t h e n T.UJ iel
jGJ
we can infer ^~wE b > y ^ i f Q t h e n clx.ti — Y ^ i f dj t h e n clx.Uj. iel PROOF.
jeJ
See [17, Proposition 4.3].
THEOREM
D
5.16 (Completeness of f-^E)- t cn^ u implies hwE b> t = u.
PROOF. See [17, Theorem 4.3].
D
5.4. Adding other operators So far we have concentrated on the core language which does not include the restriction, renaming and parallel composition operators. These operators are however easy to axiomatize. The equations characterizing the restriction and renaming operator are the same as for pure processes and are listed in Figure 10. These laws are all fairly standard and need no further explanation. The expansion law for the parallel operator, shown in Figure 11, is an adaptation of the one proposed in [39] for the TT-calculus. We know from the previous sections that '^e, —e, ^ i and :^i are all preserved by the new operators. It is also easy to check that the new equations are sound for these congruence relations. Moreover, by adding these new equations to the core proof system, each term in the extended language can be transformed to a term in the core language. This in turn ensures the completeness of this extended proof system over the extended language with respect to each of the equivalences mentioned above.
468
A. Ingolfsdottir, H. Lin
0\L = 0 (X + Y)\L - X\L + Y\L
0[/] = 0 (X + Y)[f] = X[f] + Y[f]
«.W = {«<^\» ^'^t'i
(«.«l/l = /(«).x|/,
Fig. 10. Axioms for restriction and renaming.
Let t = X;. aiJi and u = J^j fij-i^j^ with/v(r) D bv{u) =JvW ^ M O = 0- Then t \u = syncjnove{t, u) + async jnove{t, M), where syncjnove{t,u)
= V]{r.(r/[^/jc] | Uj) \ ai = c ? x , ^j =c\e\ + ^{T.(r/ I Uj[e/x])\ai^c\e.
fij^clx].
asyncjnove{t, u) = /^otj.(tj | M) + /_])^7-(^ I wy)'•
J
Fig. 11. The expansion law.
5.5. Reasoning about recursion The proof systems considered so far are complete with respect to the corresponding equivalence relations over finite processes only. Processes exhibiting infinite behaviours are defined recursively. To be able to reason about infinite processes we need inference rules to handle recursion. For this purpose it is more convenient to have recursion terms in the language, instead of using process identifiers and defining equations. In pure CCS recursive terms can be constructed using process variables and the fix operator: if X is a process variable and r is a process term then fix Xt is a recursive term. However, in the value-passing calculus, a process variable with non-zero arity needs to take data parameters to form a process term. With the notation fix Xt it is not clear how free data variables in t are bound, and what are the free variables and parameters of this term. To avoid these confusions we will usQ process abstractions instead of process terms to form recursions. Let PVar be a countably infinite set of process abstraction variables (or just process variables for short), ranged over by X, Y, Z etc. Each process abstraction variable is associated with a non-negative arity indicating the number of data expressions it should take to form a process term. We add a new kind of process term and a new clause for abstractions to the language introduced in Section 2. Also we shall omit parallel composition, restriction and renaming operators. The resulting language is known as regular value-passing
A symbolic approach to value-passing processes
469
CCS and has the following BNF grammar: t F a
:::= 0\aJ\t-\-t\ifb X\{x)t\^xXF : := := T \clx \c\e
then
t\Fe
An abstraction is either a process variable X, a process abstraction {x)t (where ^ is a vector of distinct names), or a recursion abstraction fix XF. The degree of an abstraction is defined as follows: The degree of X is the arity of X; the degree of (J)/ is the length of J\ the degree of fixXF is that of X which is required to be equal to the degree of F. Abstractions can be applied to data expressions to form process terms, and in Fe we always require the length of e to be equal to the degree of F. In (x)t each data variable in J is bound in t. In a recursively defined term, fixXF, the process variable X is bound in F. As usual a variable which is not bound in t is called free in r. We will write BV{t) and FV{t) for the sets of bound and free process variables in r. A term is data closed if it contains no free data variables. A term is process closed if it contains no free process variables. A term is closed if it is both data and process closed. A term is data open if it is not data closed and it is process open if it is not process closed; it is open if it is either data open or process open. We will only use data closed abstractions, so in (x)t it is always required thatyv(/) c {J}. A process variable X is (weakly) guarded in a process term or an abstraction if each free occurrence of X is within the scope of some prefix operator a... Using data closed abstractions to form recursion terms has two main advantages: In a recursion term {^\X(x)t)e the free data variables are exactly those of ^, and the passing of the actual data parameters 'e to free occurrences of the recursion variable X in r is taken care of by yS-conversion. As a consequence the inference rules for recursion become very simple, as simple as those for pure calculi. For instance, the rule for recursion unfolding is simply fixXF = F[fixXF/X]. Below is an example demonstrating how this rule acts (where F stands for (x, y){c\{x + y).dlz.X{z. y))): (fixXF)(M + l , i ; - 1 ) RFC = {(X, y){c\(x + y).dlz.mXF)(z, J ) ) ) ( M + 1, V - 1) RFTA ' " ^ ' ^ (c!(jc + y).J?z.(fixXF)(z, y))[u + 1, i; - 1/JC, y] = c\(u + 1 + i; - l).J?z.(fixXF)(z, i; - 1) = c\{u + i;).J?z.(fixXF)(z, i; - 1) The concrete and symbolic transitional semantics for recursion are given by the rules n x and FIX, respectively, in Figure 12. The definitions of all the versions of bisimulations are the same as before, but since now we have a new syntactical category, namely abstractions, we need to extend the notions of bisimulation to it. We may wish to extend bisimulation to open process terms as well. This can be easily done by requiring that two open terms are bisimilar if and only if all their closed instantiations are, and two abstractions are bisimilar if and only if all their applications to data parameters are. To be precise, let ^ be the
470
A. Ingolfsdottir, H. Lin FIX —
^^ ' ' ^^ ' ..^ , (fixX(J)/)e-^r'
where v^le\
FIX ^[fa^(^^/^][^/^] - ^ ' ' (fixX(]c)Oe-H/' Fig. 12. Operational semantics for recursion. RFC fixXF = F [ f i x X F / X ]
CONGR-fix
ABS
F = G
fixXF=fixXG
' = " (x)r =: U)M
A P P ^ - ^ BETA
(ix)t)e = t[e/x]
Fig. 13. Inference rules for recursion.
generic symbol for different bisimulations. Then r '^ M if and only if t['p/X] ^ u['p/X], where X = FV(t, M), for any closed terms ~p. F ^ G'lf and only if Fe ^ Ge for all vectors of values (in the case of concrete bisimulations) or data expressions (in the case of symbolic bisimulations) 'e. The proof rules for recursion are presented in Figure 13. REC is the standard rule for recursion unfolding and CONGR-fix expresses that all bisimulation equivalences we consider are congruent with respect tofix.Rules ABS and APP allow us to switch between abstractions and process terms. The most interesting rule is UFI, for Unique Fixpoint Induction. It asserts that every guarded abstraction has exactly one fixpoint. Syntactically it appears the same as its counterpart in the pure calculus [31]. However, here it works at the level of abstractions, while in the pure case it works at the level of processes. The latter can be viewed as a special case of the former when the arity of the process abstraction involved is 0. Let us write hr ^ t> r = w (where t and u may also be abstractions) to mean that b> t = u can be derived using the core rules and axioms in Section 5.1 together with the rules in Figure 13. We state the soundness of h^: THEOREM
5.17. If hrb\>t
= u then tp^i up for any p |=/?.
A symbolic approach to value-passing processes
471
For the completeness result we shall confine ourselves to guarded terms. As we have seen in the previous sections, to obtain a completeness result, a key instrument is the notion of a normal form whose syntax directly reflects its symbolic transition semantics. The completeness proof can then be performed by induction on the "height" (the maximum nesting depth of action prefixes) of the normal forms. This works fine for finite terms. But since the language we are considering now includes recursion we can not rely on such simple notion of a normal form. Instead we use standard equation sets. LetX = {Xi,X2, ...,Xfn} and W = {W\,W2,..., W,,} be disjoint sets of process variables. Then E:Xi(xi)
= Hi,
l^i^m,
whevcJv(Hi) c [xi} and FV(Hi) c X UIV, is an equation set with formal process variables in X and free process variables in W. E is process closed if W = 0. £" is standard if each Hi has the form
In Xf(i^k,p)^ the notation / ( / , k, p) is used to indicate that the subscript depends on /, k and p. An abstraction F provably satisfies equation set E if there are F = { F i , . . . , F,,} with h r F = Fi such that \-rbi>Fi
=
(xi)Hi[F/X].
A process term t provably Z?-satisfies equation set E if there exist b and 7 with Jv(bi) U Jv(ti) ^ {^/}, I ^i ^m,b\ =b and hj^ b\ [> t\ = r, such that h r bi > ti = Hi[(xk)(if
bk t h e n tk)/Xk | 1 ^ ^ ^ w],
1 ^ / < m.
We will simply say that "r provably satisfies E"" when b = true. Following [31], the proof of the completeness theorem consists of three major steps: First we show that each guarded term provably satisfies a standard equation set; then we show that if two terms are symbolically bisimilar over b then a single guarded equation set can be constructed which is provably ^-satisfied by both terms; finally we show that if two terms t and u both provably satisfy a guarded equation set over b then \-rb> t = u. PROPOSITION 5.18. Any guarded process term t provably satisfies a standard equation set E. Moreover, ift is process closed then so is E. PROOF.
By mutual induction on the structures of process terms and abstractions.
D
PROPOSITION 5.19. Assume that t and u are guarded process terms. Ift ~ L " ^^^^ f^^^^ exists a standard equation set E such that both t and u provably b-satisfy E.
472
A. Ingolfsdottir, H. Lin
PROOF. For simplicity we assume t and u are process closed. It is straightforward to extend the proof to the case when they contain free process variables. Let E\ and £2 he the standard equation sets for t and w, respectively:
Ex : Xiixi) = ^
i f Cik t h e n ^
keKi
El: Yjiyj)
oiikp.Xfi^iM,p)(eikp). i ^ L
pePti,
= X ^ i f dji t h e n ^ leLj
Pjiq'yg{j.Lq)(^'jiq)^
J ^ J^
qeQji
where 'xj (1 yj = 0, and all input prefixes in £"1, £2 use the same bound variable not appearing in E\ or E2. Thus there exist //, Uj with/v(r/) c ^i,jv(uj) c 'yj such that l-r ^/ = ^
i f Cik t h e n r,-^,
(4)
hr w^- = 2 ^ i f ^7/ t h e n wy/,
(5)
keKi
where Uk = 2 I ,
^ikp'tf{i.k,p)[eikp/'Xf{i,k,p)].
pePik
For each pair (/, 7), let ^/y withyv(Z7/y) c {x,, y^} be such that, for any p, p \= bij
if and only if
/ / p ^ i Ujp.
The bij are the weakest conditions under which /, and Uj are bisimilar. In fact we can show that for any b' tile/xi] -'^' Uj[e'/yj]
implies
b' \= bij[e, e'/xi,yj].
(6)
To this end, assume ti[e/xi] -'^' Uj[e'/yj] and p \= b\ By Theorem 5.17 we have ti[^/xi]p ^i Uj[e'/'yj]p. Because Jc/ and yj are disjoint, this can be rewritten as tip[e, e^XiJj]
--I Ujp[e,
e'/xi,yj].
Hence, by the definition of bij, p[e, e'/xi, y^] N ^0 • Therefore p \= bij [e, e'/Ji ,yj]. In particular, taking / = 7 = 1 in (6) we get b\=b\\[e\, e\/Ji, Ji]. Set bikji = Cik A dji A bij. Since both {C/A \k e Ki] and [dji | / e Ly} are disjoint sets of Booleans, to, ~/'^^' «;/. Let Bikji be the ^,7:^/-partition guaranteed by Lemma 4.6. For
A symbolic approach to value-passing processes
473
each b^ e Bikji define
tf{iM,p)\eikp/XfUM.p)\
^i
^gij^Lq)[^jlq/y^ijJ.q)]}'
Note that each /^ is total and surjective on Pjk x Qji. Let {Zij I / € /, j e J} be a set of new process variables and
Consider the standard equation set E: Zij{Xi Jj)=
J2
i f ^'^' ^ ^i/ ^ h e n ^
k^KiJeLj
V^',
/ G /, 7 G J.
b'eBikji
We claim that E is provably Z^-satisfied by t when each Z/y is instantiated with (xiyj)(if bij t h e n //). We are to prove that, for each /, j \-^bij>ti
=(
Yl
if Cik Adji then
where (9/y = [(x/yy)(if ^7 t h e n r/)/Z,7 \i£lj be reduced to, for each pair ofkj l-r bikji >Y^if
J2
^)^iJ^
C^)
e Jl By (4) and PARTITION (7) can
Cik t h e n tik = i f c/^- A dji t h e n
^
V'' fty
which, by Proposition 5.2 (noting that /7/A77 N QA A t/y/) and PARTITION, can be further reduced to, for each b' e Bikji \-^b'>tik
= V^'Oij.
(8)
We can derive (8) as follows h r b' > V^'Oij
then BETA
\->
=
2^
. _ ,
r
^/A'/vlf Ofi^i^k.p)g(j.Lq)Yeikp.
tfa.k.p)){eikp,e'ji^) _,
_
^jlq/^f(i.k.p)^
y^iij-l^cj)]
ip^q)el^' then
tfii^k.p)[^ikp/^fU.k.p)]
-I
474
A. Ingolfsdottir, H. Lin =
Yl
^'^P-if ^' t ^ ^ ^ ^f then
='
^
5.2
=
tf^i^k.p)['^ikp/^f{i,k,p)]
oiikp-^f b' t h e n tf^i^k.p)[eikp/xfii,k.p)]
22
S2-S4 Y ^ = 2^
^fii.k.p)g{j.Lq)[eikp,eji^/Xf(^i^k,p).yg{jJ,q)]
^ikp'ffii,k.p)[eikp/Xf(i,k.p)] ^_ ,_ -, (^ikp-tf{i,k,p)[eikp/Xfu,k.p)\
pePik
=
tik.
The step last but one relies on V^' being total. Symmetrically, using the fact /^ is surjective, we can show E is provably Z?-satisfied by u. D PROPOSITION 5.20. Let E:Xi (x, ) = //,, \ ^i ^m,bea u both provably b-satisfy E then h^ b\> t = u. PROOF.
standard equation set. Ift and
Similar to the proof of Theorem 5.7 in [31 ].
D
Summarizing the above three propositions gives the completeness theorem: THEOREM
5.21. For guarded process terms t and u, t ^^u implies hr b> t = u.
It can also be shown that adding EA or E-INPUT to hr gives rise to a proof system for early bisimulation, complete over guarded processes. Furthermore, with the addition of the three r-laws these proof systems can be extended to observation congruences. The details are rather involved and are omitted here. So far we have only considered guarded recursions. For pure CCS there are elegant laws which are sufficient to remove all unguarded recursions [33] and thus extending the axiomatization to the whole regular language. However, in value-passing calculi the combination of unguarded recursion and the conditional construct may result in non-trivial situations. For example let us consider processes P and Q defined as P ^ Q ^ Q'{x) ^
clx.dlO.P, clx.Q\x), i f jc=0 then
JIJC.Q
e l s e Q\x - 1),
where x ranges over natural numbers. Clearly P and Q are equivalent, but in order to derive this we need to rely on the inductive nature of natural numbers, and close interaction between reasoning about processes and reasoning about data becomes inevitable.
A symbolic approach to value-passing processes
475
6. Summary and related work We have discussed the compHcations arising from generalizing the standard theory of pure process algebra to the value-passing setting, and presented an approach to tackle these problems. The main focus is on the theory of bisimulation. We have demonstrated how the data aspect can be separated from processes so that a theory of bisimulation for valuepassing processes can be developed without depending on any particular theory of data. This "symbolic" approach manipulates open terms with Boolean expressions constraining their free data variables, in contrast to the traditional process algebra theory which only deal with closed terms. As a result the problem of infinite branching, due to instantiating input variables with values, is avoided, while the standard bisimulation equivalences are captured. We have also developed finitary proof systems for the various bisimulation-based equivalences in our value-passing language. Again, reasoning about data is separated from reasoning about processes. These proof systems preserve the standard equational axioms for bisimulation-based equivalences while generalizing equational reasoning by introducing inference rules. There are many aspects of value-passing calculi that are not covered in this chapter. Denotational semantics for value-passing processes is discussed at length in [14,15]. Various modal logics have been proposed for such processes [19,43]. Algorithmic aspects are addressed in [26,36,27]. The "symbolic" style proof systems presented in Section 5 has been implemented in the interactive proof assistant VPAM [25]. In our language, channel names have been separated from values and hence are not allowed to be transmitted between processes. Lifting this restriction results in a very expressive language known as TT-calculus which is covered in [38], Chapter 8 of this Handbook. For other approaches to value-passing processes, we want to mention /xCRL which extends ACP with data introduced by algebraic specifications [9,10]. The theory of /xCRL is described in detail in [11], Chapter 17 of this Handbook. In [45] parameterized graphs, which are similar to symbolic transition graphs, were proposed as a model for value-passing processes.
Acknowledgements The work presented in this chapter is the result of a long term collaboration with Matthew Hennessy, and we are indebted to him for many original ideas and insights. Thanks also go to Joachim Farrow for his constructive comments on the very first draft of this chapter, to JuUan Rathke and Luca Aceto for correcting many English mistakes and suggesting several improvements. Comments from the anonymous referee were also helpful.
References [1] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergsta, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292.
476
A. Ingolfsdottir, H. Lin
[2] S.D. Brookes, C.A.R. Hoare and A.W. Roscoe, A theory of communicating sequential processes, J. ACM 31 (3) (1984), 560-599. [3] G. Bruns, Distributed Systems Analysis with CCS, Prentice-Hall (1996). [4] R. Cleaveland, J. Parrow and B. Steffen, The concurrency workbench: A semantics based verification tool for finite state systems, ACM Transactions on Programming Systems 15 (1989), 36-72. [5] R. DeNicola and M. Hennessy, Testing equivalences for processes, Theoret. Comput. Sci. 24 (1984), 83113. [6] N. Francez, D. Lehman and A. Pnueli, A linear history of semantics for languages with distributed processing, Theoret. Comput. Sci. 32 (1984), 25-46. [7] R.J. van Glabbeek, The linear time - branching time spectrum I. The semantics of concrete, sequential processes. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 3-99. [8] J.F. Groote and S.P. Luttik, Undecidability and completeness results for process algebras with alternative quantification over data. Technical Report SEN-R9806, CWI, Amsterdam (1998). [9] J.F. Groote and A. Ponse, The syntax and semantics of fiCRL, Technical Report CS-R9076, CWI, Amsterdam (1990). [10] J.F Groote and A. Ponse, Proof theory for nCRL, Technical Report CS-R9138, CWI, Amsterdam (1991). [11] J.F. Groote and M.A. Reniers, Algebraic process verification. Handbook of Process Algebra, J. A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 1151-1208. [12] M. Hennessy, An Algebraic Theory of Processes, MIT Press (1988). [13] M. Hennessy, A proof system for communicating processes with value-passing. Formal Aspects of Computer Science 3 (1991), 346-366. [14] M. Hennessy and A. Ingolfsdottir, Communicating processes with value-passing and assignment, J. Formal Aspects of Computing 5 (1993), 432-466. [15] M. Hennessy and A. Ingolfsdottir, A theory of communicating processes with value-passing. Inform, and Comput. 107 (2) (1993), 202-236. [16] M. Hennessy and H. Lin, Symbolic bisimulations, Theoret. Comput. Sci. 138 (1995), 353-389. [17] M. Hennessy and H. Lin, Proof Systems for message passing processes. Formal Aspects of Computing 8 (1996), 379^07. [18] M. Hennessy and H. Lin, Uniquefixpointinduction for message-passing process calculi, CATS'97, Proc. Computing: the Australasian Theory Symposium (1997), 122-131. [19] M. Hennessy and X. Liu, A modal logic for message passing processes, Proc. 5th International Conference on Computer Aided Verification, Lecture Notes in Comput. Sci. 697 (1993), 359-370. [20] M. Hennessy and R. Milner, Algebraic laws for nondeterminism and concurrency, J. ACM 32 (1) (1985), 137-161. [21] M. Hennessy and G. Plotkin, A Term Model for CCS, Lecture Notes in Comput. Sci. 88, Springer-Verlag (1980). [22] C.A.R. Hoare, Communicating sequential processes, Comm. ACM 21 (8) (1978), 666-677. [23] C.A.R. Hoare and A.W. Roscoe, The laws of occam. Technical Report PRG Monograph 53, Oxford University Computing Laboratory (1986.) [24] A. Ingolfsdottir, Late and early semantics coincide for testing, Theoret. Comput. Sci. 146 (1-2) (1995), 341-349. [25] H. Lin, A verification tool for value-passing processes, Proc. 13th International Symposium on Protocol Specification, Testing and Verification, IFIP Transactions, North-Holland (1993). [26] H. Lin, Symbolic transition graphs with assignment, Proc. CONCUR 96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer-Verlag (1996), 50-65. [27] H. Lin, "On-the-fly" instantiation of value-passing processes, Proc. FORTE/PSTV'98, Paris (1998). [28] G. Milne and R. Milner, Concurrent processes and their syntax, J. ACM 26 (2) (1979), 302-321. [29] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer-Verlag, Berlin (1980). [30] R. Milner, Calculi for synchrony and asynchrony, Theoret. Comput. Sci. 25 (1983), 267-310. [31] R. Milner, A complete inference system for a class of regular behaviours, J. Comput. System Sci. 28 (3) (1984), 439-466.
A symbolic approach to value-passing processes
477
[32] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [33] R. Milner, A complete axiomatisation for observational congruence of finite-state behaviours. Inform, and Comput. 81 (1989), 227-247. [34] R. Milner, The polyadic pi-calculus, Proc. CONCUR 92, Stony Brook, New York, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed., Springer-Verlag (1992), 1. [35] R. Milner, J. Farrow and D. Walker, A calculus of mobile processes, Part I and II, Inform, and Comput. 100 (1)(1992), 1^0. [36] R Paczkowski, Characterizing bisimilarity of value-passing parameterised processes. The Infinity Workshop, Pisa, Italy (1996), 47-55. [37] D. Park, Concurrency and Automata on Infinite Sequences, Theoretical Computer Science VII, Lecture Notes in Comput. Sci. 104, Springer-Verlag (1981). DAIMI FN-19, Computer Science Department, Aarhus University (1981). [38] J. Parrow, An introduction to the n-calculus. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 479-543. [39] J. Parrow and D. Sangiorgi, Algebraic theories for name-passing calculi. Inform, and Comput. 120 (2) (1995), 174-197. [40] G. Plotkin, A structural approach to operational semantics. Report DAIMI FN-19, Computer Science Department, Aarhus University (1981). [41] J. Rathke, Uniquefixpointinduction for value-passing processes, Proc. 12th IEEE Symposium on Logic in Computer Science, IEEE Press (1997). [42] J. Rathke, Symbolic techniques for value-passing calculi, Ph.D. Thesis, University of Sussex (1997). [43] J. Rathke and M. Hennessy, Local model checking for value-passing processes, Proc. TACS'97, International Symposium on Theoretical Aspects of Computer Software, Sendai, Springer-Verlag (1997). [44] D. Sangiorgi, A theory of bisimulation for n-calculus. Acta Inform. 33 (1996). [45] M.Z. Schreiber, Value-passing process calculi as a formal method, Ph.D. thesis. Imperial College, London (1994).
Subject index =a,439 ^e,439 -^1,443 =^e,441 =^4^1, 444 %e,441 0, 438 Act, 439 Actr, 439 W„442 BExp, 437 b\=b', 43% Chan, 43S Chan, 439 c\e, 438 c?jc,438 DExp,431 4^7x],439 M/0,438 ea, 439 fixX._, 438 fv{b),431
>(^),437 itb t h e n / , 438 /C,438 P(?),438 P{xx A:„)<=r,438 p2^eq,^l P - 1 ^' 445 p^eq, 441 P^ig,444 ^'^^9 r + M,438 f—>u,456 t-^^u, 451 r:^£M,458 t M L U, 458 r|M,438 r~|M,452 t[f], 43% t^u, 449 t\L, 438 tp, 438 r-^M,455
478 / ^ M , 457, 458 r,439 Val 437 Vflr, 437 (jc)r, 446 Of-equivalence, 439 a./, 438 /0,438 p N ^,438 p{i;/jc},438 a, 439 r,438 T laws, 465 V3-bisimulation, 443 abstraction, 446, 469 action prefixing, 438 arity, 438 binding operator, 439 bisimulation equivalences, 440 bound, 439 channel names, 438 channel renaming, 438 channel restriction, 438 closed, 438 concrete equivalences, 440 conditional equation, 460 defining equation, 438 early strong bisimulation, 441 early strong symboHc bisimulation, 452 early weak bisimulation, 441
A. Ingolfsdottir, H. Lin early weak symbohc bisimulation, 457 evaluation, 438 free variables, 439 full normal form, 466 guarded, 469 inference rule, 460 invisible action, 438 labelled transition system, 439 late actions, 442 late observational congruence, 446 late strong bisimulation, 443 late strong symbolic bisimulation, 455 late weak bisimulation, 444 late weak symbohc bisimulation, 458 nondeterministic choice, 438 normal form, 463 operational semantics, 439 parallel composition, 438 process identifiers, 438 proof system, 459 standard equation set, 471 symbolic bisimulations, 448 symbolic equivalences, 440 symbohc operational semantics, 449 transition relation, 439
CHAPTER 8
An Introduction to the TT-Calculus Joachim Parrow Department Teleinformatics, Royal Institute of Technology, Stockholm, Sweden E-mail: joachim @ it. kth. se
Contents 1. Introduction 2. The TT-calculus 2.1. Basic definitions 2.2. Structural congruence 2.3. Simple examples 3. Variants of the calculus 3.1. Match and Mismatch 3.2. Sum 3.3. The polyadic calculus 3.4. Recursion and rephcation 3.5. The asynchronous calculus 3.6. The higher-order calculus 4. Operational semantics 5. Variants of the semantics 5.1. The role of structural congruence 5.2. Symbolic transitions 5.3. The early semantics 5.4. Reductions 5.5. Abstractions and concretions 6. Bisimilarity and congruence 6.1. Bisimilarity 6.2. Congruence 7. Variants of bisimilarity 7.1. Early bisimulation 7.2. Barbed congruence 7.3. Open bisimulation 7.4. Weak bisimulation 8. Algebraic theory 8.1. Bisimilarity 8.2. Congruence 9. Variants of the theory
481 483 483 486 488 491 491 493 494 496 497 499 501 504 504 506 509 510 511 513 513 516 517 517 520 521 525 528 528 530 533
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V All rights reserved
479
480
9.1. Early bisimilarity and congruence 9.2. Open bisimilarity 9.3. Weak congruence 10. Sources References Subject index
/ Parrow
533 534 535 536 539 542
Abstract The TT-calculus is a process algebra where processes interact by sending communication links to each other. This paper is an overview of and introduction to its basic theory. We explore the syntax, semantics, equivalences and axiomatizations of the most common variants.
An introduction to the TT -calculus
481
1. Introduction The TT-calculus is a mathematical model of processes whose interconnections change as they interact. The basic computational step is the transfer of a communication link between two processes; the recipient can then use the link for further interaction with other parties. This makes the calculus suitable for modelling systems where the accessible resources vary over time. It also provides a significant expressive power since the notions of access and resource underlie much of the theory of concurrent computation, in the same way as the more abstract and mathematically tractable concept of a function underlies functional computation. This introduction to the TT-calculus is intended for a theoretically inclined reader who knows a little about the general principles of process algebra and who wishes to learn the fundamentals of the calculus and its most common and stable variants. Let us first consider an example. Suppose a server controls access to a printer and that a client wishes to use it. In the original state only the server itself has access to the printer, represented by a communication link a. After an interaction with the client along some other link b this access to the printer has been transferred: Before interaction:
After interaction:
In the TT-calculus this is expressed as follows: the server that sends a along b is ba . S; the client that receives some link along b and then uses it to send data along it is b(c) .cd. P. The interaction depicted above is formulated ba.S\b(c).cd.P-^
S\ad.P.
We see here that a plays two different roles. In the interaction between the server and the client it is an object transferred from one to the other. In a further interaction between the client and the printer it is the name of the communication link. The idea that the names of the Unks belong to the same category as the transferred objects is one of the cornerstones of the calculus, and is one way in which it is different from other process algebras. In the example a,b,c,d axe all just names which intuitively represent access rights: a accesses the printer, b accesses the server, d accesses some data, and c is a placeholder for an access to arrive along a. If a is the only way to access the printer then we can say that the
482
/ Parrow
printer "moves" to the client, since after the interaction nothing else can access it. For this reason the TT-calculus has been called a calculus of "mobile" processes. But the calculus is much more general than that. The printer may have many links that make it do different things, and the server can send these links to different clients to establish different access capabilities to a shared resource. At first sight it appears as if the TT-calculus is just a specialized form of a value-passing process algebra where the values are links. In such a comparison the calculus may be thought rather poor since there are no data types and no functions defined on the names; the transferable entities are simple atomic things without any internal structure. The reason that the TT-calculus nevertheless is considered more expressive is that it admits migrating local scopes. This important point deserves an explanation here. Most process algebras have a way to declare a communication link local to a set of processes. For example in CCS the fact that P and Q share a private port a is symbolized by (P I Q)\a, where the operator \a is called restriction on a. The significance is that no other process can use the local link a, as if it were a name distinct from all other names in all processes. In the :/r-calculus this restriction is written (va)(P \ Q). It is similar in that no other process can use a immediately as a link to P or 2- The difference is that the name a is also a transferable object and as such can be sent, by P or Q, to another process which then can use the restricted link. Returning to the example above suppose that a is a local link between the server and the printer. Represent the printer by /?, then this is captured by {va)(ba .S\R). The server is still free to send a along b to the client. The result would be a private link shared between all three processes, but still distinct from any other name in any other process, and the transition is consequently written {va)(ba .S\R)\
b{c) .cd.P-^
(va)(S
\R\ad,P).
So, although the transferable objects are simple atomic things they can also be declared local with a defined scope, and in this way the calculus transcends the ordinary valuepassing process algebras. This is also the main source of difficulty in the development of the theory because the scope of an object, as represented by the operands of its restriction, must migrate with the object as it is transferred between processes. The TT-calculus is far from a single well defined body of work. The central idea, a process algebraic definition of link-passing, has been developed in several directions to accommodate specific applications or to determine the effects of various semantics. Proliferation is certainly a healthy sign for any scientific area although it poses problems for those who wish to get a quick overview. Presumably some readers new to the TT-calculus will be satisfied with a compact presentation of a single version, while other may be interested in the spectrum of variations. This paper aims to serve both these needs. In the following, the even-numbered sections develop a single strand of the calculus. Section 2 presents the syntax and give some small examples of how it is used. In Section 4 we proceed to the semantics in its most common form as a labelled transition system. In Section 6 we consider one of the main definitions of bisimulation and the congruence it induces, and in Section 8 we look at their axiomatizations through syntactic equalities of agents. These sections do not depend on
An introduction to the TT-calculus
483
the odd-numbered sections and can be considered as a basic course of the calculus. There will be full definitions and formulations of the central results, and sketches that explain the ideas and structure of the proofs. Each odd-numbered section presents variations on the material in the preceding one. Thus, in Section 3 we explore different versions of the calculus, such as the effect of varying the operators, and the asynchronous, polyadic, and higher-order calculus. Section 5 treats alternative ways to define the semantics, with different versions of labelled and unlabelled transitions. Section 7 defines a few other common bisimulation equivalences (the TT-calculus, like any process algebra, boasts a wide variety of equivalences but in this paper we concentrate on the aspects particular to n), and their axiomatizations are treated in Section 9. In these sections we do not always get a full formal account, but hopefully enough explanations that the reader will gain an understanding of the basic ideas. Finally, Section 10 contains references to other work. We give a brief account of how the calculus evolved and mention other overviews and introductory papers. We also indicate sources for the material treated in this paper. It must be emphasized that there are some aspects of the TT-calculus we do not treat at all, such as modal logics, analysis algorithms, implementations, and ways to use the calculus to model concurrent systems and languages. Also, the different variants can be combined in many ways, giving rise to a large variety of calculi. I hope that after this introduction a reader can explore the field with some confidence.
2. The TT-calculus We begin with a sequence of definitions and conventions. The reader who makes it to Section 2.3 will be rewarded with small but informative examples.
2.1. Basic definitions We assume a potentially infinite set of names J\f, ranged over by a, ^ , . . . , z, which will function as all of communication ports, variables and data values, and a set of (agent) identifiers ranged over by A, each with a fixed nonnegative arity. The agents, ranged over by P, Q,... are defined Table 1. From that table we see that the agents can be of the following forms: 1. The empty agent 0, which cannot perform any actions. 2. An Output Prefix ax . P. The intuition is that the name x is sent along the name a and thereafter the agent continues as P. So ^ can be thought of as an output port and jc as a datum sent out from that port. 3. An Input Prefix a (x). P, meaning that a name is received along a name a, and ^ is a placeholder for the received name. After the input the agent will continue as P but with the newly received name replacing JC . So a can be thought of as an input port and JC as a variable which will get its value from the input along a. 4. A Silent Prefix i . P, which represents an agent that can evolve to P without interaction with the environment. We use a, P to range over a(x),ax and r and call
484
/
Parrow
Table 1 The syntax of the TT-calculus Prefixes
a : := ax a{x)
Output Input Silent
T
Agents
P:= 0 a.P P-\-P P\P i f jc = V t h e n P i f XT^ y t h e n P {vx)P A ( j , , . . •, v „ )
Definitions
5. 6.
7. 8. 9.
10.
AUi,..
...„)t'/>
Nil Prefix Sum Parallel Match Mismatch Restriction Identifier (where i ^ j =^ Xi i^ Xj)
them Prefixes, and we say that or. P is a Prefix form, or sometimes just Prefix when this cannot cause confusion. A Sum P -{- Q representing an agent that can enact either P or Q. A Parallel Composition P \ Q, which represents the combined behaviour of P and Q executing in parallel. The components P and Q can act independently, and may also communicate if one performs an output and the other an input along the same port. A Match if x = y t h e n P. As expected this agent will behave as P if x and y are the same name, otherwise it does nothing. A Mismatch ifx:^y t h e n P. This agent will behave as P if x and y are not the same name, otherwise it does nothing. A Restriction (vx)P. This agent behaves as P but the name x is local, meaning it cannot immediately be used as a port for communication between P and its environment. However, it can be used for communication between components within P. An Identifier A(y\, ...,yn) where n is the arity of A. Every Identifier has a Defidef
nition A(jci,..., jc„) = P where the jc, must be pairwise distinct, and the intuition is that A ( j i , . . . , y,,) behaves as P with j , replacing JC/ for each /. So a Definition can be thought of as a process declaration, x i , . . . , jc„ as formal parameters, and the Identifier A ( y i , . . . , y„) as an invocation with actual parameters y\, ...,yn' The operators are familiar from other process algebras so we shall in the following concentrate on some important aspects particular to the TT-calculus, trusting the reader to be confident with the more general principles. The forms Nil, Sum and Parallel have exactly the same meaning and use as in other process algebras, and the Prefix forms are as in the algebras that admit value-passing. The i f constructs Match and Mismatch may appear limited in comparison with value-passing algebras which usually admit arbitrary Boolean expressions (evaluating to either true or false). But on closer consideration it is apparent that combinations of Match and Mismatch are the only possible tests that can be performed in the TT-calculus: the objects transmitted
An introduction to the n-calculus
485
are just names and these have no structure and no operators are defined on them, so the only thing we can do is compare names for equaUty. We can combine such tests conjunctively by nesting them, for example if X = y t h e n i f M 7^ u t h e n P behaves as P if both x = y and u^v Sum, for example
hold. We can combine them disjunctively by using
if X = y t h e n P -\- if u :^ v t h e n P behaves as P if at least one of jc = y and u y^ v hold. Sometimes we shall use a binary conditional if X = y t h e n P e l s e Q as an abbreviation for i f jc = y t h e n P + i f x 7^ y t h e n Q. As in other algebras we say that P is guarded in (2 if /^ is a proper subterm of a Prefix form in Q. Also, the input Prefix a (JC) . P is saidto^mJjc in P, and occurrences of x in P are then called bound. In contrast the output Prefix ax . P does not bind x. These Prefixes are said to have subject a and object x, where the object is called free in the output Prefix and bound in the input Prefix. The silent Prefix r has neither subject nor object. The Restriction operator (vx)P also binds JC in P. Its effect is as in other algebras (where it is written \x in CCS and 5x in ACP) with one significant difference. In ordinary process algebras the things that are restricted are port names and these cannot be transmitted between agents. Therefore the restriction is static in the sense that the scope of a restricted name does not need to change when an agent executes. In the TT-calculus there is no difference between "port names" and "values", and a name that represents a port can indeed be transmitted between agents. If that name is restricted the scope of the restriction must change, as we shall see, and indeed almost all of the increased complexity and expressiveness of the TT-calculus over value-passing algebras come from the fact that restricted things move around. The reader may also think of {vx)P as "new x in P", by analogy with the object-oriented use of the word "new", since this construct can be thought of as declaring a new and hitherto unused name, represented by x for the benefit of P. In summary, both input Prefix and Restriction bind names, and we can define the bound names bn(P) as those with a bound occurrence in P and the free names fn(P) as those with a not bound occurrence, and similarly bn(a) and f n(a) for a Prefix a. We sometimes write f n(P, Q) to mean f n(P) U fn{Q), and just a for f n(a) Ubn(a) when it is apparent def
that it represents a set of names, such as in "x e a". In a Definition A{x\, ...,Xn) = F we assume that fn(P) C {jci, ...,jc„}. In some examples we shall elide the parameters of Identifiers and Definitions when they are unimportant or can be inferred from context. A substitution is a function from names to names. We write [x/y] for the substitution that maps y to x and is identity for all other names, and in general {x\. ..Xn/y\.. .y«}, where the y, are pairwise distinct, for a function that maps each y, to x,. We use a to range over substitutions, and sometimes write x for a sequence of names when the length
486
/ Parrow
is unimportant or can be inferred from context. The agent Pa is P where all free names X are replaced by (T(X), with alpha-conversion wherever needed to avoid captures. This means that bound names are renamed such that whenever x is replaced by cr(x) then the so obtained occurrence ofa(x) is free. For example, {a(x). (vb)xb.cy.O){xb/yc}
is aiz).
ivd)zd.bx.O.
A process algebra fan may have noticed that one common operator is not present in the TT-calculus: that of relabeUing (in CCS written [a/b]). The primary use of relabelling is to define instances of agents from other agents, for example, if i5 is a buffer with ports / and o then B[i'/i, o'/o] is a buffer with ports i' and o'. In the TT-calculus we will instead define instances through the parameters of the Identifiers, so for example a buffer with ports / and o is B(i, o), and with ports /' and o^ it is B(i\ o'). For injective relabellings this is just another style of specification which allows us to economize on one operator. (A reader familiar with the CCS relabelling should be warned that it has the same effect as port substitution only if injective. In general they are different.) Finally some notational conventions: A sum of several agents Pi H h P/j is written Z!?=i ^/' or just 5Z; Pj when n is unimportant or obvious, and we here allow the case « = 0 when the sum means 0. A sequence of distinct Restrictions (vjci) • • • (vxn)P is often abbreviated to {vx{ • • •Xn)P. In a Prefix we sometimes elide the object if it is not important, soa. P means a(x). P where jc is a name that is never used, and similarly for output. And we sometimes elide a traihng 0, writing a for the agent a. 0, where this cannot cause confusion. We give the unary operators precedence over the binary and | precedence over +, so for example (VJC)P \ Q-{-R means (((vx)P) \Q)-\-R.
2.2. Structural congruence The syntax of agents is in one sense too concrete. For example, the agents a(x). bx and ^(y) • by are syntactically different, although they only differ in the choice of bound name and therefore intuitively represent the same behaviour: an agent that inputs something along a and then sends that along b. As another example the agents P \ Q and Q \ P represent the same thing: a parallel composition of the agents P and Q. Our intuition about parallel composition is that it is inherently unordered, and we are forced to syntactically distinguish between P \ Q and Q \ P only because our language is linear. We therefore introduce a structural congruence to identify the agents which intuitively represent the same thing. It should be emphasized that this has nothing to do with the traditional behavioural equivalences in process algebra which are defined in terms of the behaviour exhibited by an agent under some operational semantics. We have yet to define a semantics, and the structural congruence identifies only agents where it is immediately obvious from their structure that they are the same. The reader will here correctly object that "represent the same thing" and "immediately obvious" are not formally defined concepts, and indeed several different versions of the structural congruence can be found in the literature; there is no canonical definition and each has different merits. In Section 5.1 we will meet some of them and explore their
An introduction to the it-calculus
487
Table 2 The definition of structural congruence The structural congruence = is defined as the smallest congruence satisfying the following laws: 1. If P and Q are variants of alpha-conversion then P = Q. 2. The Abehan monoid laws for Parallel: commutativity P \ Q = Q \ P, associativity (P \ Q) \ /? = P 1 (Q I /?), and 0 as unit P | 0 = P; and the same laws for Sum. 3. The unfolding law A{y) = P{y/i] if A{x) = P. 4. The scope extension laws (vjc)O
= 0
{vx)iP \Q) = (vjc)(P+0 = (vx)if u = v then P = (vjc)if u^v t h e n P = {vx){vy)P =
F I {vx)Q if jc ^ fn(P) P-\-(vx)Q ifjc^fn(P) i f « = i; t h e n (y;i:)P if x ^ u and x ^ v it u ^ v t h e n (vx)P if JC ^ u and x i^v {vy){vx)P
consequences. Until then we adopt a particular structural congruence. The definition is given in Table 2. We briefly comment on the clauses in the definition. 1. Alpha-conversion, i.e., choice of bound names, identifies agents like a{x) .bx and a{y).by. 2. The Abelian monoid laws mean that Parallel and Sum are unordered. For example, when we think of a composition of three agents P, Q,R\i does not matter if we write it as (P I 2 ) I /? or (J? I g ) I P. The same holds for Sum. The fact that 0 is a unit means that P | 0 = P and P -h 0 = P, something which follows from the intuition that 0 is empty and therefore contributes nothing to a Parallel composition or Sum. 3. The unfolding just says that an Identifier is the same as its Definition, with the appropriate parameter instantiation. 4. The scope extension laws come from our intuition that (vjc)P just says that x is a new unique name in P; it can be thought of as marking the occurrences of x in P with a special colour saying that this is a local name. It then does not really matter where the symbols '\vxY' are placed as long as they mark the same occurrences. For example, in 0 there are no occurrences so the Restriction can be removed at will. In Parallel composition, if all occurrences are in one of the components then it does not matter if the Restriction covers only that component or the whole composition. Note that we do not have that (vjc)(P | Q) = (vjc)P | {vx)Q. The same occurrences are restricted in both agents, but in (vjc)(P | g ) they are restricted by the same binder (or if you will, coloured by the same colour), meaning that P and Q can interact using x, in contrast to the situation in (vjc)P | {vx)Q. Through a combination of these laws we get that {vx)P = P if JC ^ fn(P): P = P I 0 = P I (vx)0 = (vjc)(P I 0) = (vjc)P. So as a special case we get (VJC)(VJC)P = (vx)P for all P. Another key fact is that all unguarded Restrictions can be pulled out to the top level of an agent:
488
J. Parrow
PROPOSITION 1. Let P be an agent where {vx)Q is an unguarded subterm. Then P is structurally congruent to an agent {vx')P' where P' is obtained from P by replacing {vx)Q with Q{x'/x], for some name x' not occurring in P.
The proof is by alpha-converting all bound names so that they become syntactically distinct, and then applying scope extension (from right to left) to move the Restriction to the outermost level. This corresponds to the intuition that instead of declaring something as local it can be given a syntactically distinct name: the effect is the same in that nothing else can access the name. Our scope extension laws are in fact chosen precisely such that Proposition 1 holds. For example, we have not given any scope extension law for Prefixes and can therefore only pull out unguarded Restrictions. The reader may have expected a law like {vx)a. P = a. (vx)P for X ^ a. Indeed such a law would be sound, in the sense that it conforms to intuition and does not disrupt any of the results in this paper, and it will hold for the behavioural equivalences explored later in Sections 6 and 7. But it will not be necessary at this point, in particular it is not necessary to prove Proposition 1. Structural congruence is much stronger, i.e., identifies fewer agents, than any of the behavioural equivalences. The structural congruence is used in the definition of the operational semantics, which in turn is used to define the behavioural equivalences. The main technical reasons for taking this route are that many of the following definitions and explanations become simpler and that we get a uniform treatment for those variants of the calculus that actually require a structural congruence. In Section 5.1 we comment on the possibility to define the calculus without a structural congruence.
2.3. Simple examples Although we shall not present the operational semantics just yet (a reader who wishes to look at it now will find it in Section 4) it might be illuminating to see some examples of the scope migration mentioned in Section 1, that Restrictions move with their objects. Formally, scope migration is a consequence of three straightforward postulates. The first is the usual law for inferring interactions between parallel components. This is present in most process algebras and imphes that a{x) .ex \ab —^ cb \ 0 or in general aix).P\ab.Q^^
P{b/x}\Q.
The second postulate is that Restrictions do not affect silent transitions. P -^ Q represents an interaction between the components of P, and a Restriction (vx)P only restricts interactions between P and its environment. Therefore P -^ Q implies {vx)P —^ ivx)Q. The third postulate is that structurally congruent agents should never be distinguished and thus any semantics must assign them the same behaviour. Now what are the
An introduction to the 71-calculus
489
implications for restricted objects? Suppose that b is a. restricted name, i.e., that we are considering a composition aix) .ex I {vb)ab. Will there be an interaction between the components and if so what should it be? Structural congruence gives the answer, because b is not free in the left hand component so the agent is by scope extension structurally congruent to (vb){a(x) .-ex \ab) and this agent has a transition between the components: because of a(x) .ex \ab —^ cb \ 0 we get that (vb){a(x).cx
I ab) - ^ (vb)(cb \ 0)
and the rightmost 0 can be omitted by the monoid laws. So by identifying structurally congruent agents we obtain that a(x) .ex I (vb)ab —^ (vb)cb or in general that, provided b ^ f n(P), a{x). P I {vb)ab. Q -^
(vb){P{b/x} \ Q).
In other words, the scope of (vb) "moves" with b from the right hand component to the left. This phenomenon is sometimes called scope extrusion. If ^ G f n(F) a similar interaction is possible by first alpha-converting the bound b to some name b' ^ f n(P), and we would get a{x). P I (vb)ab. Q -^
{vb'){P[b'/x} \ Q{b'/b}).
So P{byx} still contains b free and it is not the same as the received restricted name b\ For another example consider: {(vb)a(x).P)\ab.Q. Here the right hand component has a free b which should not be the same as the bound b to the left. Is there an interaction between the components? We cannot immediately extend the scope to the right hand component since it has b free. But we can first alpha-convert the bound b to some new name b^ and then extend the scope to obtain {vb'){aix).P{b'/b]\ab.Q)
490
J. Parrow
and it is clear that we have a transition {vb'){a(x). P{b'/b} \ab.Q)-^
{vb')P{b'/b}{b/x]
\ Q.
So the restricted name, now b\ will still be local to the left hand component; the attempt to intrude the scope is thwarted by an alpha-conversion. In summary, through alphaconversion and scope extension we can send restricted names as objects, and Restrictions will always move with the objects and never include free occurrences of that name. This ability to send scopes along with restricted names is what makes the calculus convenient for modelling exchange of private resources. For example, suppose we have an agent R representing a resource, say a printer, and that it is controlled by a server S which distributes access rights to R. In the simplest case the access right is just to execute R. This can be modelled by introducing a new name ^ as a trigger, and guarding R by that name, as in {ve){S\e.R). Here R cannot execute until it receives a signal on e. The server can invoke it by performing an action ?, but moreover, the server can send ^ to a client wishing to use R. For example, suppose that a client Q needs the printer. It asks S along some predetermined channel c for the access key, here e, to /?, and only upon receipt of this key can R be executed. We have c{x),x.
Q I {ve){ce .S\e.R)-^
{ve){e. Q\S\e.R)-^
{ve){Q
\S\R),
The first transition means that Q receives an access to R and the second that this access is used. We can informally think of this as if the agent R is transmitted (represented by its key e) from 5 to 2 , so in a sense this gives us the power of a higher-order communication where the objects are agents and not only names. But our calculus is more general since a server can send e to many clients, meaning that these will share R (rather than receiving separate copies of R). And R can have several keys that make it do different things, for example R can ht e\ .R\ \e2.R2'". and the server can send only some of the keys to cHents and retain some for itself, or send different keys to different clients representing different access privileges. A related matter is if S wishes to send two names d and ^ to a client, and insure that the same client receives both names. If there are several clients then the simple solution of transmitting d and e along predetermined channels may mean that one client receives d and another e. A better solution is to first establish a private channel with a client and then send d and e along that channel. The private channel is simply a restricted name: {vp)cp .~pd .~pe. S. A client interacting with C must be prepared to receive a name, and then along that name received and^: c{p).p{x).p{y),Q.
An introduction to the 7t-calculus
491
Now, even if we have a composition with several clients and a server, the only possibility is that d and e end up with the same client. This feature is so common that we introduce an abbreviation for it: c{e\ "'€„). P c(x\'"Xn).Q
means means
(vp)cp .^e[ . • • • .^e„ . P, c(p).p(x\). ••• .p(Xn).Q,
where we choose p ^ f n(P, Q) and all JC, are pairwise distinct. We will then have c{ex "'en).P\
c(x, • • -x,,). Q-^
^ F | Q{ei ...€„ /xi.. .x„}.
The idea to estabhsh private hnks in this way has many other uses. Suppose for example that Q wishes to execute P by transmitting on its trigger e, and then also wait until P has completed execution. One way to represent this is to send to P a private name for signaUing completion, as in (vr)er .r.Q\
e{x). P - ^ (vr){r . Q \ P{r/x}).
Here Q must wait until someone signals on r before continuing. This someone can only be P since no other is in the scope of r. This scheme is quite general, for example P can delegate to another agent the task to restart Q, by sending r to it as an object in an interaction. The TT-calculus has been used to succinctly describe many aspects of concurrent and functional progranmiing, and also of high-level system description where mobility plays an important role. We shall not attempt an overview of all applications here. In the rest of this paper we concentrate on some central aspects of the theory of the calculus.
3. Variants of the calculus The calculus can be varied in many ways. There are many useful subcalculi which imply a somewhat simpler theory, and we shall also briefly consider two popular extensions: the polyadic and the higher-order calculi.
3.1, Match and Mismatch The Match and Mismatch operators are absent in many presentations of the calculus. This means a certain loss of expressiveness. But in a sense, equality test of names can be implemented without Match. Consider the following typical use of a test: an agent P receives a name and continues as Q if the name is y and as R if the name is z: P =a(x).{ifx
= y t h e n Q-\-if
x = z then/?).
492
/ Parrow
Without the Match a similar effect can be achieved exploiting the Parallel operator, where a communication is possible only if the subjects of the input and output actions are the same: P=a(x).{x\{y.Q-^z.R)). If the received name is y then, after reception, a communication between the first and second parallel component is possible, after which Q can execute. Similarly, if it is z then a communication between the first and third component enables R. This will work provided no other agent can interfere by interacting on the names y and z. So it is not a general encoding of Match, although many specific instances can be emulated in this way. Consider for example an implementation of Boolean values: There are agents Truea and False a, emitting Boolean values along a, and an agent Casea{Q, R), receiving a Boolean along a and enacting Q oi R depending on the value of the Boolean. A straightforward encoding would use two special names t and / : Truea = ^^ Falsea = af, CaseaiQ, R) = a(x) .(ifx
= t t h e n Q-\-if
x = f t h e n R).
So, e.g., CaseaiQ, R) \ Truea - ^ i f r = r t h e n Q -\- if t = f t h e n /?, and this agent will behave as Q. The same effect can be achieved without Match, at the expense of an extra communication. The idea is that Case emits two new names and True and False respond by signalUng on one of them: Truea =a(xy).J, Falsea =a(xy).y, CaseaiQ. R) = (vxy)a{xy) .(x . Q-\-y . R). where x and y do not occur in Q or ^- It will now hold that CaseaiQ. R) I Truea evolves to (vxy){x\(x.Q-\-y.R)) and the only possible continuation, in any environment, is a r to 2^ since x and y are local. In this way many instances of the Match construct, including all that aim to capture tests over ordinary data types, can be encoded. The Mismatch if x ^ y t h e n cannot be implemented in a similar way. Omitting Mismatch may be thought to drastically reduce the expressive power but it turns out the effect is not very severe. For example, if the possible values of a certain data type are M, V and w, the Mismatch ifx^u t h e n P can be replaced by i f x = f t h e n P + ifx = w t h e n P. In practice, the data types where equality test is admitted almost always have a predetermined finite range, or can be modelled through a finite set of constructors. Mismatch also makes some portions of the theory a little more complicated. For these reasons many of the versions of the TT-calculus do not use it. However, it appears to be necessary for many axiomatizations (cf. Sections 8 and 9).
An introduction to the TT-calculus
493
3.2. Sum The Sum operator + is sometimes regarded as unrealistic from an implementation perspective. The problem is that it represents a form of synchronous global choice. Consider: (a.Pi-^b,P2)\(a.Qi-^b.Q2).
Clearly this agent can evolve to either P\ \ Q\ (through a communication along a) or to P2 I Q2 (along b). The choice of which path should be taken involves both parallel components, and is resolved synchronously. If parallel components are distant then this needs a non-trivial protocol, and it can therefore be argued that the general form of Sum is not a realistic primitive operator. There are two main reasons for including the Sum operator. One is that it admits representations of automata in a straightforward way. Automata have proved useful for highlevel descriptions of communicating systems and are present in many modelling languages. The basic idea is that the behaviour of a component is thought of as a directed graph where the nodes represent the reachable states and the edges, labelled by actions, represent the possibilities to move between states. This can be represented in the TT-calculus as follows: For each state choose a unique Identifier, and introduce the Definition n def A = ^Qf/.A/
for each state A where the outgoing edges are labelled a i , . . . , a « leading to states Ai,...,A„. The other reason is related to axiomatizations of the behavioural equivalences (see Section 8). All axiomatizations so far use a version of the expansion law, which replaces Parallel by Sum, as in a Ib=
a.b-\-b.a.
No complete axiomatization is known for a calculus with Parallel and without Sum. In situations where high-level modelling is not called for and where complete axiomatization is not an issue, variants of the TT-calculus without Sum have been used, for example to describe the semantics of programming languages. Apart from omitting the computationally questionable primitive of synchronous global choice, which would make an implementation of the calculus difficult, it simplifies the theory to only have one binary operator. Many presentations of the calculus use guarded Sums in place of Sum, meaning that the operands of the Sum must be Prefix forms. The general format of a guarded sum is Yll=\ ^i' ^i (i-^' it is an n-ary operator). So for example a . P -\-^. Q is 3. guarded Sum, buta. P -\-(Q\ R) is not. With guarded Sum some parts of the theory become simpler, notably the weak bisimulation equivalence is a congruence (see Section 7.4) for the same reason as in ordinary process algebra. The loss of expressiveness is not dramatic:
494
J. Parrow
guarded Sum is sufficient both for representing automata and for formulating the expansion theorem. But using n-ary operators for arbitrarily large n may be considered awkward by those who seek a minimal theory. Note that an n-ary guarded Sum cannot be reduced to a sequence of binary guarded Sums, so the n-ary operators are actually necessary for all n. In contrast, for the ordinary sum, Yl'i=\ ^i is defined as n — 1 binary Sums. It is interesting that some cases of guarded Sum can be emulated by the Parallel operator. Consider for example r . P -\- r .Q. This represents a kind of internal choice: one of the branches will be taken but the environment cannot affect which one. The agent behaves in the same way as (va)ia\a.P\a.Q) assuming a ^ fn(P, Q). For another example consider the agent CaseaiQ, R) from the previous section; it was defined as CaseaiQ, R) = (vxy)a{xy) .(x. Q-\-y . R). Here the Sum can simply be replaced by a Parallel composition CaseaiQ. R) = ivxy)a(xy)
.(x.Q\y.R)
without affecting the behaviour, assuming True a and False a are defined as before. It will now hold that CaseaiQ, R) \ True a evolves to (vxy)(x\x.Q\y.R)^^Q\(vy)(y.R) and this agent will behave as Q, since R is guarded by a private name.
3.3. The polyadic calculus A straightforward extension is to allow multiple objects in communications: outputs of type a(y\ "-yn) .P and inputs of type a{x\---Xn) .Q where the x, are pairwise distinct. We here also admit the case « = 0 when there is no object at all, and then we elide the brackets writing a for a{) and a for a(). As was seen in Section 2.3 this does not really increase the expressiveness of the calculus since polyadic interactions can be emulated by sequences of monadic interactions over a private link. The semantics for a polyadic calculus is only notationally more complex than for the monadic calculus. As expected we will be able to infer a{x).P\a{y).Q-^P[ylx]\Q. where the substitution is a simultaneous substitution of all yi for Xi (note that all Xi must be different since they are objects in the same input Prefix).
An introduction to the TT-calculus
495
The question then arises how to treat agents such as a(xy). P \ a{u). Q where the arity of the output is not the same as the arity of the input. Such an incompatibihty should be caught by a type system. The idea is that each name is assigned a sort, containing information about the objects that can be passed along that name. If 5 is a set of sorts, a sort context A is a function from M to <S, in other words A(«) is the sort of a. In the simplest system a sort would just be a natural number, 5 = N, such that A (a) denotes the arity of a, i.e., the number of objects in any Prefix where a is the subject. Formally we write A h P to mean that P conforms to A, and rules for inferring A h P can easily be given by induction over the structure of P. For example, A h P , A(a) = n
AhP, AhQ
Ahfl(jci-.-Jc„).P
AhPIG
With this idea the agent a {xy). P \ a{u). Q is ill-formed in the sense that it cannot conform to any sort context: A(a) is required to be 2 in one component and 1 in the other component. However, although this simple scheme works for this particular example it is not in general sufficient to catch all incompatible arities that may arise when an agent executes. Consider: a(u) .u{z) I a{x) .'x{vv). A sorting assigning 2 to x and 1 to all other names works fine here. Yet the agent can evolve through an interaction along a to x{z) \^{vv) which is ill-formed. To be able to catch not only the immediately obvious arity conflicts but also any such conflicts that can arise during execution more information must be added to the sorts. For each name, the number of objects passed along that name is not enough, also the sort of each such object must be included. In the example above, the left component requires the sort of a to be one object (corresponding to u) which has sort 1 because of the subterm u{z). The right component requires the sort of a to be one object (corresponding to jc) of sort 2 because of the subterm ^{vv). With this refined notion of sort an agent such as a{u) .u{z)\ ax .^{vv) is ill-formed. Of course arity conflicts can lie arbitrarily deep, meaning that the sort of a must contain information about the objects which are passed along the objects which are passed along ... which are passed along a to arbitrary depth. One way to set this up is the following. To each sort S'mS associate a fixed object sort ob(S) in 5*, i.e., the object sort is a (possibly empty) sequence of sorts. The intention is that if a has sort S where ob{S) = {5i ... 5„), and a(xi...Xn) is a Prefix, then each Xj has sort 5/. With a slight abuse of notation the sorting rule for input then becomes: AU{x\-^ob(A(a))}\A\-a(x).P
P *
496
J. Parrow
It should be read as follows: In order to establish that aix\... JC„) . P conforms to A, find the object sorts 5*1... Sn of a according to A, and verify that P conforms to A where also each Xi is assigned sort Si. The rule for output is: ob(A{a)) = A{yO...A(yn), Ahay.P
Ah P
In order to establish that a{y\ ...yn).P conforms to A it is enough to show that it assigns y\ ...yn the object sorts of a, and that P conforms to A. In this way agents such as a a. P, where a name is sent along itself, can also be given a sorting: if S is the sort of a then ob{S) = {S). There is a large variety of type systems which include more information, such as if names can be used for input or output or both, and there are notions of subtypes and polymorphism. Binding occurrences in Restrictions are either explicitly sorted as in {vx : 5)P, or a sort inference system is used to compute a suitable sort. Whether the latter is possible depends on the details of the sort system. In conclusion, although polyadic interactions do not really increase the expressiveness it adds convenience and clarity when using the calculus, and efficiently implementable sort systems can ascertain that no mismatching arities will ever occur when agents evolve.
3.4. Recursion and replication In the TT-calculus as in most other process algebras the mechanism for describing iterative or arbitrarily long behaviour is recursion: a recursive Definition
where A occurs in P can be thought of as the definition of a recursive procedure A with formal parameters Jc, and the agent A{y) is then an invocation with actual parameters y. Sometimes this is notated through an explicit fixpoint constructor: if P is an agent then fixX. P is an agent. Here the agent variable X may occur in P, and fixX. P means the def
same as the agent Identifier A with the Definition A = P{A/X}. Fixpoints and Definitions are thus only notational variants. In large specifications the Definitions tend to be more readable, but the fixpoints sometimes allow a more optimal formulation for theory development. For some purposes the special case of Replication is convenient. If P is an agent then !P, the Replication of P, is given by the definition def
IP = P\IP, or using fixpoints: IP is the agent fixX.(P|X).
An introduction to the n -calculus
497
In other words, \P represents an unbounded number of copies of P - the recursion can obviously be unfolded an arbitrary number of times: \P = P \\P = P \ P \\P = P \ P \ P \\P
etc.
For example, an agent which can receive inputs along / and forward them on o is: M =\i{x) .ox. Suppose this agent receives first u and then v along /. Then, by unfolding the Replication, M = i(x) .ox I i(x) .ox I M, the agent will evolve to ou \ov \ M, ready to receive more messages along / but also to emit u and v in arbitrary order. Any agent using a finite family of Definitions can be encoded by Replication as follows. Consider
A,(i,)'=lV,,
used in an agent Q. Then there is a corresponding agent Q^ which behaves as Q and only uses Replication. Q^ is constructed as follows. Introduce names a\,.. .,a„, one for each Identifier, and let P be the agent obtained by replacing any invocation A, (y) with an output aiiy) in P. Let D = \adxi).Pi
|...|!fl„(i,).:^.
Thus D is an agent which emulates all the Definitions in the sense that it can interact with any such output. Finally G' = ( v f l i . . - « , ) ( D | e ) will then behave in the same way as Q, with the only difference that an unfolding of a ^
def
Definition will be emulated by an interaction between Q and D. For example, let A^ = i(x) .ox .N, which differs from M above in that messages are delivered in order and only one message is stored at a time. The agent with only Replication which behaves as A^ is (va)(la .i(x) .ox
.a\a).
3.5. The asynchronous calculus The TT-calculus, as most other process algebras, is based on the paradigm of synchronous communication; an interaction means that one component emits a name at the same time as another component receives it. In contrast, in asynchronous communication there is
498
/ Parrow
an unpredictable delay between output and input, during which the message is in transit. This can be modelled by inserting an agent representing an asynchronous communication medium between sender and receiver. The properties of the medium (whether it has a bound on the capacity, whether it preserves the order of messages etc.) is then determined by its definition. For example, an unbounded medium not preserving the order of messages is: M^=i{x).{ox\M). (The same behaviour is expressed with Replication in Section 3.4.) When M receives u along / it evolves to ou \ M, and can at any time deliver u along o, and also continue to accept more messages. Interestingly, this particular form of asynchrony is also captured by a subcalculus of TT in which there is no need to explicitly represent media. The subcalculus consists of the agents satisfying the following requirements: 1. Only 0 can follow an output Prefix. 2. An output Prefix may not occur as an unguarded operand of +. The first requirement disallows agents such as ax .by, where an agent other than 0 follows 'dx. The second requirement disallows 'ax -f b{y), but allows x .ax -\- b{y). This subcalculus is known as the asynchronous TT-calculus, and the rationale behind it is as follows. An unguarded output Prefix ax occurring in a term represents a message that has been sent but not yet received. The action of sending the message is placing it in an unguarded position, as in the following r . (^jc I P) - ^ ^jc I P. After this transition 'dx can interact with a receiver and the sender proceeds concurrently as P. Because of requirement 1 the fact that a message has been received cannot be detected by P unless the receiver explicitly sends an acknowledgement. Because of requirement 2 a message cannot disappear unless it is received. Therefore, r . (dx \ P) can be paraphrased as "send dx asynchronously and continue as P". Of course, with a scheme for sending explicit acknowledgements synchronous communication can be emulated, so the loss of expressiveness from the full TT-calculus is largely pragmatic. In agents like T
.{vb)i;db\b{x).P)
the scope of b is used to protect this kind of acknowledgement. Here the agent can do an asynchronous output of db, but it is blocked from continuing until it receives an acknowledgement along Z?: {vb){db I b{x). P) I a{x). Q -^
(vb){b(x). P I Q[b/x}).
The acknowledgement can only arrive from the recipient (Q) of the message, since there is no other agent that can send along the restricted name b.
An introduction to the TT-calculus
499
The asynchronous calculus has been used successfully to model programming languages where the underlying communication discipline is asynchronous. The theory is slightly different since only "asynchronous" observers are deemed relevant. For example, the agent a(x) .ax is semantically the same as r since the actions of receiving a datum and then emitting it on the same channel cannot be detected by any other asynchronous process or observer. An interesting consequence is that a general form of Sum, the input-guarded Sum y\{x) .P\-\ \-ynM .Pn can be encoded as: {va){at I {y\(x).a{z).(af
ynix).a(z).(af\
| i f z = r t h e n Pi e l s e j i x )
if z = t then P,,
elsey^x))).
The idea is that a acts as a lock. Initially t is emitted on a\ the first component to interact with a will continue to emit / on a, all other components will resend the datum along y,, thereby undoing the input along yj. This only works in the asynchronous calculus, where receiving and then emitting the same message is, from an observer's point of view, the same as doing nothing. (An alert reader will complain that i f . . . t h e n . . . e l s e is defined using Sum. This is no great matter, it can be taken as primitive or defined as the Parallel composition of the branches.)
3.6. The higher-order calculus Finally we shall look at an extension of the TT-calculus called the /i/^/i^r-or(rf^r TT-calculus. Here the objects transmitted in interactions can also be agents. A higher-order output Prefix form is of the kind a{P).Q meaning "send the agent P along a and then continue as Q'\ The higher-order input Prefix form is of the kind a(X).Q meaning "receive an agent for X and continue as Q'\ Of course Q may here contain X, and the received agent will then replace X in Q. For example, an interaction is a(bu . 0). b(x) \a{X).(X\
cv) - ^ b{x) \ bu \ cv.
The first component sends /?« .0 along a, the second component receives it and executes it in parallel with cv. The transmitted agent bu is then free to interact with the remainder of the first component b{x), sending u to it along b. Since names and agents can both be objects in an interaction, a sorting discipline such as in Section 3.3, extended with a
500
/ Parrow
sort for "agent", can be employed to weed out unwanted combinations such as a ( P ) . |2 | a{x) .x{u). Formally, we introduce a new category oi agent variables, ranged over by X, and extend the definition of agents to include the agent variables and the higher-order Prefix forms. The notion of replacing an agent variable by an agent, P[Q/X]/\s2iS> expected (and the same as in the fixpoint construct of Section 3.4), and the higher-order interaction rule gives that a(X).P\a{Q).R^^P[Q/X}\R. The substitution P{Q/X} is defined with alpha-conversion such that free names in Q do not become bound in P[Q/X}. To see the need for this consider a{X).b{c).X\a{c{z),{li),R. Clearly the name c in the right hand component is not the same as the bound c to the left. The agent is alpha-equivalent to a{X) .b{d) .X\a{c{z)
.^).R.
where these names are dissociated. Therefore a transition to b{c). c(z) | R is not possible. In this sense the binding corresponds to static binding: the scope of a name is determined by where it occurs in the agent. An alternative scheme of dynamic binding, where the scope is determined only when the name is actually used, is possible but much more complicated semantically. For example, such bindings cannot use alpha-conversion. Note that an agent variable may occur more than once in an agent. For example, a{X).{X\X)\a{Q).R^^Q\Q\R. where the transmitted agent Q has been "duplicated" by the interaction. This lends the higher-order calculus considerable expressive power. Recursion and Replication are now derivable constructs (as in the lambda-calculus where the fixpoint combinator Y is expressible). Consider D=
a{X).{X\a{X)).
D accepts an agent along a, and will start that agent and also retransmit it along a. Now let P be any agent with a ^ f n(P), and Rp =
{va){DmP\D)).
Then Rp behaves as !P since it will spawn an arbitrary number of P: Rp ^^
iva){(P \D)\a{P\D))^P\Rp-^
P\P\Rp-^--'.
Obviously, for modelling programming languages with higher-order constructs (such as functions with functions as parameters, or processes that can migrate between sites) the
An introduction to the Jt-calculus
501
higher-order calculus is suitable. However, its theory is considerably more complicated. In some situations it will then help to encode it into the usual calculus with the device from Section 2.3. Instead of transmitting an agent P we transmit a new name which can be used to trigger P. Since the receiver of P might invoke P several times (because the corresponding agent variable occurs at several places) P must be replicated. The main idea of the encoding [•] from higher-order to the ordinary calculus is as follows, where we assume a previously unused name x for each agent variable X: l{a{P).Q)j
= (vp)ap,{m\\p.lPj)^
laiX).P]
where/7^fn(P,Q),
=a{x),lPl
m = ^. Consider the example above, aiX) .(X \ X) \a{Q). R-^ Q \ Q \ R. where Q and R in turn contain no higher-order Prefixes. Using the encoding, and assuming q is not free in Q or /?, we get a similar behaviour: a(x).(x\x)\ivq)aq.iR\\q.Q) -l^(vq)(q\q\R\\q.Q) ^^^(vq)(0\0\R\Q\Q\\q.Q) ^R\Q\Q\(vq)\q.Q^ where the rightmost component (vq)\q. Q will never be able to execute because it is guarded by a private name, so the whole term will behave as Q | (g | /? as expected.
4. Operational semantics The standard way to give an operational semantics to a process algebra is through a labelled transition system, where transitions are of kind P - ^ Q for some set of actions ranged over by a. The TT-calculus follows this norm and most of the rules of transitions are similar to other algebras. As expected, for an agent a. P there will be a transition labelled a leading to P. Also as expected, the Restriction operator will not permit an action with the restricted name as subject, so (va)au . P has no transitions and is therefore semantically equivalent to 0. But what action should (vu)au. P have? Clearly it must have some action; inserted in a context a{x). Q\ (vu)au . P it will enable an interaction since, assuming u ^ fn(Q), this term is structurally congruent to (vu)(a(x) .Q\au.P) and there is an interaction between the components. So (vu)au . P is not, intuitively, something that behaves as 0. On the other hand it is clearly distinct from au . P and it can therefore not be given the action au. For example, {a{x). i f jc = M t h e n Q) \ au —^ it u = u t h e n Q
502
/ Parrow
which can continue as Q, while (a(x). if X = u t h e n Q) \ (vu)au = (vv){{a(x). i f jc = M t h e n Q) \ av) - ^ (vi;)if V = u t h e n Q and there are no further actions (remember that scope extension requires that u is alphaconverted before the scope is extended). The solution is to give (vu)au a new kind of action called bound output written avu. The intuition is that a local name represented by u is transmitted along a, extending the scope of u to the recipient. In summary, the actions ranged over by ex consists of four classes: 1. The internal action r. 2. The (free) output actions of kind ax. 3. The input actions of kind a(x). 4. The bound output actions of kind avx. The three first kinds correspond precisely to the Prefixes in the calculus. For the sake of symmetry we introduce a fourth kind of Prefix avx, fora^x, corresponding to the bound output action. The bound output Prefix is merely a combination of Restriction and output as defined by avx. P = (vx)ax. PAn this way we can continue to let a range over both actions and Prefixes, where f n(^vjc) — {a] and hn{avx) = {x}. An input transition P ^ '^ > Q means that P can receive some name u along a, and then evolve to Q{u/x}, In that action x does not represent the value received, rather it is a reference to the places in Q where the received name will appear. When examining further transitions from Q, all possible instantiations for this x must be considered. Those familiar with functional programming and the lambda-calculus might think of the transition as P - ^ Xx Q, making it clear that the derivative, after the arrow, has a functional parameter X. (The reader may at this point wonder about an alternative way to treat input by including the received name in the action, as in a(x). P - ^ P{u/x}. This is a viable alternative and will be discussed in Section 5.3.) Similarly, the bound output transition P - ^ ^ Q signifies an output of a local name and X indicates where in Q this name occurs. Here x is not a functional parameter, it just represents something that is distinct from all names in the environment. The labelled transition semantics is given in Table 3. The rule STRUCT makes explicit our intuition that structurally congruent agents count as the same for the purposes of the semantics. This simplifies the system of transition rules. For example, SUM is sufficient as it stands in Table 3. The dual rule SUM2
P-\-Q^^Q' is redundant since it can be inferred from SUM and STRUCT. Similar arguments hold for the rules PAR and COM. In the rule PAR, note the extra condition that Q does not contain a name bound in a. This conforms to the intuition that bound names are just references to occurrences; in the
An introduction to the n -calculus
503
Table 3 The operational semantics STRUCT
=-
P'
a.P^^P P^P' P + Q^^P'
SUM
P-^P' i f . X =x t h e n F* -£> p' p-^p'
4ATCH
\ X
^y
±t X ^y t h e n P —> P' P-^
PAR
P', bn(a) n
fn(0 == 0
P\Q-^P'
\Q
p Jl^ % p' COM
Q ^'^) Q'
P\Q -^P'{u/x]\Q' P ^
RES
{vx)P OPE! V
P',
x^a
- % {vx)P'
p £1 ^ P',
a^x P'
conclusion ? \ Q - ^ P' \ Q the action should not refer to any occurrence in Q. To see the need for the condition consider the inference PAR
(a(x).P)\Q^^P\Q Combined with an output au . R - ^ R we get
COM
ia(x).P)\Q^^
P\Q,
{{a{x) .P)\Q)\au.R^^{P\
au.R Q)[ulx} \ R
This is clearly only correct if x ^ f n( Q), otherwise the free JC in 2 would be affected by the substitution. If jc G fn((2) then a similar derivation is possible after first alpha-converting jc in a(jc). P to some name not free in Q. The rule OPEN is the rule generating bound outputs. It is interesting to note that bound output actions do not appear in the COM rule and therefore cannot interact directly with
504
/ Parrow
inputs. Such interactions are instead inferred by using structural congruence to pull the Restriction outside both interacting agents (possibly after an alpha-conversion), as in the following where we assume that u ^ f n(P): RES
STRUCT
a{x).P\au,Q-^P[u/x]\Q
^'^^)^^(^) .P\au,Q)^ a{x). P I {vu)au . Q -^
{vu){P{u/x} I Q) (vu)(P{u/x} \ Q)
In view of this it might be argued that bound output transitions and the rule OPEN can be omitted altogether, since they have no impact on inferring interactions. Although technically this argument is valid there are other reasons for including the bound output. One is of philosophical nature: we think of the agent {vu)au as, intuitively, being able to do something, namely exporting a local name, and if we do not dignify that with a transition we introduce an incompleteness in the semantics in that not all behaviour is manifested by transitions. Another reason is of technical convenience: when it comes to developing behavioural equivalences (see Section 6) the bound output transitions will turn out to be indispensable.
5. Variants of the semantics We will here consider alternative operational semantics. Some are mere presentational variants. But different semantics have different strengths, for example one may be suitable for an automatic tool and another may boost intuition, so there is a point to the diversity. 5.1. The role of structural congruence Through the rule STRUCT we can regard an inference of P = Q as a step in an inference of a transition. If the only purpose of the congruence is to facilitate inference of labelled transitions then there is a possible trade-off between what to include in the structural congruence and what to include in the transition rules. As we saw the dual SUM2 of SUM is unnecessary, but an alternative solution is to omit commutativity from the structural congruence and introduce SUM2. A similar choice occurs for the Parallel combinator: structural commutativity can be omitted at the price of introducing the duals of PAR and COM. For some operators there is even a choice between defining it entirely through the congruence or through the transition rules. For example, the Match operator can either be defined with the rule MATCH or with an additional structural rule
i f x = x then P = P. In Table 3 we chose to give it with a transition rule because of the symmetry with MISMATCH. Note that Mismatch cannot be defined through the perhaps expected structural rule ifx^y
then P = P
if x ^ y
An introduction to the n-calculus
505
since that rule would be obviously unsound for a Mismatch under an input Prefix: a(x).ifx:^ythenP
and
aix).P
represent two different behaviours! Another such choice occurs for Identifiers. They are here defined through a structural def
congruence rule A(y) = P{y/x} if A{x) — P. Alternatively we could have given the transition rule: P[y/x}-^ IDE
P\A{x)'^= P
-^-^
.
A{y) ^^
P'
Perhaps the most dramatic part of the structural congruence is the scope extension which, together with COM, make possible transitions like a{x). P I {vu)au . Q ^ > (vu){P{u/x} \ Q) (provided u ^ f n(P)). Interestingly, there is a way to achieve the same effect without the scope extension. It involves a new transition rule CLOSE which represents an interaction between a bound output and an input:
CLOSE
P\Q^->
{vu){P' I Q')
Let us see how the transition from a{x). P \ (vu)au . Q mentioned above is derived. It involves an alpha-conversion of x to w in the first operand:
STRUCT
a(x). P = a(u). P{u/x}, a(u). P{u/x} - ^ a(x).P^^
P{u/x}
.
Plu/x]
OPEN in the second component gives: au . Q —> Q
OPEN
(vu)au.Q
> Q
and combining the two conclusions we get: a(x). P ^ ^ P{u/x}, ivu)au . Q ^ ^ Q CLOSE a(x). P I (vu)au . Q - ^ (vu)(P{u/x}
. \ Q)
Note how the scoping represented by v moves from the second operand onto the transition arrow and reappears in the term in the conclusion!
506
/ Parrow
In this way it is possible to remove all of the structural congruence except alphaconversion, at the expense of introducing more transition rules. In fact, it is even possible to remove the alpha-conversion by building it into a special rule, or into the rules that generate bound actions. For example, the rule for input would become
a{x).P-^
P{u/x}
for any u ^ f n(P), and similarly the rule OPEN would need a modification. Therefore, the choice whether to use a structural congruence at all and, if so, how many rules it should contain is largely one of convenience. Historically, the first presentations of the calculus did not use structural congruence and an advantage is then that some proofs by induction over inference of transition become clearer. Today most presentations use some form of structural congruence, at least including alpha-conversion, since the definitions become more compact and transparent. For example, the scope extension in structural congruence is easier to understand than the effect of the CLOSE and OPEN rules.
5.2. Symbolic transitions In the transitional semantics an input action P ^' ^ > Q represents that anything can be received along a. Consequently, if we want to explore further transitions from Q we must take into account all possible substitutions for x. Since there are infinitely many names it appears we have to explore the behaviour of Q[u/x} for infinitely many names u. In general, when a number of such inputs have been performed, we may be interested in the behaviour not merely of an agent P but of Pa for substitutions cr involving several names. This kind of infinite branching is awkward for proof systems and prohibits efficient tool support for automated analysis. Therefore, an alternative way to present the semantics is to let a transition from P contain information about the behaviour not only of P itself but also of Pa for any cr. The key observation is that even though there are infinitely many names a syntactically finite agent can only subject them to a bounded number of tests, and the conditions which enable a transition can be recorded. For example, consider P=au.Q\b(x).R. We can schematically express the transitions of Pa succinctly as follows. For any a the agent Pa will have an input and an output transition (with subject a (a) and a{b) respectively). In addition, if a (a) =a(b) it will have a r-transition arising from a communication between the components. This is the idea behind the so called symbolic semantics, where these transitions come out as: P -^^^^^^
Q\b(x).R^
P
Q\R{u/x}.
^ ^ ^
An introduction to the TT-calculus
507
The label on a transition here has two components. The first is a condition which must hold for the transition to be enabled, and the second is as usual the action of the transition. In the TT-calculus the conditions have a particularly simple form. The only tests an agent can perform on names are for equality (arising from the Parallel combinator, as above, and from Match) and inequality (arising from Mismatch). Of course several of these tests may affect a transition, so a condition will in general be a conjunction of equalities and inequalities on names. For example, we will have that ifx
= y t h e n au.Q\ifxy^b
t h e n biy). R '^-'^'^^^''^^'^ Q \ R{u/y}.
Formally we let M, A^ range over conjunctions of name equalities and inequalities, including the empty conjunction which is written true. Symbolic transitions are of the form P — ^ Q, meaning "if M holds then P has an action a leading to Q'\ We let /i range over pairs (M, a), so a symbolic transition is written P - ^ Q. For /x = (M, a) we let bn(/x) mean bn(a) and we let /x A A^ mean (M AN,a). The rules for symbolic transitions are given in Table 4 and are similar in structure to the rules in Section 4 for ordinary transitions. The only subtle point is the effect of Restriction on a condition in the rules S-RES and S-OPEN. Suppose P has a symbolic transition
with a condition M that mentions JC in a conjunct x ^y. This means that the transition from P only holds for substitutions assigning x and y different names, perhaps because P is of the form i f x 7^ >; t h e n . . . . What is then the condition M' of the inferred symbolic transition (vx)P
>Q.
To see what it should be we must ask how substitutions involving JC can enable that transition. The requirement from M is that x should not be assigned the same name as y. But since substitutions only affect free names, no substitution will assign y the same name as the bound x in (vx)P. Therefore, the inferred transition from (vx)P will be possible no matter how x is treated by the substitution. Hence the conjunct x ^y should not be present inM^ Suppose instead that M says that x is the same as some other name y, i.e., M contains a conjunct x = y, meaning "this transition only holds for substitutions assigning x and y the same name". Then the inferred transition from (vx)P will hold for no substitution, for the same reason. In that case M' can be chosen to be any unsatisfiable condition, for example z^ z. The only other types of conjuncts in M mentioning x are the trivial x = x, which is always true and can be removed at will, and the contradictory x ^x, which implies that the condition is unsatisfiable. In conclusion, the condition M' can be defined as M where conjuncts x =^ x and x ^y are removed, and conjuncts JC = y are replaced with an unsatisfiable conjunct z^z, for all y different from x. We denote this by "M — JC" in Table 4. For example (x^yAz = u)—x is (z = M), and (JC = y A z = M) — jc is z 7^ z (it is not satisfiable).
508
/ Parrow Table 4 The symbolic transition semantics P' = P, p JU Q,Q = Q' S-STRUCT
^-^
=-
P'-^Q' n true.or „ Of. P > P
P-^P' S-SUM —
P-VQ-^
P'
P-^
S-MATCH ifx
P\
x,yihnifi)
^—^ f ^ ^ • ' " - ) P'
= ythenP
P-^
S-MISMATCH
P\ jc,v^bn(/x)
ifx^ythenPJ^^^^P' S-PAR
P -^
P',bn(/Li)nfn(0 = 0 P>\Q
P\QJ^
pJL^^P'^
QJLEH^Q'
S-COM
=
P I Q ^^^^'^-^'\ P
> P , X ^a
S-RES -
{vx)P D
P'^u/x] I Q'
> {vx)P' r>/
MMX
P
> P ,
S-OPEN {yx)P -
J
a^x >• P
As an example inference consider the symbolic transition from (vjc)if x^y
t h e n a . P.
First by S-PREHX a. P
> P
and then by S-MISMATCH ±txi^y
t h e n c y . P '"^''^ P
and finally by S-RES, since {x ^y) — x = true and assuming x ^ a:
ivx)itx
i- y then a. P ^^^^
(yx)P,
An introduction to the n-calculus
509
In a similar way we get that (vx)if X = y t h e n a . P
> (vx)P.
In other words, the first transition holds for all substitutions and the second for no substitution, i.e., is never possible. This is as it should since no substitution can make x and y equal in an agent where x is bound. We can now state how the symbolic semantics corresponds to the transitions in Section 4. Write or [= M to denote that for any conjunct ^ = ^ in M it holds that a(a)=cr(b) and for any conjunct a^bit holds that a {a) ^a(b). The correspondence between the semantics is that P — ^ P^ implies that for all a such that a ^ M there is a transition Per - ^ P'a. Conversely, if Pa - ^ P'' then for some M, of, P' it holds P -^^ P' where a h M and P'^ = P'G and fi = aa. The proof is through induction over the inference systems for transitions. Therefore, a tool or proof system is justified in using the symbolic semantics.
5.3. The early semantics As mentioned in Section 4 there is an alternative way to treat the semantics for input, the so called early semantics, by giving the input Prefix the rule for all u: E-INPUT
a(x).P-^
au
P{u/x}
Here there is a fifth kind of action, the free input action of kind au, meaning "input the name u along a'\ Note the difference between P - ^ - ^ Q meaning P inputs something to replace x in Q, and p _ ^ Q meaning P receives the name x and continues as Q. In the early semantics the COM rule needs a modification, since the input action in the premise refers to the transmitted name: p E-COM
^"> p'
Q ^"s, Q' ^
.
There is no substitution in the conclusion since that has already been performed at an eariier point in the inference of this transition, namely when the input action was inferred. Hence the name "early" semantics. Consequently the semantics in Section 4 is called the late semantics: the substitution emanating from an interaction is inferred as late as possible, namely when inferring the interaction in the COM-rule. In the early semantics there is no need for the bound input actions, so there will still only be four kinds of action. However, if scope extension in the structural congruence is omitted in favour of the CLOSE rule as described in Section 5.1 then the early semantics also needs a side condition u ^ f n(P) in that rule.
510
/ Parrow
To see the similarity and difference between late and early, consider the inference of an interaction between a{x) .P and au .Q, Both semantics yield the same r-transition. First the late semantics: PREFIX
PREHX
a{x).P >P a(x).P\au.Q-^
COM
au.Q—> P{u/x}\ Q
Then the early semantics: E-INPUT
PREnX au
b-COM
——.
a(x).P\au.Q^^
P{u/x}\Q
The r-transitions that can be inferred with the early semantics are exactly those that can be inferred with the late semantics. The proof of this is by induction over the depth of inference of the transition. The induction hypothesis needs to state that not only r actions but also input and output actions correspond in the two semantics, where the correspondence between input and free input is that P - ^ P' iff 3P'\ w : P - ^ ^ P'' A P'= P''[u/w}. In view of this it is a matter of taste which semantics to adopt. It could be argued that the early semantics more closely follows an operational intuition since, after all, an agent performs an input action only when it actually receives a particular value. On the other hand, experimental evidence indicates that proof systems and decision procedures using the late semantics are slightly more efficient.
5.4. Reductions Another idea for the operational semantics is to represent interactions using an unlabelled transition system. The idea is that P -^ Q, pronounced "P reduces to Q'\ is the same as P —^ Q. The difference is that reductions are inferred directly from the syntax of the agent, as opposed to r-transitions which are inferred from input and output transitions. This is accomplished by a counterpart to the COM rule which explicitly mentions the Prefixes that give rise to the reduction: R-COM
(• •.+a(x). p) I (...+^M. e) ^ p{u/x} IQ In addition, the rules PAR and RES need counterparts for reductions; they are quite simple since there is no label on the transition: P-^ R-PAR
P\Q-^
P'
P^
P'\Q
R-RES
(vjc)P -^ (vjc)P'
and of course the structural rule is as before: p' = p^p -^ Q^Q = Q' R-STRUCT
P'^Q'
P'
.
An introduction to the n-calculus
511
That's it! Those four rules suffice for a subcalculus, formed by the agents satisfying: 1. All Sums are guarded Sums, i.e., of kind a\ . P\ -] h «/,. P,?. 2. There are no unguarded if-operators. 3. There are no r-Prefixes. These restrictions are not very severe. In practice Sums are almost always guarded (this excludes agents like (P \ Q) -]- R which are seldom used). The second condition is easy to satisfy since any if-operator not under an input Prefix can be evaluated; the agent if X = y t h e n P can be replaced by P if x = y and by 0 otherwise, and conversely for ifx^^y t h e n P. The importance of the two first conditions is that structural congruence can always be used to pull the two active Prefixes into a position where R-COM is possible. The third condition is also not dramatic. The silent Prefix is derivable in the sense that (va)(a. P \a) behaves exactly like z . P. The fact that -^ corresponds to —^ in the ordinary semantics is then easily proved by induction on inference of ->. Each such inference only uses R-COM once and R-STRUCT a number of times. Clearly, for ease of presentation the reduction semantics is superior to the labelled transition semantics, and is therefore often taken as a point of departure when describing the TT-calculus. It is then important to remember that the price for the simplicity is loss of information: the reduction semantics records only the completed interactions within an agent, and ignores the potential that agent shows for interacting with an environment. For example au . 0 and bu . 0 and (vu)au . 0 all have no reductions and are therefore in some sense semantically identical, even though they have different "potential" interactions. For this reason proof systems and decision procedures based directly on the reduction semantics are not optimal. However, one great advantage is that it works equally well for the higher-order calculus (Section 3.6), where a labelled semantics is complicated with agents decorating the arrows.
5.5. Abstractions and concretions The input transition P - ^ ^ Q can intuitively be thought of as P - % Xx Q where Xx Q is a function from names to agents. This idea can be elaborated to give an alternative presentation of the transition system. It requires a few more definitions but the rules become simpler. Define agent abstractions, ranged over by F, to be of kind XxP, and dually agent concretions, ranged over by C, to be of kind [x]P. The latter is just a notation for the pair (jc, P) and allows the output transition P - ^ Q to be written P - ^ MQ.V^e write an input Prefix a(x).P as a.F, where F = kxP, and similarly an output Prefix ax. P as a.C, with C = [x]P. Let agents, abstractions and concretions collectively be called the extended agents, ranged over by £", and let c range over names JC, overlined names J, and r. A transition will then be written P —^ E. We further allow Restrictions (vx) to operate on abstractions and concretions with the additional scope extension laws (vy)XxP = Xx(vy)P
and
(vy)[x]P = [x]{vy)P
512
J. Parrow Table 5 Transitions for extended agents P' = P,P-^
E,E = E'
X-STRUCT
X-PREFIX
(2' C.E -U E P-^
E
P + Q-^
E P -^ E
i f X = jc t h e n P —^ E X-MISMATCH
X-PAR
P-^ itx^y
P -^
x^y
thenP-^ E
E
P\Q^^E\Q P-^XxP\
Q ^WQ'
X-COM1
P\Q^P'{^ X-RES
E,
P-^
u/x]1 Q'
x^c. x^c
E,
ivx)P-^{vx)E
provided jc ^ >'; we also allow alpha-conversion in the usual sense, where kx (but not [x]) counts as a binding occurrence of x. And we define Parallel composition for extended agents by P\XxQ
= XJC(PIQ),
P\[u]Q
=
P\(vx)[x]Q
=
[u](P\Q). ivx)[x]iP\Q),
where x ^ f n(P). With these conventions, abstractions are structurally congruent to forms of kind XxP, and concretions are congruent to one of the two forms [x]P or {vx)[x]P, where P is an agent. The transition rules for extended agents are given in Table 5. It is interesting to compare with the standard semantics in Table 3. The new rules are simpler mainly in two ways. First, since transitions carry no objects, X-PAR does not need to deal with a side condition on bound objects. Second, the rule x-RES fulfills the function of both RES and OPEN. The price for this simpUfication is the added complexity of the structural congruence which here has extra rules dealing with abstractions and concretions. To see this connection consider
An introduction to the TT-calculus
513
a derivation of (vu){au . P I u(b). Q) ^ ^ P I uib). Q which uses PREnx, PAR and OPEN in the standard semantics. With extended agents the inference goes by x-PREFix and X-PAR to derive a.[u]P I u.kbQ - ^ [u]P I u.XbQ and then through X-STRUCT, the new part about Parallel composition of extended agents, a.[u]P\u.XbQ^
[u]{P\u.XbQ)
and finally X-RES {vu){a .[uW \u .XbQ) -^
{vu)[u]{P \u .XbQ),
In conclusion, the use of extended agents is conceptually attractive since some of the "bookkeeping" activity in an inference, like keeping track of bound names and their scope, is factored out from the transition rules and included in the structural congruence. Also, the representation of transitions in these rules has proved suitable for automatic tools, in particular if used in conjunction with a symbolic semantics as in Section 5.2, where transitions are of the kind P — ^ E. The drawback is that the format is more unfamiliar to those accustomed to other process algebras.
6. Bisimilarity and congruence We shall here look at one of the most fundamental behavioural equivalences, namely strong bisimilarity. It turns out not to be a congruence - it is not preserved by input prefix - but fortunately the largest contained congruence has a simple characterization.
6.1. Bisimilarity In most process algebras a family of equivalence relations on agents is based on bisimulations, and the TT-calculus is no exception. The generic definition of a bisimulation is that it is a symmetric binary relation 7^ on agents satisfying PKQ and P-^P'
implies
3Q': Q-^
Q'A
P'KQ^
The intuition is that if P can do an action then Q can do the same action and the derivatives lie in the same relation. Two agents are said to be bisimilar if they are related by some bisimulation; this means that they can indefinitely mimic the transitions of each other.
514
/ Parrow
For the ;r-calculus extra care has to be taken for actions with bound objects. Consider P = a(u),
Q = a(x).
(vv)m.
Intuitively these represent the same behaviour: they can do an input along a and then nothing more. However, Q has the name u free where P has not. Therefore, x in Q cannot be alpha-converted to w, and the transition P ^ " > 0 cannot be simulated by Q. Such a difference between P and Q is not important since, if P has an action a(u), then by alphaconversion it also has a similarly derived action a(w) for infinitely many w. Clearly it is sufficient for Q to simulate only the bound actions where the bound object is not free in Q. This argument applies to both input and bound output actions. Also, input (but not bound output) actions mean that the bound object is a placeholder for something to be received. Therefore, if P ^' "^^ P' then the behaviour of P' must be considered under all substitutions {W/JC}, and we must require that for each such substitution Q^ is related to P\ or in other words, that they are related for each value received. In the following we will use the phrase "bn(a) is fresh" in a definition to mean that the name in bn(a), if any, is different from any free name occurring in any of the agents in the definition. DEFINITION 1. A (strong) bisimulation is a symmetric binary relation H on agents satisfying the following: PHQ and P - ^ P' where bn(a) is fresh implies that (i) If a = a{x) then IQ': Q - ^ Q' A^U: P'{u/x}7lQ'{u/x}. (ii) If Of is not an input then ^Q': Q-^ Q' A P'UQ'. P and Q are (strongly) bisimilar, written P'^ Q,'\i they are related by a bisimulation. It follows that ^, which is the union of all bisimulations, is a bisimulation. We also immediately have that P = Q implies P^Q, by virtue of the rule STRUCT. At this point it might be helpful to consider a few examples. Requirement (i) is quite strong as demonstrated by Pi =a(x).P-\-a(x).0,
P2=a(x).P-]-a(x).ifx
= u t h e n P.
Assume that P^O. Then Pi / P2 since the transition Pi -^^^ 0 cannot be simulated by P2. For example, P2 ^ > i f jc = M t h e n P does not suffice since, for the substitution {u/x}, the derivatives are not bisimilar. Similarly, Pi =a(x).P
+ a(x).0,
P2=a(x).P-^a(x).0-]-a(x).ifx
= u then P
are not bisimilar because of the transition P2 -^^^ if x = u t h e n P. Neither 0 nor P is bisimilar to i f x = M t h e n P for all substitutions of JC, since 0 fails for {u/x} and P fails for the identity substitution. Using the intuition that an input P - ^ ^ Q can be thought of as P - ^ XxQ, clause (i) says that the derivatives (which are functions from names to agents) must be pointwise bisimilar.
An introduction to the n-calculus
515
As expected we have aI
b^a.b-\-b.a
and a I a^a .a-\-a .a + r. This demonstrates that ^ is not in general closed under substitutions, i.e., from P ^ Q v/c cannot conclude that Per ^ Qo. For this reason we have c{a) .{a\b)i^ c{a) .{a .b -^b .a) demonstrating that ^ is not preserved by input Prefix, i.e., that from P ^ Q v^t cannot conclude that a(x). P^a(x). Q. However, we have the following results: PROPOSITION
2. IfP^Q
and o is injective then Pa ^ Qa.
PROPOSITIONS. ^ is an equivalence. PROPOSITION
4. ^^ is preserved by all operators except input Prefix.
Proposition 2 is proved by establishing that transitions are preserved by injective substitutions, i.e., that for injective a, P -^
P'
implies
Po - ^ P'o,
where the substitution a applied to an action a is defined not to affect bn(a). This result is established by induction of the inference of P - ^ P' and each rule in Table 3 gives rise to one induction step. It is then straightforward to show that [{Po, Qa): P^ Q, a injective} is a bisimulation. Proposition 3 is not difficult. Reflexivity and symmetry are immediate and for transitivity it suffices to show that '^ '^ is a strong bisimulation. The proof of Proposition 4 goes by examining each operator in turn. It is a bit complicated for the cases of Restriction and Parallel. For example, we would like to show that {{(vx)P,(vx)Q):P^Q}u^ is a bisimulation, by examining the possible transitions from (vjc)F, where the rules RES and OPEN are applicable. Unfortunately this simple idea does not quite work since also the STRUCT rule is applicable, so we have to include all structurally congruent pairs in the bisimulation. A proof idea is the following. Say that an agent is normal if all bound names are distinct and all unguarded Restrictions are at the top level, i.e., of the form (vx)P where P has no unguarded Restrictions. By Proposition 1 any P is structurally congruent
516
/ Parrow
to a normal agent. Now extend the transition rules with the symmetric counterparts of PAR and COM; in view of the commutativity in the structural congruence this does not affect the transitions. That makes it possible to prove the lemma If P - ^ P' and P = N where A^ is normal, then by an inference of no greater depth, A ^ - ^ A^'andP' = A^'. The proof is through induction on the inference of P = N and involves a tedious examination of all rules for the structural congruence. Now we can show that the relation on normal agents { ( ( v i ) ( P | G ) , (vx)(P'\
Q')): P^P\
Q^Q'\
is a bisimulation up to ^ (as explained below), by showing that an action from one side is simulated by an action from the other side, through induction on the inference of the action. There are eight inductive steps through combinations of the PAR, COM, RES and OPEN laws to consider. All cases are routine. Because of the lemma, actions derived through the STRUCT rule can be ignored in the induction since they also have a shorter inference. Finally we can take P = P' = 0 to show that Restriction preserves bisimilarity, and x the empty sequence to show the same for Parallel. The notion of "bisimulation up to" is a standard proof trick in these circumstances. It involves modifying Definition 1 by replacing IZ in the consequents of (i) and (ii) by ^1Z^, i.e., the relational composition of '^, 7^, and ^. The requirement is thus weakened: the derivatives must be bisimilar to a pair in 7^, in contrast to Definition 1 which requires that the derivatives themselves lie in 7Z. It then holds that if two agents are related by a bisimulation up to ^ then they are bisimilar. The proof of this is very similar to the corresponding result for other process algebras.
6.2. Congruence The fact that bisimilarity is not preserved by input Prefix makes us seek the largest congruence included in bisimilarity. The definition is fortunately simple: DEFINITION 2. Two agents P and Q are (strongly) congruent, written P ^ Q, if Pa ^ Qa for all substitutions a. For an example, although a\b^a .b -^b .a these agents are not strongly congruent since the substitution [a/b] makes them non-bisimilar. However, we do have a \b^a.b-\-b,a-\-if
a —b t h e n r
and the reader may by this example realize the crucial role played by the Match operator in an expansion law which reduces a Parallel composition to a Sum. PROPOSITION
5. Strong congruence is the largest congruence in bisimilarity.
An introduction to the n-calculus
517
We first have to show that strong congruence is a congruence, i.e., that it is preserved by all operators. For all operators except input Prefix this is immediate from the definition and Proposition 4. For input Prefix we show that {(fl(jc). P, a{x) .P'):P--
P']\J
^
is a strong bisimulation and closed under substitutions. The latter is trivial since ~ is closed under substitutions. For the bisimulation part, the transition to consider is a{x) .P
> P
which obviously is simulated hy a{x). P' ^' "^ ^> P'; we have to show that for ail u, P[u/x} is related to P^{u/x}, and this follows from P ^ P'. We next show that it is the largest such congruence. Assume that P and Q are related by some congruence ^ ' in ^ . We shall show that this implies that Pa ^ Qa for any a, in other words that --^ c --. Without loss of generality we can assume that a(x)^x fox only finitely many names x since the effect of a on names not free in P or (g is immaterial. So let a = {y\...yn/ x\.. .Xn}- Choose a i fn(P, Q). By P --' Q and the fact that ^ ' is a congruence we get {va){a{x\...Xr,).P\a{yx
...yn)) ~ ' {va){a{x\ .. .x,,). Q\a{y\
...yn))
and by the fact that ^' is in ^ we get, following the r-transition from both sides, that
Pa^Qa.
7. Variants of bisimilarity There are several ways in which the definition of equivalence can be varied. We here consider some variants that are particular to the jr-calculus, in the sense that they differ in how the name substitutions arising from input are treated. We also briefly consider the weak bisimulation equivalences.
7.1. Early bisimulation Bisimulations can also be defined from the early semantics in Section 5.3. This leads to an equivalence which is slightly larger than ^ , i.e., it equates more agents, although that difference is hardly ever of practical significance. For clarity let the transitions in the early semantics be indexed by E, so for example we have
a{x).P^^EP{ulx}, As mentioned in that section the r-transitions are the same with the late and early semantics, in other words —^ is the same as — ^ E , and similarly for output transitions. So the distinction is only relevant for input transitions.
518
/ Parrow
In the early input transition the object represents the value received, and therefore there is no need for clause (i) in the definition of bisimulation with arbitrary instantiation of the bound object. The definition of early bisimulation is in that respect simpler. 3. A (strong) early bisimulation is a symmetric binary relation 1Z on agents satisfying the following: P1ZQ and P - ^ E P' where bn(a) is fresh implies that
DEHNITION
^Q':Q-^EQ'AP'nQ\ P and Q are (strongly) early bisimilar, written P^EQ. bisimulation.
if they are related by an early
To avoid confusion we will in the following refer to Definition 1 as late bisimulation and ^ as late bisimilarity, and correspondingly to ^ as late congruence. A simple example highlights the difference between late and early. Pi =a(x).P-\-a(x).0,
P2=a(x).P-\-a(x).0-\-a(x).ifx
= u t h e n P.
The summand a(x) .if x = u t h e n P is the only difference between P\ and P2. For late bisimilarity this difference is important. It gives rise to the transition > leading to if X = u t h e n P and no transition in Pi can simulate this for all instances of x. But it is not important for early bisimilarity, and indeed P\ ^E PI- TO see this consider the transitions that the extra summand generates, they are aw P2 —>E if w = u t h e n P[w/x}
for all w. For the case that w = u, P\ simulates through P\ - ^ E P{U/X}, and the derivatives are bisimilar since if u = u t h e n P{u/x} has the same transitions as P[u/x}. For the other cases, i.e., w^u, P\ simulates with the transition Pi - ^ E 0, and the derivatives are bisimilar since if w = u t h e n P{wlx] has no transitions. Again it helps to think of late input transitions as resulting in functions from names to agents. Consider the pictorial representation of P\ and Pi in Figure 1 where late input transitions are arrows and instantiations of the bound object are dashed lines (for simplicity we consider only two instantiations u and w where in reality there would be one for each name). Late bisimulation requires that the derivatives simulate after each input —> and then again after each instantiation. Therefore P\ and P2 are not late bisimilar. In contrast, an early input means the same as an input - ^ and an instantiation in the same go. The intermediate level, before the instantiation, does not exist in the early semantics. Therefore Pi and P2 are early bisimilar. For example the bottom alternative from Pi, going through - ^ leading to i f u; = M t h e n P[w/u}, is simulated by Pi going through - ^ to 0. It is also possible to define the early bisimulation through the late semantics. Figure 1 and the definition of late bisimulation provide the intuition: consider the part of the definition (clause (i)) which says there should exist some Q' such that for all u ... .
519
An introduction to the n-calculus Late input and instantiation:
\xO . a/
' iv'^Q
av
..J-^P{U/.T}
XxP..
XxP.. 'w'^P{ivlx}
.H-^ a u ^ uthen
w'^P{ivlx}
P{u/x}
\x if X = u then P w^
if w — u then
P{wjx]
Early input includes instantiation:
P{»/.r} •P{wlx} if a = u then P{w/.r} if w — u then
P{w/x]
Fig. 1. The difference between late and early bisimilarity. P\ =a{x). P -\-a{x) .Q, and P2 = P\ -\-a(x) .if x u t h e n P.
For early bisimulation, the corresponding part should say for all u there should exist some Q' such t h a t . . . . This commutation of the quantifiers weakens the statement, since the choice of Q' here can depend on u. And indeed, with it we obtain a bisimulation which precisely coincides with early bisimulation: DEFINITION 4. An early bisimulation with late semantics is a symmetric binary relation K on agents satisfying the following: PIZQ and P - ^ P' where bn(a) is fresh implies that (i) If a = a{x) then VM ^Q' : Q - ^ Q' A P'{u/x]nQ'{ulx]. (ii) If Of is not an input then ^Q'.Q-^ Q' A P'UQ'.
520
/ Parrow
It is then easy to prove that a relation is an early bisimulation precisely when it is an early bisimulation with late semantics. So it is a matter of convenience which of the two definitions to use. The converse idea (to capture late bisimilarity using early semantics) is also possible. Early bisimilarity satisfies the same propositions as late bisimilarity in Section 6: it is preserved by injective substitutions and all operators except input Prefix; and early congruence ~E, defined by P ^E Q if for all a. Pa ^E Qcr, is the largest congruence in ^ E • The proofs are very similar. Early congruence is larger than late congruence, i.e., ^ C - ^ E . and the example in Figure 1 suffices to prove that the inclusion is strict. It is hard to imagine any practical situation where the difference between late and early congruence is important. Since the theoretical properties are very similar the choice between them is largely a matter of taste. It could be argued that early congruence to a higher degree conforms to our operational intuition, and that the definition is less complex. On the other hand, late congruence seems to lead to more efficient verifications in automated tools.
7.2. Barbed congruence In some sense the notion of bisimilarity, be it late or early, assumes the observer is unrealistically powerful: since there is a difference between the actions au and avu it is possible to directly detect if an emitted name is local. It is therefore natural to ask what is the effect of reducing this discriminatory power. This leads to the idea of barbed bisimulation where, intuitively, the observer is Hmited to sensing if an action is enabled on a given channel. Although barbed bisimilarity is weaker (i.e., equates more agents) than early bisimilarity it turns out that the congruence obtained from barbed bisimulation is the same as early congruence. DEFINITION 5. A name a is observable at F, written P J, «, if « is the subject of some action from P. A barbed bisimulation is a symmetric binary relation IZ on agents satisfying the following: PTZQ implies that
(i) UP -^ P' then ^Q':Q-^ (ii) UP iaihtnQia.
Q' A P'UQ^
P and Q are barbed bisimilar, written P ^ B Q^ if they are related by a barbed bisimulation. The idea behind a barbed bisimulation is that the only unquestionable execution steps are the internal ones, i.e., the r-actions, since these do not require participation of the environment. Therefore labelled transitions are not needed to define barbed bisimulation. It is enough with the reduction relation of Section 5.4 and the observability predicate, which like reductions can be defined directly from the syntax as P i a if P contains an unguarded Prefix with subject a not under the scope of a Restriction va. Barbed bisimilarity is uninteresting by itself. For example, au ^B ^v ^B (vu)au identifying three clearly different agents. Of more interest is the congruence it generates.
An introduction to the n-calculus DEHNITION 6. Two agents P and Q are barbed congruent, written P contexts C it holds that C{P) ^ B C{Q).
521 ~ B Q.
if for all
In other words, barbed congruence is the largest congruence in barbed bisimilarity. Clearly the three agents above are not barbed congruent. Take the context C{P) =
P\a{x).x.
Then C(au) -^ u ^ u and this cannot be simulated by Ciav) and not by C((vu)au). In fact barbed congruence coincides with early congruence: PROPOSITION 6.
"B = "^E-
This lends considerable support to early congruence as the natural equivalence relation. The main idea is to prove that ^ e is an early bisimulation. Suppose P ^B Q and P - ^ P\ then a cushioning context C can be found such that C(P) - ^ C'{P'), so C{Q) must simulate this transition. But C is cleverly constructed so that the only possible way that C{Q) can do this is because of a transition Q - ^ 2 • We shall not go further into the proof here which is quite involved. Variants of barbed congruence use variants of the observability predicate, leading to a spectrum of possibilities. For example, a weaker variant is to use P | to mean 3a \ P \r a, and amend clause (ii) in the definition of barbed bisimilarity io P i if^ Q i. With this definition Proposition 6 still holds, though its counterpart for weak bisimulation (cf. Section 7.4) is less clear. Omitting clause (ii) entirely Proposition 6 no longer holds. For example, then \T \ Q and \x \R would be barbed congruent for all Q and R. Also, in subcalculi of n the barbed congruence may be different (because there are fewer contexts). As one example, in the asynchronous subcalculus (Section 3.5) and where observations P \. a mean that P can do an output action along a (in the asynchronous calculus it makes sense to regard inputs as unobservable) it holds that a{x) .ax + r '^B ^•
7.3. Open bisimulation As has been demonstrated neither late nor early bisimilarity is a congruence; to gain a congruence we must additionally require bisimilarity under all substitutions of names. Interestingly, there is a way to define a congruence directly through bisimulations. This is the idea behind open bisimulation, which incorporates the quantification over all substitutions in the clause for bisimulation. This leads to a congruence finer than late congruence (i.e., it equates fewer agents) although that difference is not very significant in practice. To begin we consider a subcalculus without Restriction and Mismatch. The definition will subsequently be extended to accommodate Restriction (no simple extension for Mismatch is known).
522
/ Parrow
7. A (strong) open bisimulation is a symmetric binary relation H on agents satisfying the following for all substitutions a\ P1ZQ and Pa - ^ P' where bn(a) is fresh implies that DEFINITION
BQ':Qa-^
Q'and
P'UQ',
P and Q are (strongly) open bisimilar, written P ^ o G. if they are related by an open bisimulation. A technical remark: the condition on bn(Qf) is unnecessary in view of the fact that we deal with a subcalculus without Restriction, but it is harmless and is included for the sake of symmetry with other similar definitions. In open bisimulation there is no need for a special treatment of input actions since the quantification over substitutions recurs anyway when further transitions are examined: If P - ^ - ^ P' is simulated by Q - ^ ^ Q\ then the requirement implies that all transitions from P^G must be simulated by Q'a for all a, including those substitutions that instantiate X to another name. This also demonstrates the pertinent difference between open and late: where late requires the agents to continue to bisimulate under all substitutions for the bound input object, open requires them to bisimulate under all substitutions - not only those affecting the bound input object. It is straightforward to show that an open bisimulation is also a late bisimulation, and hence P ^o Q implies P^ Q. Furthermore, directly from the definition we get that open bisimilarity is closed under substitution, in the sense that P ^o Q implies Pa ^o Qa\ together these facts give us that P ^o Q implies P ^ Q. But the converse is not true as demonstrated by the following example: e = r + r.r, R = r - f T . T H - r . i f j c = j t h e n r. Q and R are late congruent. To see that Qa is late bisimilar to Ra for all a, consider two possibilities for a. Either a(x) = a(y), in which case Ra —^ i f a(x) = a(y) t h e n r is simulated by Qa —^ x\or a(x)^ cr(y), in which case it is simulated by Qa —^ 0. But Q and R are not open bisimilar. To see this, choose a as the identity substitution and consider R —^ if. x = y t h e n r. There are two possibilities for Q to make a r transition. One is Q —^ 0. But then open bisimulation requires that the two derivatives it X = y t h e n r and 0 bisimulate again under all substitutions a\ and this does not hold for a' = [x/y] since (it x = y t h e n T)[x/y) —^ 0 whereas 0{jc/y} has no transition. Similarly, the other transition Q —^ r fails for the identity substitution, since i f x = y t h e n r has no transition, in contrast to r. This example may seem artificial and, as for the difference between late and early, the difference between open and late is probably of little practical significance. Open bisimilarity is an equivalence and a congruence, so by analogy with the other equivalences, writing "^o for the largest congruence in ^ o . we get '^o = "^o (the proofs are technically similar to the proof for late congruence). It can also be characterized in a few other informative
An introduction to the n -calculus
523
ways. One is through substitution closed ground bisimulations. A ground bisimulation is a relation IZ satisfying PUQ and P-^
P'
implies
^Q'.Q-^
Q' and P'HQ'.
In other words, it does not introduce substitutions at all. Now it holds that -^o is the largest substitution closed (i.e., P1ZQ imphes PalZQa) ground bisimulation. Another characterization is with dynamic bisimulations: these are relations satisfying PUQ andC(P) - ^ P'
implies
BQ':C{Q) - ^ Q' and P'UQ'
for all contexts C. It can be shown that dynamic bisimilarity is the same as open bisimilarity. At first it may seem that the Restriction operator behaves well with open bisimulation since the substitutions only affect free names. Consider P = (vx)if
X = y thenr
and
Q = 0.
Neither Pa nor Qa have any transitions, for any substitution a, since the substitution cannot affect the bound name x. Therefore P^oQ. Similarly with P = (VX)T . i f JC = y t h e n r
and
Q=r
we have P ^o Q, since P —^ (vjc)if x = y t h e n r and this derivative is similarly immune to substitutions. The problem arises because of bound output actions. Consider P = (vx)ax .if X = y thenr
and
Q = ivx)ax.
Here P - ^ ^ if x = y t h e n r. Clearly Q cannot simulate by Q - ^ ^ 0 because the two derivatives, i f jc = y t h e n r and 0, are not bisimilar for the substitution {x/y}. Here the bound output action has lifted the Restriction so x becomes vulnerable to a substitution. But we would certainly want to identify P and Q. The name x in P is a local name and no matter what an environment does on receiving it, that name cannot become the same as y, so the i f test will never be positive. Also P and Q are late congruent. Therefore in the presence of Restriction, Definition 7 is too discriminating: it considers too many substitutions. One way to amend it is to use the auxiliary concept of distinctions. The intuition behind a distinction is to record those pairs of names that will always be distinct, no matter what actions take place. Definition 7 is modified so that it only considers substitutions that respect distinctions, in the sense that two names required to be distinct are not substituted by the same name. Following a bound output transition the derivatives are related under a larger distinction, representing the fact that the bound object will be kept different from any other name. Formally a distinction is a symmetric and irreflexive binary relation on names. In the following we let D range over finite distinctions (infinite distinctions are not necessary and may cause problems with alpha-conversion if they include all names). We say that a
524
/ Parrow
substitution cr respects a distinction D if a Db implies a (a) ^ a (b). We further let Da be the relation {(a(a), a(b)): aDb]. When A^ is a set of names we let D + (x, N) represent D U ({x} X A^) U (A^ X {jc}), in other words it is D extended with the fact that x is distinct from all names in A^. DEHNITION 8. A distinction-indexed family of binary relations on agents is a set of binary agent relations IZp, one for each distinction D. A (strong) open bisimulation is such a family satisfying the following for all substitutions a which respect D\ PTZDQ and Per - ^ P' where bn(a) is fresh implies that
(i) lfa=dvx then 3Q': Qa - ^ Q' A P'IZDQ'. where D' = DG^{X, fn(Pa, Qa)). (ii) If Of is not a bound output then 3Q' \ Qo -^ Q' r\ P'lloa Q'• P and Q are open D-bisimilar, written P^Q Q , if they are related by Rp in an open bisimulation, and they open bisimilar, written P ^ o G if they are open V^-bisimilar. Here the proviso that bn(Qf) is fresh means it is not in f n(P(7, Qa). The overloading of " '^o " is motivated by the fact that for the subcalculus without Restriction Definitions 7 and 8 coincide. In essence, the distinction keeps track of what substitutions are admissible, excluding those that do not respect the distinction. After any action except a bound output, the distinction recurs in that the substituted names must still be distinct. After a bound output, additionally the bound object must be distinct from any free name in the involved agents. As an example we can now demonstrate that P ^o Q where P = (vx)ax .if X = y them
and
Q = (vx)dx.
Consider the transition P - ^ ^ i f jc = y t h e n r and the simulating transition Q - ^ ^ 0. The definition then requires, by clause (i), that i f JC = y t h e n r^^O for D = {(^, y)^ (y^x)} and this is indeed the case: for a substitution a respecting D, the agent (if X = y t h e n T)a has no transitions. Distinctions will however not admit Mismatch in a sensible way. For example, we would want to equate the agents i f X ^ y t h e n r .if x :^y t h e n r
and
ifx^y
then r . r
but the requirement that derivatives bisimulate under all substitutions will make them inequivalent. In order to admit Mismatch a more fundamental redefinition of the semantics is necessary, where the Mismatch is explicitly noted in the transition, for example by using a symbolic semantics as in Section 5.2. In conclusion, the definition of -^o loses some of its simplicity in the presence of Restriction and it is still not applicable with Mismatch. It gains interest in that it appears more efficient for automatic verification and in that distinctions sometimes have an independent motivation to represent "constant" names such as values in some global data type or ports which are necessarily distinct. For example, if Booleans are represented by two globally available names t and / then clearly it is uninteresting to consider substitutions making
An introduction to the TT -calculus
525
~o = ~o
Fig. 2. Barbed, early, late and open bisimilarity and the corresponding congruences. An arrow means strict inclusion, and when it goes from the left column to the right it also means "largest congruence in".
them equal. Similarly, the question whether a buffer B(i, o) with input port / and output o behaves as another buffer 82(1, o) might be relevant only for the case that / :^ o. The various definitions of strong bisimilarity and congruence are related in Figure 2. In summary, barbed bisimilarity is much too weak to be interesting, while the difference between early and late is very small and has to do with the precise interpretation of input transitions. Barbed congruence is the same as early congruence. The early and late congruences are obtained as bisimilarity for all substitutions, and again the difference between them is small. Open bisimilarity (defined only for the subcalculus without Mismatch) is a congruence and is more discriminating than late congruence since it requires bisimilarity for all substitutions after every transition.
7.4. Weak bisimulation The main idea of weak bisimulation is that r transitions are regarded as unobservable. We therefore define ==> to mean (—^)*, i.e., zero or more r transitions, = ^ to mean = = ^ - ^ = » , and =:^ to mean = ^ if a 7^ r and = > if a = r. The intention is to modify strong bisimilarity in the standard way, replacing - ^ by = ^ . The only complication is in the treatment of input actions. These call for substitutions of the bound object, and when simulating a{x)hy —^ ^ -^^^ —^ ^ it turns out to be important that the ci{x)
substitution is applied immediately after the input action —->, before further r transitions.
526
/ Parrow
9. A weak {late) bisimulation is a symmetric binary relation Tl on agents satisfying the following: PIZQ and P - ^ P' where bn(Qf) is fresh implies that
DEFINITION
(i) Ifof = a ( x ) t h e n 3 e ' ' : G = » - ^ Q" A'iu^Q': Q"{u/x}=^ Q'AP'[u/x}nQ'. (ii) If a is not an input then 3Q' : Q ^ Q' A P'llQ'. P and Q are weakly (late) bisimilar, written P^Q,\i they are related by a weak bisimulation. Clause (i) says how an input transition should be simulated: first do any number of r, then the input reaching Q'\ and then, for each name u received, continue to some Q'. The effect is that the choice of Q" is independent of M, and the choice of Q' may depend on u. Let us see an example of the significance of this: Pi = a{x). i f jc = i; t h e n P+ a{x) .(r + r . P - h r . i f J c = i; t h e n P), P2 = a(x) .(T-^T.P-^T.ifx = v t h e n P), ^3=
a(x).(T-\-T.P).
First, observe that P2 is even strongly bisimilar to P3, since T - h T . P - - r + r . P + r . i f x = i; t h e n P (any substitution makes the third summand behave as one of the first two). Now consider a transition Pi - ^ i f x = i; t h e n P . Can P2 simulate this? Yes, by the transition P2 - ^ T + r . P + r . i f j c = i; t h e n P and now applying {u/x} by one r-transition to ( i f JC = i; t h e n P){u/x}. Since P2 ^ P3 we also expect P3 to simulate it, and this requires the full glory of clause (i), with different Q^ for different u. The simulating transition is
and now applying {u/x}, by one r transition to either P or 0, depending on if M = i; or not. So here we have Pi ^ P2 ^ P3. This example also highlights why a simplification of clause (i) to 3Q':
Q ^ ^
Q'AVU:
P'{U/X}7ZQ'{U/X}
fails. With such a clause we would have that Pi ^ P2 and P2 ^ P3, yet P\j^P?>. In other words, weak bisimilarity would not be transitive. The reason is that P3 no longer can
An introduction to the n-calculus
527
simulate Pi -^^-^ i f x = i; t h e n P, since neither 0, P, nor T + r . P is bisimilar to i f ;
Other strong bisimulation equivalences also have weak counterparts in a similar way. For example weak early bisimilarity is obtained by replacing Q - ^ Q' in Definition 3 by Q = ^ Q'; since there are no bound inputs, the complication with clause (i) in Definition 9 above does not arise. Weak barbed congruence is obtained by replacing Q —^ Q^ by Q = > Q^ and Q iahy Q =^i a in Definition 5. The weak barbed congruence coincides with weak early congruence for image-finite agents (this is a mild technical condition which roughly means that the agent can only reach a finite number of different derivatives after = ^ ) . Also weak open bisimulation is obtained by replacing Qa - ^ Q' by Qa = ^ Q' in Definition 7.
528
/
Parrow
8. Algebraic theory In this section we consider algebraic axiomatizations of late strong bisimilarity and congruence. This means that we identify a set of axioms for equality between agents, and that together with equational reasoning these imply all true equalities. We get one such set of axioms for bisimilarity and another set for congruence. These results only hold for the finite subcalculus, i.e., we do not include Identifiers or Replication. (In the whole calculus such a result cannot be obtained since bisimilarity, and also congruence, is not recursively enumerable and hence has no decidable axiomatization.) 8.1. Bisimilarity Initially we restrict attention to the finite subcalculus without Parallel composition. The axioms for strong late bisimilarity are given in Table 6. We also implicitly use the laws of equational reasoning, i.e., that equality between agents is reflexive, symmetric and transitive. Note that substitutivity (that an agent can replace an equal agent in any expression) is not implied, since bisimilarity is not a congruence. The axioms deserve little comment. STR says that all laws for structural congruence can be used. CONGRl says that all operators except input Prefix preserve bisimilarity, and C0NGR2 says that to infer bisimilarity of input Prefixes it is sufficient to establish bisimilarity under substitutions for the bound object. Note that C0NGR2 mentions only a finite number of such substitutions: names free in the agents under consideration plus one more name represented by jc. In view of Proposition 2 this is sufficient since all other names can be obtained through an injective substitution on JC. Laws M 1 - M M 2 serve to evaluate i f constructs, and therefore a clause for Match and Mismatch in CONOR 1 is unnecessary. The reader may remember from Section 5.1 that MM2 is not admissible in the structural congruence and may therefore be surprised to see this apparently unsuitable law in Table 6.
Table 6 Axioms for strong late bisimilarity STR If P = Q then P = Q CONGR1 If P = Q then au.P=au.Q T.P = T.Q
P+R=Q+R {vx)P = {vx)Q CONGR2 If P{y/x} = Q{y/x} for all y e f n(P, Q, x) then a{x). P = a{x). Q
R2
p+p = p i f jc=jc t h e n P = P i f jc = V t h e n P = 0 ±tx^x thenP = 0 itxi^y then P = P {vx)a .P =a .{vx)P {vx)a.P = ^
R3
(VJC)(P + Q) = (VX)P +
s Ml M2
MMl MM2
Rl
ifjc^y xfx^y i f JC ^ Q f
if JC is the subject of a {vx)Q
An introduction to the n -calculus
529
The explanation is that MM2 is unsuitable for a congruence, since prefiguring both sides of it by an input prefix may invalidate it, and that bisimilarity is not a congruence; prefiguring with an input prefix requires the law C0NGR2. R 1 - R 2 mean that a Restriction can be pushed through a Prefix or disappear; the only exception is when x is the free object of a in which case neither R1 nor R2 applies. Observe that Rl can be regarded as scope extension over Prefix; as was mentioned in Section 2.2 an option is to have this law as part of the structural congruence. Finally R3 means that Restriction distributes over Sum. This law is more powerful than scope extension over sum, since it splits one binder into two. It is easily seen that all laws are sound, so if /^ = (Q is provable then it must hold that P ^ Q. We shall now also prove the converse. In the following it is important to remember that a ranges also over bound output Prefixes of kind 'avx. Let the depth of an agent be the maximal nesting of its Prefixes. PROPOSITION 7. Using the axioms in Table 6 every agent P is provably equal to a head normal form (hnf) of kind ^ - of/. Pi of no greater depth.
The proof is by induction over the structure of the agent and all cases are easy. If P is a Match or Mismatch then M1-MM2 applies; if it is a Restriction then R3 is used to distribute it onto the summands and R 1 - R 2 to push it through the Prefixes or form part of a bound output Prefix. PROPOSITION
8. If P ^ Q then P = Q is provable from the axioms in Table 6.
The proof is by induction on the depths of P and Q. By Proposition 7 we can assume P and Q are head normal forms. The base case P = Q = 0 is trivial. For the inductive step we prove that for each summand in P there is a provably equal summand in Q and vice versa. For example, take a summand a(x). P' in P. Assume by alpha-conversion that all top-level input actions have the same bound object x. Then from P ^ Q and P > P' we get Q - ^ ^ Q' such that P'{u/x}^ Q'{u/x} for all u. By induction they are also provably equal for all u.So a(x). Q' is a summand of Q and from C0NGR2 we get that it is provably equal to a{x). P'. The other cases are similar and simpler. So, each summand of P is provably equivalent to a summand of Q and therefore, by the law s (and STR), P is provably equivalent to Q. We now turn to the Parallel operator. The idea behind the axiomatization is to introduce an expansion law through which the composition of two head normal forms is provably equal to a head normal form. With this law Proposition 7 will continue to hold for the calculus with Parallel, and therefore the proof of Proposition 8 needs not change. The expansion law is given in Table 7. The proof of Proposition 7 is now extended with an inductive step for P = Q | /? where Q and R are hnfs. First use scope extension (Proposition 1) to pull any unguarded Restrictions in 2 I /? to top level, obtaining an agent of kind {\>x){Q' \ R') where Q' and R' are hnfs with no bound output Prefixes. Then apply EXP to Q' \ R' gaining an agent of type {vx)P' where P' is a hnf, and finally use scope extension to push back the Restrictions inwards, gaining a hnf.
530
/
Parrow
Table 7 Expansion law for strong bisimilarity EXP Let P = J2i«/ . Pi and Q = J^j fij . Qj where bn(a/) fl fniQ) = 0 and bn(/3y) n fn(P) = 0 for aU /, j , and none of a, or fij is a bound output Prefix. Then
P\Q = J2ai.(Pi\Q)-hJ2^J-^^^^J^-^ /
j
E
^-^'7
aj compftj
where the relation a, compfij and /?/y are defined as follows: either a, = fl(jc) and /^y = au in which case ^;7 = Pi{i*/x} I S ) . or conversely a, = «M and fij =aix) in which case Rjj = Pi \ Qj{u/x].
8.2. Congruence Following Definition 2 we immediately obtain an axiomatization of ^ by adding that definition as a law. Interestingly, there is an alternative axiomatization that does not involve quantification over substitutions and does not refer back to bisimilarity. Again we begin with the subcalculus without Parallel. It is informative to begin by examining the axioms in Table 6 to see what needs to change. The rule STR is still valid and useful, and the rules CONOR 1-CONGR2 can be replaced by a simpler rule saying that ^ is a congruence. The problematic laws are M2 and MM2 which are unsound for congruence. For example, even though i f x = y t h e n P and 0 are bisimilar when x ^ y they are not necessarily congruent since a substitution {x/y} makes them non-bisimilar. In an axiom system for ^ we cannot rely on axioms which ehminate unguarded Match and Mismatch operators. A concise presentation of the axioms depends on the notion of a Generalized match operator written if M t h e n P, where M is a conjunction of conditions of type x = y and X ^y. The Generalized match is simply defined to be a nested sequence of Matches and Mismatches, one for each condition: i f mi A"- Anik t h e n P = if m\ t h e n (•••(!£ nik t h e n
P)-"),
where each m/ is of type jc = y or jc 7^ y. We say that M logically implies A^ if all substitutions that make the conditions in M true also make the conditions in A^ true, and that they are logically equivalent, written M ^ N/if they imply each other. This allows us to use the compact law OM1: i f M t h e n P = i f A^ t h e n P
if M<^ A^
in place of a set of laws for nestings of Matches and Mismatches. The axioms for strong late congruence are given in Table 8. We conmient briefly on the new axioms. 0 M 2 is a form of case analysis, allowing us to split an agent to a Sum of two mutually exclusive conditions. Writing out the definition of i f . . . t h e n . . . e l s e this law is i f jc = y t h e n P-{-if
x ^ y t h e n P = P.
An introduction to the n-calculus
531
Table 8 Axioms for strong late congruence
STR CONGR
If P=Q then P = Q " = " is preserved by all operators
S
P + P~P
MMl
i f JCT^JC t h e n P = 0
GMl GM2 GM3 GM4 GM5 GM6 Rl R2 R3
i f M t h e n P = i f A^ t h e n P \i M ^ N i f jr = V t h e n P e l s e P = P i f M t h e n (Pi + Pi) = i f M t h e n Pi + i f M t h e n Pi i f M t h e n a . P = i f M t h e n (a. i f A / t h e n P ) ifbn(a)^M i f JC = V t h e n a . P = i f ;r = y t h e n {a{x/y]).P (vjc)if JC = J t h e n P = 0 if^?^v {vx)a .P = a .{vx)P ifjc^or {vx)oi. P = 0 if X is the subject of a (VX)(P + 0 = (vjc)P + (vjc)(2
GM3 is a kind of distributive law for Generalized match over Sum. GM4 says that a test, once passed, can be done again after an action a, since that action cannot invalidate the outcome of the test. Here the side condition on bn(a) is important. GM5 embodies the essence of a match: if x and y have been deemed equal then one can substitute the other (the substitution is defined to not affect bn(a)). Since x = >' 4> y = x we get from GMl that it does not matter whether the substitution is {y/x} or {x/y]. And combined with GM3 and GM4 we get all instances of a stronger law ±t x = y t h e n a . P = i f x = y t h e n {a. P){x/y} where the substitution affects the whole Prefix form. Finally GM6 is the essence of Restriction: a restricted name can never be made equal to another name so the Match will always come out as false. As can be seen the law MM 1 is inherited from the axioms for bisimilarity. Of course also M1 is valid but it is not necessary as an axiom since it can be derived from GM2 and MM 1. Similarly, a counterpart for Mismatch to GM6, namely GM6*
{vx)xtx^y
thenP
= {VX)P
iix^^y
is derivable from GM2 and GM6. Thus a Restriction can always be pushed through a generalized match. Also, note that i f x = y t h e n 0 = 0 is derivable from MM 1 and GM2. For an example of a derivation consider {vx)ax . i f jc = y t h e n P which, as argued in Section 7.3, is congruent to {vx)ax. 0. The proof from axioms is: (yxydx . i f jc = J t h e n P = [GM6*] {vx)±txi^y thenajc.if X = j then P = [GM4] (vx)if x^y t h e n a x . i f jc ^y t h e n i f JC = >' t h e n P — [GM6*] {vxyUx .±t X ^y t h e n xt x = y t h e n P = {vx)ax.ifx ^y Ax = y t h e n P = [GMl] (vx)ax.ifx^x thenF= [MMl] (vjc)^jc. 0.
532
7. Parrow
It is easy to establish that all laws are sound for congruence. The proof of completeness uses another kind of head normal form and is more involved than the corresponding proof for bisimilarity, and we shall here only sketch it. It relies on the notion of complete conjunctions. Formally, a conjunction M is complete on a set of names V if M implies either X = y ox X ^yfox all names x.y'm V. In other words, M expresses unambiguously which names are the same and which are not. We say that M agrees with a substitution a if M implies x = y if and only if (T(JC) =a{y). The main use of complete conjunctions is that if M is complete on fn(P, Q) and agrees with a, then ( i f M t h e n P) ~ ( i f M t h e n Q) holds if and only if Po ^ Qa. In this way the substitutions arising from the transitional semantics can be internalized and represented by Generalized matches. DEFINITION
11. P is in head normal form on a finite set of names V (V-hnf) if
P = ^
i f Mi t h e n a,- . Pi, i
where for all /, bn(Qf/) ^ V, and each M, is complete on V. So a V-hnf is a Sum of Generalized matches where each conjunction is complete on V. PROPOSITION
9. For any V, any agent P is provably equivalent to a V-hnf of no greater
depth. The proof is by induction over the structure of PAf P =a .P' then use GM2 repeatedly to generate a Sum ^ - i f Af, t h e n a . P' where the M, are complete. \f P = {vx)P' then by induction P' is a V-hnf ^- i f M, t h e n a, . P,. Use R3 to distribute (vjc) onto all summands, GM6 and G M 6 * and STR to push the Restriction through all M, and finally R 1 - R 2 to push it through all of, (unless x is the free object of a,, in which case (vjc) forms part of a bound output Prefix). The other cases are simple from the distributive laws. PROPOSITION
10. IfP--Q
then P = Q is provable from the axioms in Table 8.
The proof is by induction on the depths of P and Q and by the previous proposition we can assume that P and Q are fn(f, (2)-hnfs. The idea of the inductive step is as before to show that for each summand in P there is a provably equal summand in Q. We indicate the main lines for free output summands - the case for bound actions is a little bit more involved though the idea is the same. So let i f M t h e n a . P' be a summand in P with a a free output action. Choose a substitution a that agrees with M. Then Pa - ^ P'a. From P -^ Q v/c get that Qa must simulate this transition. Let i f A^ t h e n p . Q' bt the summand of Q that generates the simulating transition, which implies that P'a ^ Q'a. Then A^ also agrees with a, and since both M and A^ are complete and agree with a we get M <> A^. Therefore by GMl we can replace A^ by M in the summand of Q. And by GM5 we can replace ^ by a, because they can only differ in names identified by a, meaning that M implies the equality of those names. There thus remains to prove i f M t h e n a. P' — 2.t M t h e n a. Q'. We know that Pa ^ Q'a. Since M is complete it holds that this implies i f M t h e n P' ^ xt M t h e n Q\ whence by induction
An introduction
to the JT-calculus
533
Table 9 Expansion law for strong congruence EXP2 Let /* = E / i f ^i t h e n a,- . Pj and (2 = E y i f ^j t h e n ^j . Qj where bn(a,) fl fn{Q) = 0 and bn(^j) fl f n(f*) = 0 for all /, 7, and none of a, or pj is a bound output Prefix. Then
P\Q = Y^ifMi ' +
y^
then a/. (P/ \Q)-\-^ifNj J
then fij .(P \ Qj)
if Mj A Nj A a; = bj t h e n T . Rjj,
where the relation a, opp^j, aj, bj and /?/y are defined as follows: either a, = a,(:c) and ^j = bju in which case Rjj = Pj {u/x} \ Qj, or conversely a, = a/M and ^j — bj {x) in which case/?/y = P/|gy{^/jc}.
these are provably equivalent. We now apply GM4 (for the first time in the proof!) to write i f M t h e n a . P' as i f M t h e n or. i f Af t h e n P'. That means it is provably equivalent to i f M t h e n a . i f M t h e n g', and again by GM4 to i f M t h e n a . G^ Finally we consider also the Parallel operator. By analogy with the case for bisimilarity it is enough to include an axiom which implies that the Parallel composition of two V-hnfs is a V-hnf. Unfortunately the axiom EXP in Table 7 is not sound for congruence, since a substitution may identify two names and thereby enable a communication. The amended expansion law for congruence is given in Table 9. Note the essential use of Matches to determine if a communication is possible. With this law Propositions 9 and 10 hold. Incidentally, the law is sound and complete also for bisimilarity, i.e., it can be used in place of EXP for the purpose of Proposition 8.
9. Variants of the theory We here briefly mention the axiomatizations of the equivalences treated in Section 7.
9.1. Early bisimilarity and congruence Early bisimilarity equates more agents than late and therefore we seek more axioms. It turns out that we need to add only one axiom to Table 6 to obtain a complete system. This characteristic axiom for early is: EARLY
a(x). P -f fl(x). Q =
a(x). P -h a(x). Q -\- a(x). if X = y t h e n P e l s e Q. The example from Section 7.1: Pi =a(x).P-\-a(x).0,
P2=aix).P-\-a(x).O^a(x).ifx
= u then P
534
/ Parrow
is an instance of EARLY with g = 0. So clearly this axiom is unsound for late bisimilarity. The soundness for early bisimilarity is straightforward from the definition. If EARLY is adjoined to Table 6 we get a complete axiomatization of early bisimilarity. The proof of this is different from the corresponding proof of Proposition 8 since it is no longer the case that each summand of P has a bisimilar summand of Q. Therefore, the hnfs corresponding to P and Q must first be saturated by applying EARLY, from left to right, as much as possible to generate new summands. Although the axiom can be applied ad infinitum it turns out that there are only a finite number of distinct new summands that need be generated this way. If instead EARLY is adjoined to Table 8 then we similarly get a complete axiomatization of early congruence. The proof is a combination of the above idea and the proof of Proposition 10. Interestingly, there is an alternative to EARLY as a characteristic law for early congruence, namely EARLY2 if E , r . P/ = Y.J ^ • Qj then Y.i «(^) • Pi = Ey «(^) • QjWe can see that EARLY and EARLY2 are equipotent as follows. Consider T.P + x.Q = T.P-\-T.Q-^T.itx
= y tYienP
e l s e Q.
This equation is certainly true for ^ , since any substitution will make the third summand behave as either r . P or r .Q. Hence all instances are derivable from the laws in Table 8. Applying EARLY2 to the equation we get EARLY. So any equation that can be derived with EARLY can also be derived with EARLY2. The converse follows by the fact that EARLY yields a complete axiomatization for '^E and EARLY2 is sound. Similarly, a version of EARLY2 for early bisimilarity is EARLY2'
if VM : Yli -^ ' Pi{u/x} = Ey ^ • Qy{"A} then J2i ^M • ^/ j
This may appear more complicated than EARLY but it also replaces CONGR2 and an interesting point is that it does not introduce a Mismatch operator. In the subcalculus without Mismatch we can therefore axiomatize late and early bisimilarity (just drop MM 1 and MM2 from Table 6). In contrast, for late and early congruence the Mismatch operator plays a significant role in forming complete Generalized matches, so axiomatizations without Mismatch must take a different route.
9.2. Open bisimilarity The remaining interesting equivalence in Figure 2, open bisimilarity (which also is open congruence), is special in that it is only defined for the subcalculus without Mismatch. The way to axiomatize it goes through the relations ^ Q (open bisimilarity under distinction D) so the axiomatization schematically gives rules for all D. The axioms in Table 8 need
An introduction to the n-calculus
535
some modifications. All axioms mentioning Mismatch are dropped; this means that MM 1 and GM2 are omitted and in GM1,3,4 M ranges over Generalized matches with no negative conjuncts. A new axiom GM7
P + ±tx = y t h e n P ^P
is added (in the original Table 8 this is derivable through S and GM2). Finally for the interplay between different distinctions we add the following laws, where = o means provable equality under distinction D, Dl i f x = y t h e n P = D O v>2 P=DQ
implies {vx)P
D3 P=DQ
if JcDy,
implies P =D' Q =D-.X
if D c
D\
(VX)Q.
Here D — x means the distinction where all pairs containing x are removed from D. Because of these laws GM6 is derivable and needs not be taken as an axiom. With these changes we obtain a complete axiomatization of ^Q for all D. The proof is substantially more complicated than for Proposition 10. It uses a notion of head normal form with summands of type if M t h e n or. P, and with the extra requirement that there are no unnecessary summands (a summand P is unnecessary if there is another summand Q and Q^oQ + P)- The proof that all agents are provably equal to such head normal forms uses, among other things, the new law GM7 in order to remove unnecessary summands. The idea of the completeness proof is that given two bisimilar head normal forms, each summand in one of them is provably equal to a summand in the other.
9.3. Weak congruence Finally, for the weak late and early congruences (axiomatizations of weak open congruence have not yet been investigated) it is enough to add the three standard so called r-laws: Tl T2
T3
a.T .P =a.P, P + r.P = r.P, a.(P-\-T.Q):=a.(P-\-T.Q)-\-a.Q.
The proof follows the same lines as the corresponding proof in CCS: the head normal forms must be saturated in the sense that if P = ^ P' then P has a summand a. P^Tosee an example derivation which demonstrates the subtlety of the interplay between r-actions and the laws for Match and Mismatch, and highlights a technique used in the completeness proof, suppose we want to prove a(x).(P -h i f X = y t h e n r . P) =a(x).
P.
Clearly this holds, since (P 4- i f jc = y t h e n r . P){u/x} is weakly bisimilar to P{u/x} for all u. The complication is that (P + i f x = y t h e n r . P) is not weakly congruent to P,
536
J. Parrow Table 10 Axiomatizations of the bisimilarities and congruences. strong bisimilarity
strong congruence
weak congruence Table 8
late
Table 6
Table 8
and T1,T2,T3
Table 8 Table 6
Table 8
and
and
and
EARLY o r EARLY2
EARLY or EARLY2'
EARLY orEARLY2
and
early
i
T1,T2, T3
Table 8 except laws for Mismatch open
and
not investigated
GM7, D 1 , D 2 , D3
since the former has an initial r-transition for the substitution {y/x}. The proof technique is therefore to first infer T .(P-\-ifx
= y t h e n r . P) = r . P
and then use CONGR, prefixing both sides by a(x), and Tl to remove the T. The inference ofT.(P-\-ifx = y t h e n r . P) = r . P is as follows:
r.(P4-ifJC = j then z . P) = (GM2) if x = y then r . (P -f if jc = y then r . P) -]-ifx^y thenr.(P-hif jc= J then r . P) = (GM 1,3,4) if jc = >; then z .(P-\-r . P)-\-if
x ^y then z .P=
if X = y thenr .r .P + if jc^>' then r . P = ifx = y then z.P-^ifx^y then r . P =
(T2)
(Tl) (GM2)
z.P. The different axiomatizations are summarized in Table 10.
10. Sources Early developments. Computational models where mobility plays a predominant role have been present at least since the mid 1970's in the so called actor systems by Carl Hewitt and Gul Agha [18,2]. Technically the TT-calculus has its roots in process algebras like Robin Milner's CCS, originally developed in the late 1970's [22,23]. The first efforts
An introduction to the n-calculus
537
to extend CCS with the abihty to pass communication channels were by Egidio Astesiano and Elena Zucca (1984) and by Uffe Engberg and Mogens Nielsen (1986) [4,12]. These calculi turned out to be quite complex. The TT-calculus in its present form was developed in the late 1980's by Milner, David Walker and myself; it was first presented at seminars in 1987, the first comprehensive technical reports appeared in 1989 and the journal publication in 1992 [30]. It builds on the article by Engberg and Nielsen, and simplifies it by using a single syntactical class of names to represent values, variables and channels. There it is shown how to encode data types and a version of the lambda calculus; it also explores the operational semantics (late semantics without use of structural congruence), defines late and early bisimilarity and congruence and gives the axiomatization of late bisimilarity. The calculus is very similar to the one presented here, though there is no Mismatch operator and some differences in notation. For example Restriction (vx) is written (x), and i f jc = y t h e n P is written more compactly [x = y]P, a notation that many papers on the TT-calculus follow. Introductions and overviews. Today the TT-calculus and related theories make up a large and diverse field with hundreds of published papers. Perhaps the main sign of vitaUty is not the theoretical developments, but rather the numerous calculi, computational models and languages that borrow semantics or central concepts from n and are aimed at more focussed areas of application, such as PICT, Facile, Join, Ambients, Spi, POOL,...the list can be made very long [45,46,8,15,11,1,57]. A brief overview from 1998 by Uwe Nestmann and Bjom Victor indicate the main issues and is accompanied by a well maintained and exhaustive searchable on-line bibliography founded in 1995 [35]. Nestmann also currently maintains the web page Calculi for Mobile processes at h t t p : / / w w w . m o v e . t o / m o b i l i t y with finks to introductory papers, active researchers, departments, projects and other resources. In view of these efforts it seems excessive to here attempt a substantial overview or list of references. If a single introductory article for the layman should be mentioned it must be Milner's 1991 Turing Award Lecture [26]. A newcomer to the field may also appreciate my article from 1993 using graphs instead of formulas, with an emphasis on how various basic computational structures are represented through name-passing [39]. Otherwise a standard text is Milner's tutorial on the polyadic TT-calculus (1991), and also his recent book (1999) is aimed at a non-speciafist audience [27,29]. A short introduction to a simple variant of the TT-calculus in comparison to the lambda-calculus is given by Benjamin Pierce (1996) [43]. A reader seeking more detailed information concerning some specific topic is well advised to first consult Kohei Honda's annotated on-line bibliography (reachable from the URL above); it is not exhaustive and not updated as frequently as the one by Nestmann and Victor, but focuses on a few central issues and explains the impact of each paper. Below I briefly mention the main sources for the aspects of the calculus elaborated in this introduction. The chronology refers to the first written account of a piece of work known to me; the corresponding conference paper or journal article is often published a couple of years later. Variants of the calculus. The Mismatch operator first appeared in 1990 and was used by Davide Sangiorgi and me in 1993 [38,41]. The role of the Sum operator has been studied by
538
/ Parrow
Catuscia Palamidessi (1997) where she shows that it is necessary for the representation of certain distributed algorithms, and by Nestmann (1997) and Nestmann and Pierce (1996) where encodings of Sum for special cases are analyzed (the encoding in Section 3.5 comes from the latter article) [37,33,34]. The polyadic calculus with the sort system given in Section 3.3 was introduced by Milner in his 1991 tutorial. The ideas for encoding the polyadic calculus into the monadic have been known since the first papers on the TT-calculus but were not studied in detail until 1996 by Nobuko Yoshida and 1998 by Paola Quaglia and Walker [58,47]. Type inference algorithms were first presented independently by Simon Gay and by Vasco Vasconcelos and Honda in 1993 [16,55]. More elaborate systems for types and sorts have been presented by many others. Prominent issues are more refined types, for example distinguishing different uses of a channel for input and output, subtyping, polymorphism and higher-order types. A survey of such systems remains to be written although Honda's bibliography mentioned above explains many of the contributions. The slides of a good introductory tutorial by Pierce (1998) are available on-line from the author's home page (reachable from the URL for the mobility home page above) [44]. RepUcation in place of recursion was first suggested by Milner in a paper on encodings of the lambda-calculus 1990, and although the relationship between lambda and n has subsequently been treated by many authors that paper remains the principal reference [25]. The issue is to some extent connected to higher-order process calculi. Bent Thomsen, Gerard Boudol and Hemming Nielson were the first to study such calculi in detail (independently 1989, these calculi differ significantly from the jr-calculus) [53,9,36,54]. The connection with the lambda-calculus was later clarified by Sangiorgi, who also studied the encoding of the higher-order TT-calculus into the standard calculus [49]. The significance of the asynchronous calculus was discovered independently by Kohei Honda and Mario Tokoro 1991 and by Boudol 1992 [19,10]. A particularly interesting variant is the subcalculus without free output actions, which has a simpler theory and retains a surprising expressive power, as demonstrated by Sangiorgi and Michele Boreale (1996) [50,6]. Sangiorgi has recently written a tutorial on the subject [52]. Variants of the semantics. The first presentation of a structural congruence and reduction semantics is by Milner (1990) [25], inspired by the chemical abstract machines of Gerard Berry and Boudol from 1989 [5] and Milner also gave the semantics for abstractions and concretions (with a slightly different notation; Milner prefers P > c. E to P - ^ E) in his 1991 tutorial. The early semantics was first presented by Milner, Walker and myself in 1991 [31]. Symbolic transitions and their use in decision procedures for bisimulation equivalences were introduced by Matthew Hennessy and Huimin Lin in 1992 for a process algebra where values (but not channel names) are transmitted between agents [17]. Another chapter in this handbook by Anna Ingolfsdottir and Lin treats this issue in full. The semantics was subsequently adapted by Lin (1994) to the TT-calculus [20,21]. Similar ideas were developed in parallel by Boreale and Rocco de Nicola [7]. Symbolic transitions are also used by Faron Moller and Bjom Victor in an automatic verification tool (1994) [56]. Variants of bisimilarity. Early bisimilarity was mentioned in the first paper on the calculus and was studied in more depth by Milner, Walker and myself (1991) along with modal
An introduction to the n-calculus
539
logics which clarify the relationship between late and early bisimulation [31]. The results on barbed congruence are primarily due to Milner and Sangiorgi (1992) and are developed in Sangiorgi's Ph.D. thesis [32,48]. A version of barbed congruence for the asynchronous subcalculus is defined and axiomatized by Roberto Amadio, Ilaria Castellani and Sangiorgi (1996) [3]; the example at the very end of Section 7.2 is from that paper. Open bisimulation (both strong and weak) and its axiomatization (only strong) is due to Sangiorgi 1993 who also uses a symbolic semantics [51]. The weak late and early bisimulation equivalences and congruences were first formulated by Milner (1990) [24]. Algebraic theory. Strong late bisimilarity was axiomatized in the first paper on the calculus. Sangiorgi and I axiomatized strong late congruence and early bisimilarity and congruence (through the law EARLY) in 1993; the axiomatizations given here mainly follow that work [41]. Axiomatizations of the weak congruences (late and early) have been treated by Lin in a style slightly different from what has been presented here [21]. The law EARLY2 also comes from this line of work. Inferences are there of kind C > P — Q meaning "under condition C it holds that P = Q'\ which we would express as i f C t h e n P = i f C t h e n Q, making the condition part of the agents. The fact that this yields an isomorphic proof system was only recently established [40]. An alternative presentation of weak late congruence and its axiomatization is by Gianluigi Ferrari, Ugo Montanari and Paola Quaglia (1995) [14]. Unifying efforts. In this growing and diversifying field it is also appropriate to mention a few efforts at unification. The action calculi by Milner (emanating from the work on action structures 1992) separate the concerns of parametric dependency and execution control [28]. The tiles structures by Ferrari and Montanari (emanating from work with Fabio Gaducci 1995) generahze the concepts of context and context composition [13]. The Fusion Calculus by Victor and myself (begun in 1997) identifies a single binding operator which can be used to derive both input and Restriction [42]. Although each has made some progress it is clear that much work remains to be done.
Acknowledgements I thank Huimin Lin, Davide Sangiorgi, Thomas Noll, Gunnar Overgaard, and the anonymous referees for many helpful comments.
References [1] M. Abadi and A.D. Gordon, A calculus for cryptographic protocols: The Spi calculus, J. Inform. Comput. 143 (1999), 1-70. An extended abstract appeared in the Proc. Fourth ACM Conference on Computer and Communications Security, Zurich (1997). An extended version of this paper appears as Research Report 149, Digital Equipment Corporation Systems Research Center (1998), and, in preHminary form, as Technical Report 414, University of Cambridge Computer Laboratory (1997). [2] G. Agha, Actors: A Model of Concurrent Computation in Distributed Systems, MIT Press (1986).
540
/
Parrow
[3] R.M. Amadio, I. Castellani and D. Sangiorgi, On bisimulations for the asynchronous n-calculus, Theoret. Comput. Sci. 195 (2) (1998), 291-324. An extended abstract appeared in Proc. CONCUR '96, Lecture Notes in Comput. Sci. 1119, 147-162. [4] E. Astesiano and E. Zucca, Parametric channels via label expressions in CCS, Theoret. Comput. Sci. 33 (1984X45-64. [5] G. Berry and G. Boudol, The chemical abstract machine, Theoret. Comput. Sci. 96 (1992), 217-248. [6] M. Boreale, On the expressiveness of internal mobility in name-passing calculi, Theoret. Comput. Sci. 195 (2) (1998), 205-226. An extended abstract appeared in Proc. CONCUR '96, Lecture Notes in Comput. Sci. 1119,163-178. [7] M. Boreale and R. De Nicola, A symbolic semantics for the n-calculus, J. Inform. Comput. 126 (1) (1996), 34-52. Available as Report SI 94 RR 04, Universita "La Sapienza" di Roma; an extended abstract appeared in Proc. CONCUR '94, Lecture Notes in Comput. Sci. 836, 299-314. [8] R. Borgia, P. Degano, C. Priami, L. Leth and B. Thomsen, Understanding mobile agents via a non interleaving semantics for Facile, Proc. SAS '96, Lecture Notes in Comput. Sci. 1145, R. Cousot and D.A. Schmidt, eds. Springer (1996), 98-112. Extended version as Technical Report ECRC-96-4, 1996. [9] G. Boudol, Towards a lambda-calculus for concurrent and communicating systems, Proc. TAPSOFT '89, Vol. 1, Lecture Notes in Comput. Sci. 351, J. Diaz and F. Orejas, eds. Springer (1989), 149-161. [10] G. Boudol, Asynchrony and the n-calculus (note). Rapport de Recherche 1702, INRIA Sophia-Antipolis (1992). [11] L. Cardelli and A.D. Gordon, Mobile ambients, Proc. FoSSaCS '98, Lecture Notes in Comput. Sci. 1378, M. Nivat, ed.. Springer (1998), 140-155. [12] U. Engberg and M. Nielsen, A calculus of communicating systems with label-passing. Technical Report DAIMI PB-208, Comp. Sc. Department, Univ. of Aarhus, Denmark (1986). [13] G. Ferrari and U. Montanari, A tile-based coordination view of asynchronous TT-calculus, Proc. MFCS '97, Lecture Notes in Comput. Sci. 1295,1. Privara and P. Ruzicka, eds. Springer (1994). [14] G. Ferrari, U. Montanari and P. Quaglia, The weak late n-calculus semantics as obserx^ation equivalence, Proc. CONCUR '95, Lecture Notes in Comput. Sci. 962, I. Lee and S.A. Smolka, eds. Springer (1995), 57-71. [15] C. Foumet and G. Gonthier, The reflexive chemical abstract machine and the join-calculus, Proc. POPL '96, J.G. Steele, ed., ACM (1996), 372-385. [16] S.J. Gay, A sort inference algorithm for the polyadic re-calculus, Proc. POPL '93, ACM (1993). [17] M. Hennessy and H. Lin, Symbolic bisimulations, Theoret. Comput. Sci. 138 (2) (1995), 353-389. Earlier version as Technical Report 1/92, School of Cognitive and Computing Sciences, University of Sussex, UK. [18] C. Hewitt, Viewing control structures as patterns of passing messages, J. Artif. Intell. 8 (1977), 323-364. [19] K. Honda and M. Tokoro, An object calculus for asynchronous communication, Proc. ECOOP '91, Lecture Notes in Comput. Sci. 512, P America, ed.. Springer (1991), 133-147. [20] H. Lin, Symbolic bisimulation and proof systems for the n-calculus. Technical Report 7/94, School of Cognitive and Computing Sciences, University of Sussex, UK (1994). [21] H. Lin, Complete inference systems for weak bisimulation equivalences in the n-calculus, Proc. TAPSOFT '95, Lecture Notes in Comput. Sci. 915, P.D. Mosses, M. Nielsen and M.I. Schwarzbach, eds. Springer (1995), 187-201. Available as Technical Report ISCAS-LCS-94-11, Institute of Software, Chinese Academy of Sciences (1994). [22] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer (1980). [23] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [24] R. Milner, Weak bisimilarity: Congruences arui equivalences, TT-calculus note RMIO, Manuscript (1990). [25] R. Milner, Functions as processes, J. Math. Strucmres in Comput. Sci. 2 (2) (1992), 119-141. Previous version as Rapport de Recherche 1154, INRIA Sophia-Antipolis, 1990 and in Proc. ICALP '91, Lecture Notes in Comput. Sci. 443. [26] R. Milner, Elements of interaction, Comm. ACM 36 (1) (1993), 78-89. Turing Award Lecture. [27] R. Milner, The Polyadic n-Calculus: A Tutorial, Logic and Algebra of Specification, Vol. 94 Series F, NATO ASI, F.L. Bauer, W. Brauer and H. Schwichtenberg, eds. Springer (1993). Available as Technical Report ECS-LFCS-91-180, University of Edinburgh (1991). [28] R. Milner, Calculi for interaction. Acta Inform. 3 (8) (1996), 101-131. [29] R. Milner, Communicating and Mobile Systems: the n-Calculus, Cambridge University Press (1999).
An introduction to the K-calculus
541
[30] R. Milner, J. Parrow and D. Walker, A calculus of mobile processes, Part I/II, J. Inform. Comput. 100 (1992), 1-77. [31] R. Milner, J. Parrow and D. Walker, Modal logics for mobile processes, Theoret. Comput. Sci. 114 (1993), 149-171. [32] R. Milner and D. Sangiorgi, Barbed bisimulation, Proc. ICALP '92, Lecture Notes in Comput. Sci. 623, W Kuich, ed.. Springer (1992), 685-695. [33] U. Nestmann, What is a 'good' encoding of guarded choice? Proc. EXPRESS '97, ENTCS 7, C. Palamidessi and J. Parrow, eds, Elsevier Science Publishers (1997). Full version as report BRICS-RS-97-45, Universities of Aalborg and Arhus, Denmark, 1997. Revised version accepted for J. Inform. Comput. (1998). [34] U. Nestmann and B.C. Pierce, Decoding choice encodings, Proc. CONCUR '96, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 179-194. Revised full version as report ERCIM-10/97-R051, European Research Consortium for Informatics and Mathematics (1997). [35] U. Nestmann and B. Victor, Calculi for mobile processes: Bibliography and web pages. Bulletin of the EATCS64(1998), 139-144. [36] F. Nielson, The typed X-calculus with first-class processes, Proc. PARLE'89, Lecture Notes in Comput. Sci. 366, Springer-Verlag (1989), 357-373. [37] C. Palamidessi, Comparing the expressive power of the synchronous and the asynchronous n-calculus, Proc. POPL '97, ACM (1997), 256-265. [38] J. Parrow, Mismatching and early equivalence, :7r-calculus note JP13, Manuscript (1990). [39] J. Parrow, Interaction diagrams, Nordic J. Computing 2 (1995), 407-443. A previous version appeared in Proc. A Decade in Concurrency, Lecmre Notes in Comput. Sci. 803 (1993), 477-508. [40] J. Parrow, On the relationship between two proof systems for the pi-calculus, :7r-calculus note JP15, Manuscript (1999). Available from the author. [41] J. Parrow and D. Sangiorgi, Algebraic theories for name-passing calculi, J. Inform. Comput. 120 (2) (1995), 174-197. A previous version appeared in Proc. of A Decade in Concurrency, Lecture Notes in Comput. Sci. 803 (1993), 477-508. [42] J. Parrow and B. Victor, The fusion calculus: Expressiveness and symmetry in mobile processes, Proc. Lies '98, IEEE, Computer Society Press (1998), 176-185. [43] B.C. Pierce, Foundational calculi for programming languages. Handbook of Computer Science and Engineering, A.B. Tucker, ed., CRC Press (1996), Chapter 139. [44] B.C. Pierce, Type systems for concurrent calculi. Invited tutorial at CONCUR, Nice, France (1998). [45] B.C. Pierce and D.N. Turner, Concurrent objects in a process calculus, Proc. TPPP '94, Lecture Notes in Comput. Sci. 907, T. Ito and A. Yonezawa, eds. Springer (1995), 187-215. [46] B.C. Pierce and D.N. Turner, Pict: A programming language based on the pi-calculus. Proof, Language and Interaction: Essays in Honour of Robin Milner, G. Plotkin, C. Stirling and M. Tofte, eds (1999). To appear. [47] P. Quaglia and D. Walker, On encoding pn in mn, 18th Conference on Foundations of Software Technology and Theoretical Computer Science (Chennai, India, December 17-19, 1998), Lecture Notes in Comput. Sci., V, Arvind and R. Ramanujam, eds (1998). [48] D. Sangiorgi, Expressing Mobility in Process Algebras: First-Order and Higher-Order Paradigms, Ph.D. thesis, LFCS, University of Edinburgh (1993). CST-99-93 (also published as ECS-LFCS-93-266). [49] D. Sangiorgi, Bisimulation in higher-order process calculi, J. Inform. Comput. 131 (1996), 141-178. Available as Rapport de Recherche RR-2508, INRIA Sophia-Antipolis, 1995. An early version appeared in Proc. PROCOMET'94, IFIP, North-Holland, 207-224. [50] D. Sangiorgi, n-calculus, internal mobility and agent-passing calculi, Theoret. Comput. Sci. 167 (1,2) (1996), 235-274. Also as Rapport de Recherche RR-2539, INRIA Sophia-AntipoUs, 1995. Extracts of parts of the material contained in this paper can be found in Proc. TAPSOFT '95 and ICALP '95. [51] D. Sangiorgi, A theory of bisimulation for the n-calculus. Acta Inform. 33 (1996), 69-97. Earlier version published as Report ECS-LFCS-93-270, University of Edinburgh. An extended abstract appeared in the Proc. CONCUR '93, Lecture Notes in Comput. Sci. 715. [52] D. Sangiorgi, Asynchronous process calculi: The first-order and higher-order paradigms, Theoret. Comput. Sci. (1999), to appear. [53] B. Thomsen, A calculus of higher order communicating systems, Proc. POPL '89, ACM (1989), 143-154. [54] B. Thomsen, Plain CHOCS. A second generation calculus for higher order processes. Acta Inform. 30 (1) (1993), 1-59.
542
J. Parrow
[55] V.T. Vasconcelos and K. Honda, Principal typing schemes in a polyadic n-calculus, Proc. CONCUR '93, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer (1993), 524-538. [56] B. Victor and F. MoUer, The Mobility Workbench - a tool for the n-calculus, Proc. CAV '94, Lecture Notes in Comput. Sci. 818, D. Dill, ed.. Springer (1994), 428-440. [57] D. Walker, Objects in the n-calculus, J. Inform. Comput. 116 (2) (1995), 253-271. [58] N. Yoshida, Graph types for monadic mobile processes, Proc. FSTTCS '96, Lecture Notes in Comput. Sci. 1180, V. Chandru and V. Vinay, eds. Springer (1996), 371-386. Full version as Technical Report ECSLFCS-96-350, University of Edinburgh.
Subject index T-laws, 535 actions, 502 agent abstractions, 511 agent concretions, 511 agent identifier, 483 agent variable, 496 agents, 483 agrees with, 532 alpha-conversion, 487 asynchronous calculus, 498 automata, 493
fixpoint, 496 free names, 485 Generalized match, 530 GMl-6,531 GM6*,531
ground bisimulation, 523 guarded, 485 guarded Sum, 493 head normal form, 529, 532 higher-order calculus, 499
barbed bisimulation, 520 barbed congruence, 521 bisimulation, 513 bisimulation up to, 516 Boolean values, 492 bound names, 485 bound output, 502
Identifier, 484 Input Prefix, 483
CLOSE, 505 COM, 503
Mismatch, 484
complete conjunction, 532 CONOR, 531 CONGRl-2, 528
MM 1-2,528 monoid laws, 487
late bisimulation, 518 M1-2,528 Match, 484 MATCH, 503 MISMATCH, 503
names, 483 Definition, 484 depth, 529 distinction, 523 dynamic bisimulation, 523 E-COM, 509 E-INPUT,509 EARLY, 533
early bisimulation, 518 early congruence, 520, 534 early semantics, 509 EARLY2, 534 expansion law, 530, 533 extended agents, 511
object, 485 object sort, 495 observable, 520 OPEN,503 open bisimilation, 534 open bisimulation, 522, 524 operational semantics, 503 Output Prefix, 483 PAR, 503 Parallel Composition, 484 polyadic calculus, 494 PREFIX, 503
An introduction to the n -calculus Rl-3,528 reductions, 510 Replication, 496 RES, 503 Restriction, 484 S,528 STR,528 scope extension, 487 Silent Prefix, 483 sort, 495 sort context, 495 strong bisimulation, 514
strong congruence, 516 STRUCT, 503 Structural congruence, 486 subject, 485 substitution, 485 Sum, 484 SUM, 503 symbolic semantics, 506 unfolding, 487 weak bisimulation, 526 weak congruence, 527, 535
543
This Page Intentionally Left Blank
CHAPTER 9
Verification on Infinite Structures Olaf Burkart^ Didier Caucal^, Faron MoUer^, Bemhard Steffen"^ ' Lehrstuhl Informatik V, Universitdt Dortmund, Baroper Strafie 301, D-442 21 Dortmund, Germany E-mail :burkart@cs. uni-dortmund. de ^ IRISA, Campus de Beaulieu, F-350 42 Rennes, France E-mail: [email protected] ^ Department of Computer Science, University of Wales Swansea, Singleton Park, Swansea, SA2 8PP, United Kingdom E-mail: F. [email protected]. uk ^Lehrstuhl Informatik V, Universitdt Dortmund, D-442 21 Dortmund, Germany E-mail: stejfen @cs. uni-dortmund.de
Contents Introduction Equivalence checking Model checking 1. A taxonomy of infinite state processes 1.1. Rewrite transition systems 1.2. Languages and bisimilarity 1.3. Expressivity results 1.4. Further classes of processes 2. The equivalence checking problem 2.1. Decidability results for BPA and BPP 2.2. Polynomial time algorithms for BPA and BPP 2.3. Computing a finite bisimulation base for BPA 2.4. Undecidability results for MSA 2.5. Summary of results 3. The model checking problem 3.1. Temporal logics 3.2. Algorithms for branching-time logics 3.3. Algorithms for linear-time logics 3.4. Summary Acknowledgements References Subject index
547 548 549 550 550 556 561 564 565 565 572 578 586 589 591 592 602 611 615 617 617 623
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
545
546
O. Burkart et ai
Abstract In this chapter, we present a hierarchy of infinite-state systems based on the primitive operations of sequential and parallel composition; the hierarchy includes a variety of commonlystudied classes of systems such as context-free and pushdown automata, and Petri net processes. We then examine the equivalence and regularity checking problems for these classes, with special emphasis on bisimulation equivalence, stressing the structural techniques which have been devised for solving these problems. Finally, we explore the model checking problem over these classes with respect to various linear- and branching-time temporal logics.
Verification on infinite structures
547
Introduction The study of automated (sequential) program verification has an inherent theoretical barrier in the guise of the halting problem and formal undecidability. The simplest programs which manipulate the simplest infinite data types such as integer variables immediately fall foul of these theoretical limitations. During execution, such a program may evolve into any of an infinitude of states, and knowing if the execution of the program will lead to any particular state, such as the halting state, will in general be impossible to determine. However, this has not prevented a very successful attack on the problem of proving program correctness, and there are now elegant and accepted techniques for the semantic analysis of software. The history behind the modelling of concurrent systems, in particular hardware systems, has followed a different course. Here, systems have been modelled strictly as finite-state systems, and formal analysis tools have been developed for completely and explicitly exploring the reachable states of any given system, for instance with the goal of detecting whether or not a halting, i.e., deadlocked, state is accessible. This abstraction has been warranted up to a point. Real hardware components are indeed finite entities, and protocols typically behave in a regular fashion irrespective of the diversity of messages which they may be designed to deliver. In specifying concurrent systems, it is not typical to explicitly present the state spaces of the various components, for example by listing out the states and transition function, but rather to specify them using some higher-level modelling language. Such formalisms for describing concurrent systems are not usually so restrictive in their expressive power. For example, the typical process algebra can encode integer registers, and with them compute arbitrary computable functions; and Petri nets constitute a graphical language for finitely presenting typically infinite-state systems. However, tools which employ such formalisms generally rely on techniques for first assuring that the state space of the system being specified is semantically, if not syntactically, finite. For example, a given process algebra tool might syntactically check that no static operators such as parallel composition appear within the scope of a recursive definition; and a given Petri net tool might check that a net is safe, that is, that no place may acquire more than one token. Having verified the finiteness of the system at hand, the search algorithm can, at least in principle, proceed. The problem with the blind search approach, which has thwarted attempts to provide practical verification tools, is of course that of state space explosion. The number of reachable states of a system will typically be on the order of exponential in the number of components which make up the system. Hence a great deal of research effort has been expended on taming this state space, typically by developing intelligent search strategies. Various promising techniques have been developed which make for the automated analysis of extremely large state spaces feasible; one popular approach to this problem is through the use of BDD (binary decision diagram) encodings of automata [20]. However, such approaches are inherently bound to the analysis of finite-state systems. Recently, interest in addressing the problem of analyzing infinite-state systems has blossomed within the concurrency theory community. The practical motivation for this has been both to provide for the study of parallel program verification, where infinite data
548
O. Burkart et al
types are manipulated, as well as to allow for more faithful representations of concurrent systems. For example, real-time and probabilistic models have come into vogue during the last decade to reflect for instance the temporal and nondeterministic behaviour of asynchronous hardware components responding to continuously-changing analogue signals; and models have been developed which allow for the dynamic reconfiguration of a system's structure. Such enhancements to the expressive power of a modelling language immediately give rise to infinite-state models, and new paradigms not based on state space search need to be introduced to successfully analyze systems expressed in such formalisms. In this survey, we explore the two major streams in system verification: equivalence checking, which aims at establishing some semantic equivalence between two systems, one of which is typically considered to represent the implementation of the specification given by the other; and model checking, which aims at determining whether or not a given system satisfies some property which is typically presented in some modal or temporal logic. In the survey we concentrate exclusively on discrete systems, and neglect infinite-state structures related to, e.g., timed and hybrid systems. The variety of process classes which we consider is catalogued in Section 1, where we detail the relative expressive powers of these classes. The two approaches to system verification are summarized here, where we also sketch the contents of the two relevant sections of the survey.
Equivalence checking Equivalence checking, that is, determining when two (infinite-state) systems are in some semantic sense equal, is clearly a particularly relevant problem in system verification. Indeed, such questions have a long tradition in the field of (theoretical) computer science. Since the proof by Moore [121] in 1956 of the decidability of language equivalence for finite-state automata, formal language theorists have been studying the equivalence problem over classes of automata which express languages which are more expressive than the class of regular languages generated by finite-state automata. Bar-Hillel, Pedes and Shamir [6] were the first to demonstrate, in 1961, that the class of languages defined by context-free grammars was too wide to admit a decidable theory for language equivalence. Shortly after this, Korenjak and Hopcroft [95] demonstrated that language equivalence between simple (deterministic) grammars is decidable. Only recently has the long-open problem of language equivalence between deterministic push-down automata (DPDA) been settled (positively) by Senizergues [132,133]. Decidability questions for Petri nets were addressed already two decades ago, with the thesis of Hack [63]. However, it has only been in the much more recent past that a more concerted effort has been focussed on such questions, with the interest driven in part by analogies drawn between classes of concurrent system models and classes of generators for families of formal languages. In [114] Milner exploits the relationship between regular (finite-state) automata as discussed by Salomaa in [130] and regular behaviours to present the decidabihty and a complete axiomatization of bisimulation equivalence for finite-state behaviours, whilst in his textbook [115] he demonstrates that the halting problem for Turing machines can be encoded as a bisimulation question for the full CCS calculus thus
Verification on infinite structures
549
demonstrating undecidability in general. This final feat is carried out elegantly using finite representations of counters in the thesis of Taubner [141]. These results are as expected; however, real interest was generated with the discovery by Baeten, Bergstra and Klop [4,5] that bisimulation equivalence is decidable for a family of infinite-state automata generated by a general class of context-free grammars. In Section 2, we present an overview of various results obtained regarding decidability and complexity, with particular emphasis on bisimulation equivalence, focussing on the various techniques exploited in each case. Our interest in bisimulation equivalence stems predominantly from its mathematical tractability. Apart from being the fundamental notion of equivalence for several process algebraic formalisms, bisimulation equivalence possesses several pleasing mathematical properties, not least of which being - as we shall discover - that it is decidable over process classes for which all other common equivalences remain undecidable, in particular over the class of processes defined by context-free grammars. Furthermore in a particularly interesting class of processes - namely the normed deterministic processes - all of the standard equivalences coincide, so it is sensible to concentrate on the most mathematically tractable equivalence when analyzing properties of another equivalence. In particular, by studying bisimulation equivalence we can rediscover standard theorems about the decidability of language equivalence, as well as provide more efficient algorithms for these decidability results than have previously been presented. We expect that the structural techniques which can be exploited in the study of bisimulation equivalence will prove to be useful in tackling various other language theoretic problems. Indeed, while Senizergues' proof of the decidability of DPDA is extremely long and complex, developed over 70 pages of a 166 page journal submission, Stirling [138] has since presented a far simpler proof of this result using variations on some of the structural analysis techniques explored in Section 2. Apart from the basic equivalence checking problem, we also survey related questions regarding regularity checking, that is, determining if a given system is semantically finitestate. Within a typical application domain such as the modelling of protocols, we might analyze infinite-state systems which we intend to semantically represent finite-state behaviours: our specification of the system is finite-state, but the state space of the implementation is (syntactically) infinite. A positive answer for the regularity checking problem would allow the equivalence checking algorithm to exploit well-developed techniques for analyzing finite-state systems (assuming that the equivalent finite-state system could be extracted from from this answer).
Model checking Apart from equivalence checking, model checking provides perhaps the most promising approach to the formal verification of distributed, reactive systems. In this approach, one uses formulae of a temporal logic to specify the desired properties of a system, and a (semi-)decision procedure then checks whether the given system is a model of the formula at hand. In particular, in the case of finite-state systems model checking is, at least theoretically, always applicable, since an exhaustive traversal through the reachable state space of the system under consideration can effectively provide enough information to
550
O. Burkart et al.
solve the verification problem. In fact, using BDDs, finite-state model checking has had some prominent industrial success stories, despite the omni-present state space explosion threat, making it an indispensable tool for hardware design. The practical success of model checking can be witnessed by the immediate popularity of the newly-published textbook by Clarke, Grumberg and Peled [42]. Again, as algorithms for finite-state model checking typically involve the exhaustive traversal of the state space, they are inherently incapable of verifying infinite-state systems, and must be replaced by algorithms based on different techniques. The new techniques which have been developed for model checking have mainly been influenced by formal language theory, where there exists a long tradition of reasoning about finitely-presented infinite objects, in this case formal languages described by automata or grammars. Consequently, notions from formal language theory form a recurring theme in the verification of infinite-state systems, e.g., as a means for the description of such systems, or in characterizing the expressive power of certain temporal logics. One general problem is, however, the trade-off between expressiveness and decidability. Expressive models of computation, in conjunction with powerful specification formalisms, inevitably lead to an undecidable model checking problem. However, taking weaker models and/or formalisms in order to recover decidability often greatly diminishes its practical value. The goal of this survey is to provide a systematic presentation of the results obtained so far concerning decidability and complexity issues in model checking infinitestate systems, thereby identifying feasible combinations of process classes and temporal logics. In Section 3.1 we provide a brief introduction to the temporal logics we consider, together with their branching time and linear time classifications. We then proceed by presenting decidability and complexity results about model checking for various classes of infinite-state systems, first for branching time logics in Section 3.2, and then for Unear time logics in Section 3.3. Due to the wealth of techniques which have been devised for use in conjunction with the wide variety of logics which one may consider, we only sketch the main ideas of the relevant results in this survey. This gives a conceptual and easy to read overview, which is complemented by tight links to the original literature, thus enabling the interested readers to access all the technical details.
1. A taxonomy of infinite state processes 1.1. Rewrite transition systems Concurrent systems are modelled semantically in a variety of ways. They may be defined for example by the infinite traces or executions which they may perform, or by the entirety of the properties which they satisfy in some particular process logic, or as a particular algebraic model of some equational specification. In any case, a fundamental unifying view is to interpret such systems as edge-labelled directed graphs, whose nodes represent the states in which a system may exist, and whose transitions represent the possible behaviour of the system originating in the state represented by the node from which the transition emanates; the label on a transition represents an event corresponding to the execution of
Verification on infinite structures
551
that transition, which will typically represent an interaction with the environment. The starting point for our study will thus be such graphs, which will for us represent processes. 1. A labelled transition system is a tuple ( 5 , 1 , ->, oco, F) where 5 is a set of states. I is a finite set of labels. - > c 5 x I x « S i s a transition relation, written a - ^ (3 for (a, a, (3) € ^•. oco G *S is a distinguished start state. F c 5 is a finite set of final states which are terminal, meaning that for each a € F there is no a € I and |3 € 5 such that a - ^ (3.
DEHNITION
• • • • •
This notion of a labelled transition system differs from the standard definition of a finitestate automaton (as for example given in [74]) in that the set of states need not be finite, and final states must not have any outgoing transitions. This last restriction is mild and justified in that a final state refers to the successful termination of a concurrent system. This contrasts with unsuccessful termination (i.e., deadlock) which is represented by all non-final terminal states. We could remove this restriction, but only at the expense of Theorem 4 below which characterizes a wide class of labelled transition systems as push-down automata which accept on empty stack. (An alternative approach could be taken to recover Theorem 4 based on PDA which accept by final state, but we do not pursue this alternative here.) We follow the example set by Caucal [32] and consider the families of labelled transition systems defined by various rewrite systems. Such an approach provides us with a clear link between well-studied classes of formal languages and transition system generators, a link which is of particular interest when it comes to exploiting process-theoretic techniques in solving problems in classical formal language theory. DEHNITION 2. A sequential labelled rewrite transition system is a tuple (V, I , P, ao, F) where • V is a finite set of variables; the elements of V* are referred to as states. • L is a finite set of labels. • P c V* X I X V* is a finite set of rewrite rules, written a - ^ (3 for (a, a, |3) € P, which are extended by the prefix rewriting rule: if a - ^ (3 then a y - ^ (3y. • (Xo e V* is a distinguished start state. • F C V* is a finite set of final states which are terminal. A parallel labelled rewrite transition system is defined precisely as above, except that the elements of V* are read modulo commutativity of concatenation, which is thus interpreted as parallel, rather than sequential, composition. We can thus consider states as monomials X^^ X^ '" Xn^ over the variables V = {Xi, X i , . . . , Xn}. With this in mind, we shall be able to exploit the following result due to Dickson [48] which is easily proved by induction onn.
LEMMA 3 (Dickson's lemma). Given an infinite sequence of vectors of natural numbers x i , X2, X3,... G N^ we can always find indices i and j with i < j such that xt ^ Xj {where ^ is considered pointwise).
552
O. Burkart et al
The state X^^ x\^ • -Xn^ can be viewed as the vector (ki, k z , . . . , kn) G N^. Hence, Dickson's lemma says that, given any infinite sequence a i , (X2, (X3,... of such states, we can always find two of these, at and oc] with i < j , such that the number of occurrences of each variable X in a] is at least as great as in cxi. We shall freely extend the transition relation -> homomorphically to finite sequences of actions w 6 I* so as to write <x —^ a and a - ^ (3 whenever a - ^ • - ^ |3. Also, we refer to the set of states a into which the initial state can be rewritten, that is, such that (Xo - ^ Oi for some w € I*, as the reachable states. Although we do not insist that all states be reachable, we shall assume that all variables in V are accessible from the initial state, that is, that for all X € V there is some w e I* and a, (3 G V* such that (Xo —> aXp. This definition is slightly more general than that given in [32], which does not take into account final states nor the possibility of parallel rewriting as an alternative to sequential rewriting. By doing this, we expand the study of the classes of transition systems which are defined, and extend some of the results given by Caucal, notably in the characterization of arbitrary sequential rewrite systems as push-down automata. The families of transition systems which can be defined by restricted rewrite systems can be classified using a form of Chomsky hierarchy. This hierarchy provides an elegant classification of several important classes of transition systems which have been defined and studied independent of their appearance as particular rewrite systems. This classification is presented in Figure 1. (Type 1 rewrite systems, corresponding to context-sensitive grammars, do not feature in this hierarchy since the rewrite rules by definition are only apphed to the prefix of a composition.) In the remainder of this section, we explain the classes of transition systems which are represented in this table, working upwards starting with the most restrictive class. FSA represents the class of finite-state automata. Clearly if the rules are restricted to be of the form A - ^ B or A - ^ £ with A, B G V, then the reachable states of both the sequential and parallel transition systems will be elements of the finite set {ex G V*: |cx| ^ |(Xo|}. EXAMPLE 0. In the following we present two type 3 (regular) rewrite systems along with the FSA transition systems which the initial states X and A, respectively, denote.
X-^Y
A-^B A^C
Y^e C^e
These two automata both recognize the same (regular) language {ab, ac}. However, they are substantially different automata.
553
Verification on infinite structures Restriction on the rules
Sequential composition
Parallel composition
a - ^ 13 of P
Restriction on F
Type 0
none
none
PDA
PN
Typeli
oce QFand P e Q r * where v = Qi±ir
F= Q
PDA
MSA
Type 2
aeV
F = {£}
BPA
BPP
Type 3
aeVand 136VU{£}
F = {e}
FSA
FSA
Fig. 1. A hierarchy of transition systems.
BPA represents the class of Basic Process Algebra processes of Bergstra and Klop [9], which are the transition systems associated with Greibach normal form (GNF) context-free grammars in which only left-most derivations are permitted. 1. In the following we present a type 2 (GNF context-free grammar) rewrite system along with the BPA transition system which the initial state X denotes. EXAMPLE
X )
^
^XB)
^-(XBB)
^ —
•
X ^ £ B-^e BB H-
This automaton recognizes the context-free language {a^cb^:
n^O].
BPP represents the class of Basic Parallel Processes introduced by Christensen [35] as a parallel analogy to BPA, and are defined by the transition systems associated with GNF context-free grammars in which arbitrary grammar derivations are permitted. EXAMPLE 2. The type 2 rewrite system from Example 1 gives rise to the following BPP transition system with initial state X.
554
O. Burkart et al
This automaton recognizes the language consisting of all strings of the form (a -h b)*cb* which contain an equal number of a's and b's in which no prefix contains more b's than a's. We shall assume that for all type 2 rewrite systems, e is the only terminal state. Combined with our previous assumption that each variable is reachable from the initial state, this implies that each variables is on the left hand side of at least one rule. PDA represents the class of push-down automata which accept on empty stack. To present such PDA as a restricted form of rewrite system, we first assume that the variable set V is partitioned into disjoint sets Q (finite control states) and V (stack symbols). The rewrite rules are then of the form pA - ^ q(3 with p, q G Q, A € F and P € F*, which represents the usual PDA transition which says that while in control state p with the symbol A at the top of the stack, you may read the input symbol a, move into control state q, and replace the stack element A with the sequence (3. Finally, the set of final states is given by Q, which represent the PDA configurations in which the stack is empty. Caucal [32] demonstrates that, disregarding final states, any unrestricted (type 0) sequential rewrite system can be presented as a PDA, in the sense that the transition systems are isomorphic up to the labelling of states. The stronger result, in which final states are taken into consideration, actually holds as well. The idea behind the encoding is as follows. Given an arbitrary rewrite system (V, I , P, ao, F), take n satisfying n ^ max{|a|: a - ^ |3 € P};
and
n > max{|a|: a - ^ |3 with (3 G F } . Then let Q = [Voc- cxG V* and |a| < n } ;
and
F = {Zcx: a G V * a n d | a | = n } u { A } . Every final transition state ex G F is represented by the PDA state Pa, that is, by the PDA being in control state pcx with an empty stack denoting acceptance; and every non-final transition system state y a i CX2 • • • aic ^ F with |y| < n and |(Xi| = n for 1 ^ i < k, is represented in the PDA by PyZai Zcx2 * * • ^ak^* ^hat is, by the PDA being in control state Py
Verification on infinite structures
555
with with the sequence Zai Zaz'' • Zocj, A on its stack. Then every rewrite rule introduces appropriate PDA rules which mimic it and respect this representation. Thus we arrive at the following result. THEOREM 4. Every sequential labelled rewrite transition system can be represented {up
to the labelling of states) by a PDA transition system. EXAMPLE 3. The BPP transition system of Example 2 is given by the following sequential rewrite system.
X-^XB
X-^e
B-^£
XB-^X
By the above construction, this gives rise to the following PDA with initial state px A. (We omit rules corresponding to the unreachable states.)
X-^XB:
PXA-^P^ZXBA
PEZXE-^PX^BB
P X Z B B - ^ Pe-^xeZeB
X ^ £ :
PxA-^Pe
PeZxB - ^ P B
PXZBB
-^Pe^BB
B ^ e :
PBA-^Pe
P£ZBB — ^ P B
PB^BB
^PeZ^BB
XB-^X:
PeZxB
•7
b
> Px
PXZBB
^PeZxB
This is expressed more simply by the following PDA with initial state p A. pA-^pBA
pB-^pBB
qA-^q
pA-^q
pB-^p
qB-^q
p B ^ q Note that BPA coincides with the class of single-state PDA. However, we shall see in Section 1.3 that any PDA presentation of the transition system of Example 2 must have at least 2 control states: this transition system is not represented by any BPA. MSA represents the class of multiset automata, which can be viewed as "parallel" or "random-access" push-down automata; they are defined as above except that they have random access capability to the stack. EXAMPLE 4. The BPA transition system of Example 1 is isomorphic to that given by the following MSA with initial state pX.
pX-^pBX
pX-^q
qB-^q
Note that when the stack alphabet has only one element, PDA and MSA trivially coincide. Also note that BPP coincides with the class of single-state MSA. We shall see in Section 1.3
556
O. Burkart et al
that any MSA presentation of the transition system of Example 1 must have at least 2 control states: this transition system is not represented by any BPR PN represents the class of (finite, labelled, weighted place/transition) Petri nets, as is evident by the following interpretation of unrestricted parallel rewrite systems. The variable set V represents the set of places of the Petri net, and each rewrite rule a - ^ {3 represents a Petri net transition labelled a with the input and output places represented by a and |3 respectively, with the weights on the input and output arcs given by the relevant multiplicities in a and (3. Note that a BPP is a communication-free Petri net, one in which each transition has a unique input place. 5. The following unrestricted parallel rewrite system with initial state X and final state Y EXAMPLE
XA
XAB
YA
XB
X-^Y
YB-
Y
describes the Petri net which in its usual graphical representation net would be rendered as follows. (The weights on all of the arcs is 1.)
The automaton represented by this Petri net recognizes the language consisting of all strings from (a + b + c)*d(a + b)* in which the number of c's in any prefix is bounded above by both the number of a's and the number of b's; and in which the number of a's (respectively b's) before the occurrence of the d minus the number of c's equals the number of a's (respectively b's) after the occurrence of the d. Although in the sequential case, PDA constitutes a normal form for unrestricted rewrite transition systems, we shall see in Section 1.3 that this result fails to hold in the parallel case. We shall in fact demonstrate that the automaton associated with the above PN is not the automaton of any MSA. 1.2. Languages and bisimilarity Given a labelled transition system T = («S, I , —>, CXQ, F), we can define its language L(T) to be the language generated by its initial state Oio. where the language generated by a state
Verification on infinite structures
557
is defined in the usual fashion as the sequences of actions which label rewrite transitions leading from the given state to a final state. DEnNiTiON 5. L(a) = {w e I*: oc - ^ (3 for some P € F}, and L(T) = L(ao). a and P are language equivalent, written a ^ L P . iff they generate the same language: Ucx) = L(P). With respect to the languages generated by rewrite systems, if a rewrite system is in the process of generating a word, then the partial word should be extendible to a complete word. That is, from any reachable state of the transition system, a final state should be reachable. If the transition system satisfies this property, it is said to be normed\ otherwise it is unnormed. DEFINITION 6. We define the norm of any state a of a labelled transition system, written n ( a ) , to be the length of a shortest rewrite transition sequence which takes a to a final state, that is, the length of a shortest word in L(a). By convention, we define n ( a ) = oo if there is no sequence of transitions from a to a final state, that is, L(a) = 0. The transition system is normed iff every reachable state a has a finite norm; otherwise it is unnormed.
Note that, due to the assumption following Definition 2 on the accessibility of all the variables, if a type 2 rewrite transition system is normed, then all of its variables must have finite norm. The following then is a basic fact about the norms of type 2 (BPA and BPP) states. LEMMA 7. Given any state aP of a type 2 rewrite transition systems (BPA or BPP), n(aP)=n(a)+n(P). PROOF. For the sequential case, L(aP) = L(a) • L(P) = {uv: u e L(a) and v € L(P)}. For the parallel case, L(aP) = L(a) || L(P) = {uiviU2V2 • "UnVn- uiU2 • • -Un € L(a) andviV2 •Vn € L(P)}. The result follows easily from this. D
A further common property of transition systems is that of determinacy. 8. T is deterministic iff for every reachable state a and every label a there is at most one state P such that a - ^ p. DERNITION
For example, the two finite state automata presented in Example 0 are both normed transition systems, while only the first is deterministic. All other examples which we have presented have been both normed and deterministic. In the realm of concurrency theory, language equivalence is generally taken to be too coarse an equivalence. For example, it equates the two transition systems of Example 0 which generate the same language {ab, ac} yet demonstrate different deadlocking capabilities due to the nondeterministic behaviour exhibited by the second transition system. Many finer equivalences have been proposed, with bisimulation equivalence being perhaps the finest behavioural equivalence studied. (Note that we do not consider here any
558
O. Burkart et al
so-called 'true concurrency' equivalences such as those based on partial orders.) Bisimulation equivalence was defined by Park [125] and used to great effect by Milner [113,115]. Its definition, in the presence of final states, is as follows. DEFINITION 9. A binary relation IZ on states of a transition system is a bisimulation iff whenever (a, (3) G 7^ we have that • if a - ^ a' then (3 - ^ (3' for some ^' with (a', (30 € 7^; • if (3 - ^ |3' then a - ^ a' for some (x! with (oc', (3') € U; • aePiffpGF. a and (3 are bisimulation equivalent or bisimilar, written a ^ (3, iff (a, (3) G 7^ for some bisimulation K. That is, ^= {J{11\ 7^ is a bisimulation relation}.
LEMMA 10. ^ is the largest bisimulation relation. PROOF.
An arbitrary union of bisimulations is itself a bisimulation.
D
LEMMA 11. -^ is an equivalence relation.
Reflexivity holds since the identity relation is a bisimulation; symmetry holds since the inverse of a bisimulation is a bisimulation; and transitivity holds since the composition of two bisimulations is a bisimulation. D PROOF.
Bisimulation equivalence has an elegant characterization in terms of certain two-player games [90,136]. Starting with a pair of states (a, (3), the two players alternate moves according to the following rules. 1. If exactly one of the pair of states is a final state, then player I is deemed to be the winner. Otherwise, player I chooses one of the states and makes some transition from that state (either a - ^ od or (3 - ^ (3'). If this proves impossible, due to both states being terminal, then player II is deemed to be the winner. 2. Player II must respond to the move made by player I by making an identicallylabelled transition from the other state (either (3 - ^ (3' or a - ^ a'). If this proves impossible, then player I is deemed to be the winner. 3. The play then repeats itself from the new pair (a', (3') • If the game continues forever, then player II is deemed to be the winner. The following result is then immediately evident. FACT 12. a ^ (3 iff Player II has a winning strategy in the bisimulation game starting with the pair (oc, (3). Conversely, a 7^ (3 ijf Player I has a winning strategy in the bisimulation game starting with the pair (ex, (3). PROOF. Any bisimulation relation defines a winning strategy for player II for the bisimulation game starting from a pair in the relation: the second player merely has to respond to moves by the first in such a way that the resulting pair is contained in the bisimulation.
Verification on infinite structures
559
Conversely, a winning strategy for player II for the bisimulation game starting from a particular pair of states defines a bisimulation relation containing that pair, namely the collection of all pairs which appear after every exchange of moves during any and all games in which player II uses this strategy. D 6. The states X and A from Example 0 are language equivalent, as they define the same language {ab, ac}. However, they are not bisimulation equivalent: there is no bisimulation relation which relates them. To see this, we can demonstrate an obvious winning strategy for player I in the bisimulation game starting with the pair of states (X, A). After the first exchange of moves, the new pair of states must be either (Y, B) or (Y, C>; in the former case, player I may make the transition Y - ^ e to which player I cannot respond from B, and in the latter case player I may make the transition Y —> t to which player I cannot respond from C. EXAMPLE
A transition system is finite-branching if there are only a finite number of transitions from any given reachable state; and it is image-finite if there are only a finite number of transitions with a given label from any given reachable state. For image-finite transition systems, we have the following stratified characterization of bisimulation equivalence [115]. DEFINITION 13. The stratified bisimulation relations ^ri are defined as follows. • a ~0 P for all states. • a ' - k + i Piff - if a - ^ a' then 3 - ^ (3' for some (3' with (x! ^v, P'; - if P - ^ P' then a - ^ (x! for some oi' with a' -^k P'; - a G F iff p G F. In terms of the game characterization of bisimilarity, a ~ n P iff Player I cannot force a win within the first n exchanges of moves. LEMMA
14. If a and P are image-finite, then oc^^iffoc^n
^ for all
n^O.
If a ^ P then an induction proof gives that a ^ n P for each n^O. Conversely, {(a, P): a and P are image-finite and a --n P for all n ^ 0} is a bisimulation. D PROOF.
It is clear that rewrite transition systems are image-finite, and that this lemma applies. It is equally clear that each of the relations ^ n is decidable, and that therefore non-bisimilarity is semi-decidable over rewrite transition systems. Hence the decidability results would follow from demonstrating the semi-decidability of bisimilarity. EXAMPLE
7. Consider the following infinite-branching transition system.
560
O. Burkart et al.
The states X and Y are clearly not bisimilar, as the state Z cannot be bisimilar to An for any n ^ 0. However, X -^n V for every n ^ 0 as Z -^n An for each n ^ 0. An immediately evident yet important property is the following lemma with its accompanying corollary relating bisimulation equivalence to language equivalence. LEMMA 15. / / a - -
(3 and
a
oc' with w G I*, then (3 -%• ^' for some (3' such that
od - (3'. PROOF. Given a bisimulation 11 containing (a, (3), an induction on the length of w demonstrates that if a - ^ a' then |3 - ^ (3' with (a', P') G 7e. COROLLARY
G
I* D
16. / / a - - (3 then a-^L (3.
PROOF. If a '^ |3 then w G L(a) iff a - ^ (x! where (x! is a final state, which - by the previous lemma - holds iff |3 - ^ (3' where (3' is a final state, which in turn holds iff w G L((3). D
Apart from being the fundamental notion of equivalence for several process algebraic formalisms, bisimilarity has several pleasing mathematical properties not shared by other equivalences such as language equivalence. Furthermore as given by the following lemma, language equivalence and bisimilarity coincide over the class of normed deterministic processes. LEMMA 17. For states a and ^ of a normed deterministic transition system, if Oi^\_ |3 then a "^ (3. Thus, taken along with Corollary 16, ~ L ^^^ ^ coincide. PROOF. It suffices to demonstrate that the relation {(a, (3): a ^ L P and a, (3 are states of a normed deterministic transition system} is a bisimulation relation. D
Hence it is sensible to concentrate on the more mathematically tractable bisimulation equivalence when investigating decidability results for language equivalence for deterministic language generators. We shall see examples of this in Section 2.
561
Verification on infinite structures 1.3. Expressivity
results
The hierarchy from above gives us the following classification of processes. PDA BPA (h)
(i)
(?)
(?)
(J)
(e)
(f)
(g)
FN MSA
BPP FSA (a)
(b)
(d)
(c)
In this section we demonstrate the strictness of this hierarchy by providing example transition systems which lie precisely in the gaps (a)-(j) indicated in the classification. (We leave open the question regarding the final two gaps.) We in fact do more than this by giving examples of normed deterministic transition systems which separate all of these classes up to bisimulation (and hence also language) equivalence. These results complement those presented for the taxonomy described by Burkart, Caucal and Steffen [24]. (a) The first automaton in Example 0 provides a normed deterministic FSA. (b) The type 2 rewrite system with the two rules A - ^ A A and A —> e gives rise to the same transition system regardless of whether the system is sequential or parallel; this is an immediate consequence of the fact that it involves only a single variable A. This transition system is depicted as follows. AA b ~ b ^ b This is an example of a normed deterministic transition system which is both a BPA and a BPP but not an FSA. (c) Examples 2 and 3 provide a transition system which can be described by both a BPP (Example 2) and a PDA (Example 3). However, it cannot be described up to bisimilarity by any BPA. To see this, suppose that we have a BPA which represents this transition system up to bisimilarity, and let m be at least as large as the norm of any of its variables. Then the BPA state corresponding to X B ^ in Example 2 must be of the form A a where A G V and a € V"^. But then any sequence of rL(A) norm-reducing transitions must lead to the BPA state a, while the transition system in Example 2 has two such non-bisimilar derived states, namely XB^~^ and B^ where k = n ( a ) . (d) The following BPP with initial state X
X
XB
X
XD
B ^ E
D^e
562
O. Burkart et al.
is not language equivalent to any PDA, as its language is easily confirmed not to be context free. (The words in this language of the form a*c*b*d*e are exactly those of the form a^c^b^d^^e, which is clearly not a context-free language.) (e) Examples 1 and 4 provide a transition system which can be described by both a BPA (Example 1) and a MSA (Example 4). However, the context-free language which it generates, {a^cb^: n > 0}, cannot be generated by any BPP, so this transition system is not even language equivalent to any BPP. To see this, suppose that L(X) = {a^cb^: n^O] for some BPP state X. (As the process has norm 1, the state must consist of a single variable X.) Let k be at least as large as the norm of any of the finite-normed variables of this BPP, and consider a transition sequence accepting the word a^cb^: X-^Yawhere the c-transition is generated by the transition rule Y - ^ j3. We must have n(Ya) = k+1 > rL(Y), so a 7^ e; hence a - ^ £ and (3 have
£ for some i > 0. Thus we
from which we get the desired contradiction: a^b^cb^"^ G L(X) for some i > 0. (f) The following PDA with initial state pX VX-^VXX
pX-^q
pX-^r
rX
qX
coincides with the MSA which it defines, since there is only one stack symbol. This transition system is depicted as follows. qX
(qX^
b
b
\pX
b
b rX
However, this transition system cannot be bisimilar to any BPA, due to a similar argument as for (c), nor language equivalent to any BPP, due to a similar argument as for (e). (g) The following MSA with initial state pX pX - ^ pA
pA - ^ pAA
qA-^qB
TA
pA-^qB
qB-^r
TB-
563
Verification on infinite structures
generates the language {a^^b^c^: 0 < k ^ n}, and hence cannot be language equivalent to any PDA, as it is not a context-free language, nor to any BPP, due to a similar argument as for (e). (h) The following BPA with initial state X X-^XA
B ^ s
XBX
generates the language (wcw^: w e {a, b}*} and hence is not language equivalent to any PN [126]. (i) The following PDA with initial state pX pX-^pAX
pA-^pAA
pB-^pAB
qA
rA-^r
pX-^pBX pX-^qX pX rX
pA-^pBA
qB-
r B ^ r
pA-^qA
pB-^pBB pB-^qB
qX
r X ^ r
pA-^rA
pB
rB
is constructed by combining the ideas from (f) and (h). It can be schematically pictured as follows. ?-(qEX j - . —
MFEXJ-.—?
• • •
C
pEX
_L_(^pPEx)—9^
d
d
f
rX
)-^—^
r rEX j-^—5
frFEXj—-^
• • •
In this picture, e, f, g , . . . e {a, b} and E, F, G,... G {A, B} correspond in the obvious way. The language this PDA generates is {wcw^a, wcw^b: w G {a, b}*} and hence as in (h) above it is not language equivalent to any PN; and as in (c) above it is not bisimilar to any BPA. (j) The Petri net from Example 5 cannot be language equivalent to any PDA, as its language is easily confirmed not to be context-free. (The words in this language of the form a*b*c*d are exactly those of the form a ^ b ^ c ^ d , which is clearly not a context-free language.) More importantly, this Petri net cannot be bisimilar to any MSA [119]. To see this, suppose that the net is bisimilar to some MSA state pA. (As the process has norm 1, the stack must consist of a single symbol A.) Consider performing an indefinite sequence of a-transitions from pA. By Dickson's lemma (Lemma 3), we must eventually pass through two states q a and qal3 in which the control states are equal and the stack of the first is contained in the stack of the second. This implies is that we can perform the following execution sequence.
564
O. Burkart et al.
(We can assume that the period of the cycle is of the same length as the initial segment. If this isn't already given by the lemma, then we can merely extend the initial segment to the next multiple of the length of the cycle given by the Lemma, and use this multiple as the cycle length.) Considering now an indefinite sequence of b-transitions from qa, a second application of Dickson's lemma gives us the following execution sequence. ^
b^
b^
5- b*^
r-2 b ^
q a —> Ty —> ryo —> ryb
—> • • •
(We can assume again by the same reasoning as above that the period of the cycle is of the same length as the initial sequence. Furthermore, we can assume that this is the same as the cycle length of the earlier a-sequence, by redefining the cycle lengths to be a common multiple of the two cycle lengths provided by the lemma.) Now there must be a state S(J such that _ , a'^
b^
c*^
c
pA —> q a — > ry —> SG -^^ . Consider then the following sequence of transitions. pA - ^ qa(3 - ^ ry6(3 - ^ sa5(3 - ^ . There must be a rule for sX —^ for some X which appears in either 5 or (3. But considering the following sequence of transitions pA —> q a —> ryb —> sob
-^
we must deduce that this X cannot appear in 6. Equally, considering the following sequence of transitions pA - ^ qa(3 - ^ ry(3 - ^ sa(3 - ^ we must deduce that this X cannot appear in (3. We thus have the desired contradiction. We here summarize again these separation results in the following theorem. THEOREM 18. There exist {normed and deterministic) labelled transition systems lying precisely in the gaps (a)-(j) in the figure above.
1.4. Further classes of processes For concreteness, in this chapter we concentrate mainly on the classes of processes which fall within the described hierarchy. However, we shall also summarize various decidability
Verification on infinite structures
565
and algorithmic results pertaining to other classes of processes which have been intensively studied. These are either extensions or restrictions of classes within our hierarchy, and are summarized below. PA. Historically, the class BPA was first defined as a process algebra [9] with prefixing, nondeterministic choice, sequential composition, and recursion. Similarly, the class BPP was introduced by Christensen [35] as the parallel analogue to BPA, where sequential composition is replaced by parallel composition without communication. A natural extension of both classes then is their least common generalization, obtained by allowing both kinds of composition simultaneously. This class of processes is known simply as Process Algebra (PA). ONE-COUNTER AUTOMATA. If we restrict the stack alphabet of a PDA so that it contains only one symbol (apart from a special bottom-of-stack marker), then we arrive at the class of one-counter automata. This is the class defined by finite-state automata augmented with a single counter variable; transitions may increment, decrement, or leave unchanged the value of the counter, and such a transition may be determined by a test-for-zero of the counter value. Note that with two counters we describe the full power of Turing machines, and hence we cannot hope for decidability for any semantic notions. Restricting to a single counter aims to delimit the decidability boundary. ONE-COUNTER NETS. The class of Petri nets with (at most) one unbounded place gives rise to the class of one-counter nets. These differ from one-counter automata in that they cannot test-for-zero, but rather only test-for-nonzero. That is, if a transition may occur if the counter is zero, then it can equally occur if the counter is non-zero. As we shall see, various problems will be undecidable for Petri nets with only two unbounded places; this being the case, considering Petri nets with only a single unbounded place makes for a natural restriction.
2. The equivalence checking problem 2.1. Decidability results for BPA and BPP In this section we describe several positive results which have been established regarding the decidability of bisimilarity between type 2 rewrite transition systems. In particular, we shall briefly describe the techniques behind the following results: 1. Bisimilarity is decidable for BPA [38] and BPP [36,37]. 2. Bisimilarity is decidable in polynomial time for normed BPA [69,70] and normed BPP [71]. These results contrast with those regarding the undecidability of language equivalence for both BPA and BPP The negative result for BPA [6] follows from the fact that BPA effectively defines the class of context-free languages; and that for BPP [66] follows from a modification by Hirshfeld of a technique of Jancar which is described in Section 2.4. Both arguments can be shown to hold for the class of normed systems. Also, for both BPA and
566
O. Burkart et al.
BPP, this undecidability extends to all equivalences which lie in Glabbeek's spectrum [59] between bisimilarity and language equivalence [61,79,82]. Baeten, Bergstra and Klop [4,5] presented the first such decidability result, that bisimilarity between normed BPA is decidable. Their lengthy proof exploits the periodicity which exists in normed BPA transition systems, and several simpler proofs exploiting structural properties were soon recorded, notably by Caucal [31], Hiittel and Stirling [80], and Groote [60]. Huynh and Tian [81] demonstrated that this problem has a complexity of I 2 by providing a nondeterministic algorithm which relies on an NP oracle; Hirshfeld, Jerrum and Moller [69,70] refined this result by providing a polynomial algorithm, thus showing the problem to be in P. A generally more efficient, though worst-case exponential, algorithm is presented by Hirshfeld and Moller [72]. Finally, Christensen, Hiittel and Stirling [38,39] demonstrated that bisimilarity between arbitrary BPA systems is decidable, whilst Burkart, Caucal and Steffen [23] demonstrated an elementary decision procedure. For the parallel case, Christensen, Hirshfeld and Moller [37,36] demonstrated the general decidability result for BPP, whilst Hirshfeld, Jerrum and Moller [71] presented a polynomial algorithm for the normed case. As we noted in Section 1.2, one direction for the decidability results, determining nonbisimilarity, is automatic using the stratified bisimulation relations of Definition 13. It therefore behaves us merely to prove that bisimilarity is semi-decidable. 2.1.1. Composition and decomposition. An important property of bisimulation equivalence which we shall exploit is the following congruence result, which is valid for both BPA and BPP 19. ^ is a congruence {with respect to concatenation) over both BPA and BPP; that is, ifoi^^ and (x! -- (3' then oi(x! ^ (3(3'. LEMMA
PROOF, {(aa', (3(3'): a -^ (3 and a' -- (3'} is a bisimulation.
D
Given this congruence property, we have an obvious potential technique for the analysis of (a state of) a type 2 rewrite transition system: decompose the state into simpler components. In general, this idea is not suitably provided for by this congruence property; states may indeed decompose, but not necessarily into simpler components, nor necessarily in any unique fashion. However, for the class of normed transition systems we have a unique factorization result for both BPA and BPP, of the form first explored by Milner and Moller [116]. Given a type 2 rewrite transition system, we say that a variable X G V is prime (with respect to bisimilarity ^ ) iff a = £ whenever X ^ Ycx; and both normed BPA states and normed BPP states can be decomposed in a unique fashion into such prime components. We shall demonstrate these two results here separately. For the BPA case, we start with the following cancellation lemma. LEMMA 20 (Cancellation lemma for normed BPA). (f n(y) < 00, then a y ^ (3y implies a ^ (3. PROOF,
// a, (3 and y are states of a BPA and
{(a, (3): a y ^ (3y for some y with n(y) < 00} is a bisimulation.
D
Verification on infinite structures
567
The assumption in this lemma that y is normed cannot be dropped, as can be readily seen by considering the following counterexample. Given the two rewrite rules X - ^ e and y - ^ Y, we can immediately deduce that XY --- Y, but that X / £. THEOREM 21 (Unique factorization theorem for normed BPA). Every normed state a of a BPA decomposes uniquely (up to bisimilarity) into prime components. PROOF. The existence of a prime decomposition may be established by induction on the norm. For uniqueness, suppose that a = Xi • -Xp ^ Yi • • Yq are prime decompositions, and that we have established the uniqueness of prime decompositions for all states (3 with n((3) < n ( a ) . If p = 1 or q = 1 then uniqueness is immediate. Otherwise suppose that Xi - ^ y is a norm-reducing transition that is matched by Yi - ^ 6, so that yXi • • • Xp '-^ 6Y2 • • Yq. By the inductive hypothesis, the prime decompositions of these two states are equal (up to ^), entailing Xp ^ Yq. Hence, by Lemmas 19 and 20, Xi • • Xp-i ~ Yi • • • Yq_i, and uniqueness then follows from a second application of the inductive hypothesis. D
Notice that this theorem fails for unnormed BPA states, a fact which is immediately apparent from the observation that a ~ a(3 whenever n ( a ) = 00. 22 (Unique factorization theorem for normed BPP). Every normed state of a BPP decomposes uniquely {up to bisimilarity) into prime components. THEOREM
PROOF. Again, the existence of a prime decomposition may be established by induction on the norm. For uniqueness, suppose that a = ?\^ v\^ --• ?^ - ?\^ P^^... p U ^ p represents a counterexample of smallest norm; that is, all states y with n(y) < n ( a ) have unique prime decompositions, the Pts are distinct (with respect to ^ ) primes, but there is some i such that ki ^ It. We may assume that the Pis are ordered by nondecreasing norms, and then we may choose this i so that kj = Ij whenever j > i. We shall furthermore assume without loss of generality that ki > U. We distinguish three cases, and in each case show that the state a may perform a norm-reducing transition a - ^ (x! that cannot be matched by any transition (3 —^ (3' with a' "- (3' (or vice versa with the roles of a and (3 reversed), which will supply the desired contradiction. Observe that by minimality of the counterexample, if ex! and (3' are to be bisimilar then their prime decompositions must be identical.
Case I. If kj > 0 for some ] < 1, then we may let a perform some norm-reducing transition via the prime component Pj. |3 cannot match this transition, as it cannot increase the exponent U without decreasing the exponent of some prime with norm greater than that of Pi. Case II. If kj > 0 for some j > i, then we may let a perform a norm-reducing transition via the prime component Pj that maximizes (after reduction into primes) the increase in the exponent kt. Again (3 is unable to match this transition.
568
O. Burkart et al.
Case III. If the state a = P!^' is a prime power, then note that Ij = 0 for all j > i by choice of i, and that kt > 2 by the definition of "prime". If U > 0, then we may let (3 perform a norm-reducing transition via Pt; this transition cannot be matched by a, since it would require the exponent ki to decrease by at least two. If U = 0 on the other hand, then we may let a perform a norm-reducing transition via Pi; this transition cannot be matched by (3, since (3 is unable to increase the exponent U. These cases are inclusive, so the theorem is proved.
D
The following then is an immediate corollary. LEMMA 23 (Cancellation lemma for normed BPP). //" oc, P and y are normed states of a BPP, then a y '^ (3y implies a ^ (3. Notice that for unnormed BPP, unique decomposition and cancellation again each fail, for similar reasons to the sequential case. Given a binary relation 71 on states of a type 2 rewrite transition system, let = denote the 7^
least congruence containing 1Z\ that is, = is the least equivalence relation which contains H and the pair (aa^ (3(30 whenever it contains each of (oc, (3) and (a', (3'). DEFINITION 24. A binary relation 71 on states of a type 2 rewrite transition system is a bisimulation base iff whenever (a, (3) € 7^ we have that
• if a - ^ a^ then (3 - ^ (3' for some (3' with a' = (3^ • if (3 - ^ (3' then a - ^ oc' for some oc' with a' = (3'. Hence the definition of a bisimulation base differs from that of a bisimulation only in how the derivative states a' and (3' are related; in defining 7^ to be a bisimulation, we would need these derivative states to be related by 7Z itself and not just by the (typically much larger) congruence =. A bisimulation base then is in some sense a basis for a bisimulation. The importance of this idea is encompassed in the following theorem due originally (in the normed BPA case) to Caucal.
n LEMMA
25. IflZisa
bisimulation base for a BPA or BPP transition system, then = is a
bisimulation, and hence = c.^. TZ
TZ
If a = (3 then the two clauses given by the definition of = being a bisimulation hold true. This can be demonstrated by a straightforward induction on the depth of inferTZ ence of a = (3. D PROOF.
COROLLARY PROOF.
26. a -^ (3 /jQ^(a, (3) G Kfor some bisimulation base 71.
Immediate from Lemma 25.
D
Verification on infinite structures
569
It now becomes apparent that in order to demonstrate bisimilarity between terms, we needn't produce a complete (infinite) bisimulation relation which contains the pair; rather it suffices simply to produce a bisimulation base which contains the pair. What we shall demonstrate is that this corollary can be strengthened to a finite characterization of bisimulation, in that we shall prove the existence for both BPA and BPP of a finite relation IZ satisfying = = ^ . These relations 7Z will clearly be bisimulation bases, and the semidecidability results (and hence the decidability results) will be established, taking into account the following. 27. It is semi-decidable whether a given finite binary relation 1Z over V* is a bisimulation base. LEMMA
PROOF. We need simply check that each pair (a, (3) of the finite relation 1Z satisfies the two clauses of the definition of a bisimulation base, which requires testing (in parallel) if each transition for one of a and (3 has a matching transition from the other. This matching 1Z
test - that is, checking if the derivative states are related by = - is itself semi-decidable, as 1Z
the relation = is semi-decidable.
D
The semi-decision procedure for checking a ~ |3 would then consists of enumerating all finite binary relations over V* containing the pair (a, (3) and checking (in parallel) if any one of them is a bisimulation base. We thus concentrate on defining the finite relation IZ satisfying = = ^ . 2.1.2. A finite bisimulation base for BPA. The finite bisimulation base for BPA which we present here is taken from Christensen, Hiittel and Stirling [38,39]. We first present some technical results, starting with the following unique solutions lemma. LEMMA
28 (Unique solutions lemma). // oc ~ y a and (3 ^ y (3 for some y ^ e then a --
p. Let 1Z = {(6a, 6(3): a ~ y a and (3 ~ y(3 for some y :^ e}. We may demonstrate straightforwardly that ^ 7 ^ ^ is a bisimulation, from which we may deduce the desired result. D PROOF.
An important finiteness result on which the construction of the finite bisimulation base hangs is given by the following. LEMMA
29. If ay ^ ?>y for infinitely many non-bisimilary, then a -^ (3.
We can show that 7^ = {(a, (3): ocy ^ (3y for infinitely many non-bisimilar y} is a bisimulation, from which the result follows. D PROOF.
We may split the set of variables into two disjoint sets V = V^ U Vu with the variables in V]sj having finite norm and those in Vu having infinite norm. The motive in this is based on the following lemma.
570
O. Burkart et al
LEMMA
30. IfX has infinite norm then Xa ^ X/or all a.
PROOF.
We can immediately verify that {(X, Xa): X has infinite norm} is a bisimulation. D
Hence we need only ever consider states a G V N * U V M * V U , the others being immediately transformed into such a bisimilar state by erasing all symbols following the first infinite-norm variable. The construction relies on recognizing when a term may be broken down into a composition of somehow simpler terms. To formalize this concept we start with the following definition. DEHNITION 31. A pair (Xa, Y(3) satisfying Xa -^ Y|3 is decomposable if X and Y have finite norm, and for some y, • X'^ Yy a n d y a ^ (3; or • Y '^ Xy and y (3 ^ a.
The situation would be clear if all bisimilar pairs were decomposable; indeed we shall exploit this very property of normed transition systems - which follows there from the unique decomposability result - in Section 2.2.1. However we can demonstrate that there is in some sense only a finite number of ways that decomposability can fail. This crucial point in the argument is formalized in the following lemma. We consider two pairs (Xa, Y^) and (Xa', Y(3') to be distinct if a / a' or (3 7^ |3'. LEMMA
32. For any X, Y G V, any set U of the form {(Xa,Y(3): Xa, Y(3
G VN*
U VN*VU, Xa-Y|3,
and (Xa, Y(3) not decomposable] which contains only distinct pairs must be finite. If X, Y G VU then clearly 1Z can contain at most the single pair (X, Y). If X G Vu and Y - ^ £ and 7^ = {(X, Y(3i): 1 G 1} then for each i G I we must have that X - ^ at such that at ^ |3i. But then by image-finiteness there can be only a finite number of non-bisimilar such (3i. Suppose then that X, Y G VN and that IZ = {(Xat, YPi): t G 1} is infinite. Without loss of generality, assume that n(Y) ^ n(X), and that Y - ^ e with length(w) = n(Y). Then for each i G I we must have that X - ^ yi such that y i a t '^ (3i. By image-finiteness, we can have only finitely many such yi, so we must have that X - ^ y for some y such that y a t ^ |3i holds for infinitely many i G I; by distinctness these ais must all be nonbisimilar. For these 1 G I we must then have that Xat ^ Yyat, But then by Lemma 29 we must have that X ^ Yy, contradicting non-decomposability. D PROOF.
We are now ready to demonstrate the main result, that there is a finite relation 1Z satisfyiz ing = = '^. This will be done by induction using the following well-founded ordering :<.
Verification on infinite structures DEFINITION
571
33. Define thefiniteprefix norm rif (a) of a € V* as follows:
nf(a) = max{n((3): rL((3) < oo and a = (3y for some y } . We then define the following preorder on pairs: ( a i , ocz) < ( P i , ^2) iff max(nf ( a i ) , nf(a2))^max(nf(Pi),nf(|32)). LEMMA 34. Letno = {(X, a): X G VN and X -- a}, and let 11] be the largest set of the
form {(Xa,Y13): Xa, ¥(3 € V N * V U U V N * , X a - Y p ,
and (Xa, Y(3) is not decomposable^ which contains only distinct pairs, and containing minimal elements with respect to <. Then 1Z = IZQ U 7^I is a finite relation satisfying = = ^. and 1Z] must both be finite. Also we must have = c ^. We will iz demonstrate by induction on :< that Xa ^ Y(3 implies Xa = Yp. If (Xa, YP) is decomposable, then X, Y e VN and (without loss of generality) assume that X ' - Y y and y a -- p. Then nf(ya) < nf(Yya) = nf(Xa) and nf(P) < n f (YP), PROOF.
Firstly,
TZQ
7Z
SO (ya, P) < (Xa, YP). Hence by induction y a = p. Then from (X, Yy) e Ho we get iz iz Xa = Yya = Yp. Suppose then that (Xa, YP) is not decomposable. Then (Xa', Yp') € U] for some a' -a and P' -^ p with (a', P') < (a, P). • If X, Y € VTSJ , then (a, P), (a\ p') < (Xa, YP), so (a, a'), (P, PO -< (Xa, YP). Thus by induction a 1 a' and P 1 p^ so Xa i Xa'7^YP' i Yp. • If X € VN and Y G Vu, then p = P' = e and Xa -- Y. Also nf(oc') ^ Uf (a) < Uf (Xa), 7Z
7Z
1Z
SO (a, a') -< (Xa, Y). Thus by induction a = a', so Xa = Xa' = Y. A symmetric argument applies for the case when X G Vu and Y G VN . • If X, Y G Vu, then a = a' = P = P' = e and (X, Y) G 7^l, so Xa 2 Yp.
D
With this, we have demonstrated the desired result. THEOREM 35. Bisimulation equivalence is decidablefor BPA. 2.1.3. A finite bisimulation base for BPR The finite bisimulation base for BPP which we describe here is taken from Hirshfeld [67], which is itself a revised presentation using Dickson's lemma (Lemma 3) of the result of Redie [129] that every congruence on a finitely generated commutative semigroup (such as bisimilarity over BPP) is finitely generated. Firstly, assuming that the set of variables is V = {Xi,..., Xn}, we note that a state a is a monomial X^^ • • • Xn"^ over V. We then define the following two orderings on states.
572
O. Burkart et al.
DEFINITION 36.
• X^^ • • -Xn^ < X^^ . • -Xn^ iff for some i: kt < U and kj = Ij for all j < i. • X^^ •••Xn^ [ZX\^ ..-Xn^ i f f f o r s o m e i : k i < l i a n d k j ^ Ij for all j . Note that a [I (3 implies that a < (3, and that these orderings are both well-founded: we cannot have an infinite decreasing sequence of states with respect to either ordering. Furthermore, < is a total ordering: for any oc^ ^, either a < (3 or (3 < a. Finally, both orderings are precongruences: if a < (3 and a' < (3' ( a E (3 and a' E (3') then a a ' < (3(3' (aa'E(3(30. DEHNITION 37. Apair(a, (3) of statesism/n/ma/iff a7^ (3, and for any (a', (3') E (a, (3) with oc' -- (3' we have a' = (3'. (By (a', (3') E (a, (3) we mean (a', (3') 7«^ (a, (3) but a' E (X and (3' E (3; note that this implies that a'(3' E a(3.) Let 7^ be the collection of all minimal bisimilar pairs.
LEMMA 38. His finite. PROOF. Suppose we have an infinite sequence of distinct pairs (at, (3i) e IZ. We can take an infinite subsequence in which the exponents of the variable Xi in the states at form a nondecreasing sequence, and then we can take a further infinite subsequence in which the exponents of the variable X2 in the states at form a nondecreasing sequence, and continue in this fashion so that we are left with an infinite subsequence (at, (3i) G 7^ with (cxi, (3i) E (a2, (32) E •••.Butthen(ai, (3i) (fori> 1) cannot be minimal, contradicting its inclusion in IZ. D LEMMA 39.
= = ^.
PROOF. If a = (3 then clearly a -^ (3 since ^ is a congruence and 71 by definition only contains bisimilar pairs.
Suppose then that a -^ (3 but that a ^ (3 (in particular, a 7«^ (3), and that this is a minimal TZ
counterexample in that if (x! ^ ^' and a'(3' < a(3 then a' = (3^ Since (a, (3) ^ 7e there must be ((x^ (30 E (a, (3) with (x! -- (3' and a ^ (3'. Then a'(3' E 7Z
a(3, SO a'(3' < a(3, and hence by the minimality assumption we have that a' = (3^ Without loss of generality, assume a' < (3'. Let (3'' be such that (3 = (3'(3'^ Then a ^ (3 = (3^(3'' - a'(3''. But ococ'^'' < aP'(3" = a(3, so a i a'(3'' i (3'(3'' = (3, contradicting the assumption that a ^ (3.
D
Hence we have again demonstrated the desired result. THEOREM
40. Bisimulation equivalence is decidable for BPP.
2.2. Polynomial time algorithms for BPA and BPP In Section 2.1 we demonstrated the decidability of bisimulation equivalence over both BPA and BPP. However, the computational complexity of the algorithms which we presented
Verification on infinite structures
573
shows them to be of Uttle practical value. To overcome this deficiency we concentrate in this section on developing efficient algorithms for deciding bisimilarity within these classes of transition systems. What we demonstrate in fact are polynomial algorithms for the problem of deciding equivalences over the subclasses of normed transition systems. These algorithms will both be based on an exploitation of the decomposition properties enjoyed by normed transition systems; however, despite the apparent similarity of the two problems, different methods appear to be required. For the algorithms, we fix a normed type 2 rewrite transition system with variable set V. The problem then is to determine efficiently - that is, in time which is polynomial in the the number n of symbols in the rewrite rules - whether or not a ^ P for oc, (3 G V*, where we interpret the transition system first as a BPA and then as a BPP. The first algorithm we describe for BPA is taken from Hirshfeld, Jerrum and Moller [69,70]. The second one for BPP is taken from Hirshfeld, Jerrum and Moller [71]. 2.2.1. A polynomial time algorithm/or normed BPA. The basic idea behind the algorithm we present here for deciding bisimilarity between normed BPA states is to exploit the unique prime decomposition theorem by decomposing states sufficiently far to be able to establish or refute the equivalence we are considering. Further, we try to construct these decompositions by a refinement process which starts with an overly generous collection of candidate decompositions. As the algorithm progresses, invalid decompositions will gradually be weeded out. Assume that the variables V are ordered by non-decreasing norm, so that X < Y implies n(X) ^ n(Y). A base is a set B of pairs (Y, Xa), where X, Y G V, a G V*, X ^ Y and rL(Y) = n(X(x). We insist that B contains at most one pair of the form (Y, Xa) for each choice of variables X and Y, so that the cardinality of B is at most O(n^). A base B is full iff whenever Y -- X(3 with Y ^ X there exists a pair (Y, Xa) G B such that a -- (3. In particular, (X, X)eB for all X G V. The key observation is that bisimilarity is the congruence closure of a finite base. At the heart of the algorithm is the definition of a polynomial-time (in the size of B) relation = ^ c = which satisfies ^ c = 5 whenever B is full. Central to the definition of the relation = 5 is the idea of a decomposing function. A function g: V ^ V* is a decomposing function if either g(X) = X or g(X) = Xi X2 • • • Xp with Xi < X for each 1 ^ 1 < p. Such a function g can be extended to the domain V* in the obvious fashion by defining g(e) = £ and g(Xa) = g(X)g(a). We then define g*(a) for a G V* to be the limit of g*(a) as t -> 00; owing to the restricted form of g we know that it must be eventually idempotent, that is, that this limit must exist. The notation g[X h^ a] will be used to denote the function that agrees with g at all points in V except X, where its value is a. The definition of the relation =s may now be given. For base B and decomposing function g, the relation a = ^ g|3 is defined by the following decision procedure: • if g*(a) = g*(3) then return true; • otherwise let X and Y (with X < Y) be the leftmost mismatching pair of symbols in the words g*(a) and g*((3); - if (Y, Xy) G B then return a = | g'(3, where g' = g[Y h-> Xy]; - otherwise return false.
574
O. Burkart et ai
Finally, =s is defined to be = ^ Id where Id is the identity function. (Note that this procedure terminates, as it calls itself at most | V| times, each time updating the value of the parameter function g to decompose another variable.) LEMMA 4 1 . = 5 C = and ^ C = ^ whenever B is full. PROOF.
The first inclusion is easily confirmed, since for any g constructed by the algo-
rithm for computing = 5 , it is the case that X = g(X) for each X € V. For the second inclusion, suppose that a '^ (3 and at some point in the procedure for deciding a = 5 (3 we have that g*(a) 7»^ g*(P), and that we have only ever updated g with mappings X h-> y satisfying X -^ y. Let X and Y (with X < Y) be the leftmost mismatching pair. Then Y -- Xy must hold for some y, and so, by fullness, (Y, Xy) e B for some y with Y ^ Xy. So the procedure does not terminate with a false result, but instead updates g with this new semantically sound mapping and continues. D To demonstrate that =j^ can be decided efficiently, we are left with the problem of deciding g* (a) = g*( (3) in time polynomial in the size of B (and finding the leftmost mismatch in case of inequality); all other elements in the definition of =s are algorithmically undemanding. Note that the words g*(a) and g*(13) will in general be of exponential length, so we cannot afford to compute them explicitly. However, the relation can indeed be computed in polynomial time with a dynamic progranmiing algorithm which exploits standard string alignments tricks based on ideas from Knuth, Morris and Pratt [94]. The details of this algorithm can be found in [70]. The main task now is to discover a small full base that contains only semantically sound decomposition pairs. To do this, we start with a small full base, and then proceed to refine the base iteratively whilst maintaining fullness. Informally, we are proposing that at any instant the current base should consist of pairs (X, a) representing candidate decompositions, that is, pairs such that the relationship X '^ a is consistent with information gained so far. The refinement step is as follows. Given a base S, define the sub-base S c S to be the set of pairs (X, a) € B such that • if X - ^ (3 then a - ^ y with (3 =s T ^ and • if a - ^ y then X - ^ (3 with (3 = 5 y. LEMMA
42. IfB is full then Bis full
Suppose Y -- Xp with Y > X. By fullness of B, there exists a pair (Y, Xa) € B such that a ^ (3. We show that the pair (Y, Xa) survives the refinement step, to be included in B. Note that, since ^ is a congruence, Y ^ Xa. Thus, if Y - ^ y then Xa - ^ 6 for some 5 satisfying 6 ^ y. By fullness of B and Lemma 41, 6 = ^ y. Similarly, if Xa - ^ 6 then Y - ^ y with y -^ 6, and hence y =/3 6. The pair (Y, Xa) therefore satisfies the conditions for inclusion in B. D
PROOF.
In general, the refinement step makes progress, i.e., the new base B is strictly contained in the base B from which it was derived. If, however, no progress occurs, an important deduction may be made.
Verification on infinite structures
575
LEMMA
43. / / B = B then =s ^ ^•
PROOF.
The relation = 5 is contained in =, the congruence closure of B; and if S = B
then B must be a bisimulation base, in which case by Theorem 25, =s ^ = ^ ^-
•
Note that by iteratively applying the refinement step B := B io 3. full initial base, we are guaranteed by the preceding three lemmas to stabilize at some full base B for which Finally, we are left with the task of constructing the initial base BQ- This is achieved as follows. For each X € V and each 0 ^ A^ ^ n(X), let [X]^ be some state that can be reached from X via a sequence of ^^ norm-reducing transitions. (Note that some norm-reducing transition is available to every state.) LEMMA
44. The base BQ = {(Y, X[Y]n(X)): X^YeVandX^Y}
is full.
Suppose Y - X(3 with X ^ Y, and let ^/ = n(X); then (Y, X[Y]^) e BQ for some [Y]^ such that Y - ^ [Y]^ in ^ norm-reducing steps, where s e A^. But the norm-reducing sequence Y - ^ [Y]^ can only be matched by X(3 -^ (3. Hence [Y]^ ^ (3, and BQ must be full. D PROOF.
The basic structure of the procedure for deciding bisimilarity between normed states a and (3 is now clear: simply iterate the refinement procedure B := B from the initial base B = Bo until it stabilizes at the desired base S, and then test oc = 5 (3. By the preceding four lemmas, this test is equivalent to a ^ |3. We have not been specific about which state [X]^ is to be selected among those reachable from X via a sequence of y norm-reducing transitions. A suitable choice is provided by the following recursive definition. For each variable X G V, let a x e V* be some state reachable from X by a single norm-reducing transition X - ^ a x . Then, [a]o = a, [(3]p-n(X), U^xlp-iP,
ifp^n(X), if p < n ( X ) .
45. With this definition for [J^, the base BQ introduced in Lemma 44 may be explicitly constructed in polynomial time; in particular, every pair in Bo has a compact representation as an element ofV xV*. LEMMA
PROOF. It is easily checked that the natural recursive algorithm based on the definition is polynomial-time bounded. D
We have already observed that BQ contains O(n^) pairs, so the refinement procedure is iterated at most O(n^) times. Hence we have succeeded in demonstrating our result. THEOREM 46. There is a polynomial-time {in the lengths of the states a and (3, and the size of the rewrite rules) procedure for deciding bisimilarity between two states a and (3 of a normed type 2 sequential rewrite transition system.
576
O. Burkart et al.
Simple context-free grammars. Recall that a simple grammar is a context-free grammar in Greibach normal form such that for every variable X and terminal symbol a there is at most one production of the form X -» a a ; these correspond to deterministic type 2 sequential rewrite transition systems. The decision procedure given by Korenjak and Hopcroft [95] for deciding language equivalence between simple grammars is doubly exponential; this time complexity was improved by Caucal [30] to be singly exponential. The following result demonstrates that this problem has a polynomial-time solution. THEOREM
47. There is a polynomial-time algorithm for deciding equivalence of simple
grammars. PROOF. TO obtain a polynomial-time decision procedure for deciding language equivalence of simple context-free grammars (deterministic type 2 sequential rewrite transition systems), we merely recall from Lemma 17 that in the case of normed deterministic transition systems, language equivalence and bisimulation equivalence coincide. We can restrict attention to normed grammars, as any unnormed grammar can be transformed into a language-equivalent normed grammar by removing productions containing unnormed nonterminals. (Note that this transformation does not preserve bisimulation equivalence, which makes it inappHcable for reducing the unnormed case to the normed case in checking bisimilarity.) Thus language equivalence of simple grammars may be checked in polynomial time by the procedure presented in the previous two sections. D 2.2.2. A polynomial time algorithm for normed BPP. To demonstrate that we can decide bisimilarity between normed BPP in polynomial time, we require a vastly different technique than that used for the BPA case; nonetheless the technique still relies completely on the unique factorization property. To start off, we assume without loss of generality that the variables are given in order of non-decreasing norm, so that n(Xi) ^ n{Xi) ^ • • • ^ n(XrC}- Define the size of a monomial a G V* to be the sum of the lengths of the binary encodings of the various exponents appearing in the monomial; the size of a production X - ^ (3 to be the length of the triple (X, a, (3), encoded in binary; and the size of a rewrite transition system to be the sum of the sizes of all the rewrite rules contained within it. To prepare for the description of the algorithm, and the proof that it runs in polynomial time, we require some definitions and a few preparatory lemmas. We omit the (generally straightforward) proofs of these lemmas; they can be found in [71]. Suppose IZ is any relation on V*. We say that a pair (a, (3) G V* x V* satisfies {normreducing) expansion in IZ if • if a - ^ a' is a (norm-reducing) transition then (3 - ^ (3' for some (3' with oc'U^'; and • if (3 - ^ (3Ms a (norm-reducing) transition then ex - ^ a' for some a' with oc'7Z^\ Observe that a relation 7^ is a bisimulation if every pair (a, (3) € 7^ satisfies expansion in ^ . Observe also that if IZ is an equivalence relation (respectively, congruence) then the relations "satisfies expansion in 7^" and "satisfies norm-reducing expansion in 7^" are both equivalence relations (respectively, congruences). Define a unique decomposition base, T>, to be a pair (TT, F), where W = T\{V) = { P i , . . . , Pr} c V is a set of primes, and V = V{V) is a set of pairs (X, P ^ ^ .. P?'), one for each
Verification on infinite structures
577
non-prime variable X € V — Ff. The set F may be viewed as specifying, for each nonprime variable X, a decomposition of X into primes. (Note that these "primes" are not in general the primes with respect to the maximal bisimulation, which were the subject of Theorem 22.) A unique decomposition base defines an equivalence relation = p on V*: the relation a =x> (3 holds between oc, (3 G V* if the prime decompositions of a and (3 are equal (as monomials). LEMMA 48. Let V be a unique decomposition base. Then: (i) the equivalence relation =j) is a congruence with cancellation {that is, a = p (3 V
whenever a y = p (3y) which coincides with =, the smallest congruence containing V{V)(ii) there is a polynomial-time {in the size ofocand (3) algorithm to decide a =j) ^for arbitrary a, (3 G V*; (iii) the relation =T> is a bisimulation provided every pair in r{V) satisfies expansion within =x>\ this condition may be checked by a polynomial-time algorithm', (iv) the maximal bisimulation ^ coincides with the congruence ^ p , where V represents the unique decomposition in ^. The next lemma allows us to shrink a congruence, defined by a unique decomposition base, whenever it is strictly larger than the maximal bisimulation. LEMMA 49. Let Vbea unique decomposition base such that the congruence = p is normpreserving and strictly contains the maximal bisimulation ^. Define the relation = as follows: for all ex, |3 G V*, the relationship a = |3 holds iff a = p (3 and the pair (oc, P) satisfies expansion in =x>. Then it is possible, in polynomial time, to find {a representation of) a relation = on V* such that: (i) the relation oc= ^ is decidable in polynomial time {in the sum of the sizes of a and (3); (ii) the relation = is a congruence; (iii) there is a variable X G V that is decomposable in =^ but not in =; (iv) the inclusions ^ c = c =x) hold.
The final lemma allows us to "smooth out" an unmanageable congruence into a congruence defined by a unique decomposition base. 50. Let ^ be a norm-preserving, polynomial-time computable congruence satisfying ^ C =, where ^ denotes maximal bisimulation. Then there is a decomposition base T>, computable in polynomial time, such that ^ C = p ^ =• LEMMA
With the three preceding lemmas in place, the procedure for deciding bisimulation equivalence is clear. (1) Let the congruence = be defined by a = (3 iff n ( a ) = n((3). (2) Compute a decomposition base V with ^ C =x, c =, using Lemma 50. (3) If =x) is a bisimulation - a condition that can be checked in polynomial time using Lemma 48 - then halt and return the relation =x).
578
O. Burkart et al
(4) Compute a congruence = satisfying -^ c = c ^ p , using Lemma 49. Go to step 2. The main result is then virtually immediate. 51. Given a normed BPP over variable set V, there is a polynomial-time {in the size of a, [3, and the transition rules) algorithm to decide a -^ |3 for arbitrary a, P € V*.
THEOREM
PROOF. On each iteration of the loop formed by lines (2)-(4), the number of primes increases by at least one. Thus the number of iterations is bounded by n, and each iteration requires only polynomial time by the three preceding lemmas. D
2.3. Computing a finite bisimulation base for EPA In Section 2.1.2, we demonstrated the existence of a finite bisimulation base for BPA; this permitted us to infer the decidability of bisimilarity between BPA states using two semidecision procedures. In this section, we describe an algorithm from [23] for constructing a general bisimulation base, a finite relation IZ in which the least congruence = contammg 7c is equal to ~ . From this we deduce a stronger result than the decidability of bisimulation: the largest bisimulation ^ is an effective rational relation [24]. Furthermore, the algorithm that we describe will demonstrate that the equivalence problem with respect to bisimilarity of BPA states can be solved in double exponential time. Given any binary relation 7?. on V*, we define E(7^) to be the set of pairs in IZ which TZ
satisfy expansion in =; that is, (a, (3) € E(7^) iff (oc, (3) € 7^ and • if a - ^ (x! then (3 -A- (3' for some (3' with (x! = (3'; and • if (3 - ^ (3' then a - ^ (x! for some ex! with (x! = |3'. TZ
In particular, 7^ is a bisimulation base (cf. Definition 24) if 7^ == E(7^), in which case = is a bisimulation (cf. Lemma 25). Our intention is to construct a finite base IZ generating the largest bisimulation: ^ = =. To do this, we mimic the construction from Section 2.2.1: (1) we find 2i finite relation IZo which is complete, meaning that -- = = (this is a refinement of the notion of fullness defined in Section 2.2.1); (2) we then repeatedly apply E to compute KQ 2 E(7^o) 2 E^(7?o) 5 • • • until we find that E^(7^o) = E^+^ {IZo)'. we then take 7e = E^(7eo). (Note that n can be no greater than the size of T^o) That this procedure provides the desired finite base IZ satisfying ^ = = follows from the fact that completeness is preserved by the application of E, as demonstrated in the next result (cf. Lemma 42). LEMMA
52. IfB is complete, then /5 n ^ = E(B) Pi ^, so E(B) is complete.
Verification on infinite structures PROOF.
579
Assume that B is complete, so that -- = = c = . Then since E is monotonic, we
get ^ = E(^) c E(=), and hence Bn--
= BnE(i)
n-
(since - c E ( i ) )
= Bn L(B) n -
(since Bn E ( i ) = Bn E(B))
= E(B) n -
(since E(B) c B).
D
We shall apply this method to an arbitrary BPA system. As before we split the set of variables into two disjoint sets V = VN U Vu with the variables in VN having finite norm and those in Vu having infinite norm, and make use of thefiniteprefix norm from Definition 33: nf(a) = max{rL((3): n((3) < oo and a = (3y for some y } . Given the following three relations 7^o = {(A,AB): A e Y u a n d B e V } , 7^f = {(A,a)€VN X VN*: n(A) = n(a)}, 7^oo =
VN*VUXVN*VU,
we shall construct a finite complete relation U = UQ VJ U^ VJ W with W c Hoc- Then by Lemmas 52 and 53 below, we shall be able to construct 7^ H '^. LEMMA 53. For any finite S C^IZ^VJ Hoc ^ith TZQ C 5, the relation = is decidable\ hence we can compute E(5). PROOF.
Let
5f = SCMlu
and
Soo = {{oc\e>'y a = a a n d p S p ' f o r s o m e C a , |3)€5n7eoc}. As Si is finite and norm-preserving, S^c must be finite as well. Now, i = {(a, P): a, | 3 € V N * a n d a S l 3 } U {(ay,
|36): a, (3 G V N * V U and a %
(3}.
o
Note that = restricted to VN * is decidable: «Sf is norm-preserving, and hence any equivS alence class is an effective finite set. Furthermore =" restricted to VN * VU is decidable: it is the suffix derivation of Soo ^ S^^, and hence any equivalence class is an effective rational set [19]. D
580
O. Burkart et al.
For any n > 1, we define the relation Kn as follows: 7^n = 7^o U7^f U {(a, P) G Teoc: Tif (a), Tif (|3) < n } . We shall compute a constant e such that TZe is complete, after which we can compute T^e n ^ and hence infer that ^ is decidable. In fact, we get a stronger result: we can construct a transducer (a finite automaton labelled by pairs of states) recognizing the bisimulation. THEOREM
54. Bisimilarity is an effective rational relation over any BPA system.
PROOF. We assume that we have our promised integer e such that Tie is complete. By Lemmas 52 and 53, we compute T^e H ^ = T^o ^ (^f H ~) U 5e, where
Se = {(a, (3): a, (3 € V N * V U , a - (3 and ni(oc), Uf (P) < e}. First we show that the set of bisimilar pairs of infinite norm is an effective rational relation. We have
- n v*VuV* X v*VuV* = ^=^nv*VuV*
x v*Vuv*
= ( i nVN*Vu X VN*VU) • (V* X V*). But ( = HVN *VU X V^4 * Vu) is the suffix derivation according to Se restricted to the recognizable relation VM *VU X VN *VU, and hence is an effective rational relation [32]. It then remains to show that the set of bisimilar pairs of finite norm is an effective rational relation. For this, we can exploit the Unique factorization theorem 21. Let Vp C Vjsj be the set of all primes without repetition up to ^ ; that is, for every a G Visj* there is a unique |3 G Vp* such that oc -^ (3. Now take 5={(X,(x): X G V N , CXGVP*, a n d X - a } . The set of bisimilar pairs of finite norm can then be expressed as the effective rational set 5*o(5-')*. D It now remains to explain the computation of the constant e such that 1Ze is complete. A useful tool is the following divergence function: Div(a, P) = min({n: a / n P) U {oo}) = 1 + m a x { n : a ' ^ n P}An important property is that 1 /Div is an ultrametric distance. LEMMA 55.
(a) 1 ^ Div((X, P) = Div(P, oc);
Verification on infinite structures
(b) (c) (d) (e)
581
min(Div(a, |3), Div(|3, y)) ^ Div(a, y); If Div((x, (3) > Div(a, y) then Div((3, y) = Div(a, y); Ifn(oi) < n((3) then Div(a, |3) ^ 1 + n ( a ) ; If oi-^ (x! and |u| < Div(a, (3) then (3 - ^ |3' such that Div(a, (3) ^ |u| + D^v(a^ (30.
We extend Div to any binary relation R over states as follows. minDiv(R) = min{Div(a, (3): aR(3}. With this, we may now generalize Lemma 55. LEMMA
56. //cxR*a', (3R*13^ and Div(a, (3) < mirLDiv(R) then Div(a, (3) = Div(a', 130.
The above properties of the divergence function are true for arbitrary transition systems. Henceforth we consider only BPA systems, in which case the divergence function satisfies the following additional properties. 57. For every a, (3, y, 6 G V*, w^ have the following. (a) / / y - 6 then Div(a, (3) ^ Div(ay, |36) ^ Div(a, (3) + n(y) ^ Div(ya, 6(3). (b) / / a y ^ (36 and 1 < Div(a, (3) < oo r/z^n a - ^ a' and (3 - ^ (3' ^MC/Z that (x!y ^ 13'6 anJ Div(aO (30 < Div(a, (3).
LEMMA
(c) / / a i y , (3 1 6, «nJDiv(a, (3) < mirLDiv(R) then Div(a, (3) == Div(y, 6). If we can compute an integer aoc,(3 for any a, (3 such that aoc.(3 > Div(a, (3) when a 7^ (3, then we would have the basis of an algorithm for deciding ^ . In fact, we are not able to find such a bound for an arbitrary BPA system; but for any BPA system, we shall show that there exists an equivalent BPA system in a form allowing to compute such a bound. Consider any BPA system with rewrite rules P. For each a G Im(P) with n ( a ) = oc (that is, for each unnormed sequence a which appears as the right hand side of some rule of P) we associate a new variable Xoc in such a way that Xoc = Xj3 whenever a ^ (3. (This association is not effective, but we are interested only in the divergence function.) For each such variable X^ we also introduce a new label Qa. We then define a new BPA system with the following set P of rewrite rules: P = { A - ^ a : A - ^ a G P a n d n ( a )
582
O. Burkart et ai
We have^that DiVp(a, (3) ^ Divp(a, |3), but equality is not true in general. The new system P has the following restriction: each right hand side is either a normed sequence or an unnormed variable. Furthermore, Div(A, B) = 1 for every A, B G VU with A T^p B. These restrictions allow us to find an upper bound to the divergence for nonbisimilar pairs. Before proceedings, we need first to introduce some further notations. For any finite set E c V*, we let |E| denote its cardinality; max-n(E) = max{n(a): a € E}; min-n(E) = min{n((x): a e E}; max-Uf (E) = maxfrif (a): a € E}; and min-nf (E) = min{nf(a): a € E}. We shall also freely apply these max and min functions to fists as well as sets. We let Pf = {A - ^ a e P: n ( a ) < oo} be the restricfion of a system P to its rules of finite norm. Then for any a, (3 G V*, we define doc,^ =min-n(a, (3) + (|Vi\j| - 1) • max-n(lm(Pf))-f-max-n(VN). LEMMA
59. For any BPA system? and any oc,
(3GVN*,
if OC^^ then DiVp(oc, |3)^aa.(3-
Using Lemmas 55, 56 and 57, we generalize directly the construction given in [30] for simple grammars to obtain the same bound aa.^ for any BPA system in which each right hand side is either a normed sequence or an unnormed variable; and two unnormed non-bisimilar variables are of divergence one (this last condition is not strictly necessary, but without it the bound must be changed). D PROOF.
For a normed system ?,? = ?, and aa.|3 is optimal when P = V x I x {e}, in which case max-n(Im(P)) = 0 and max-n(V) = 1, so aoc.p = min(|a|, ||3|) -h 1 = Div(a, (3) whenever a 9^ |3. This bound aa,|3 on Divp(a, 3) also provides a bound on the length of a derivation of P from (a, (3) to a pair with distinct norms, and which preserves a given unification, as formulated in the following. 60. For a, |3 G VN*, if ocy ^ |36 and a / |3 then for some oc\ (3' and u with |u| < acx,(3 we have that a - ^ oc\ (3 - ^ (3', n(a') ^ n((3'), and oCy ^ (3'6.
LEMMA
PROOF. By Lemma 58, a / p (3, and by Lemma 59, DiVp(a, (3) ^ aa,(3. By Lemma 57, using induction on DiVp(a, |3), there exist two derivations
a = ai —>p a i —>y • • • —> p cxn
and
a = ftPI _ ^^p ^ P2 ft _ ^>p ^ ••• ^n-J^^paPn P such that (Xiy ^ (316 for every 1 ^ i ^ n, and Divp(ai,(3i) >Divp(a2,|32) > ••• > Divp(an, (3n) = 1In particular, n ^ Divp(a, (3) ^ Qocis. Since DiVp(arL, (3n) = 1 and a n y ^ (3n^, either a n = £ 7^ (3n or a n ^ £ = Pn, SO n ( a n ) # n((3n). Thus m = min{i: n(oci) ^ n((3i)} exists, and we t a k e u = ai...arrL-i, so |u| = m - 1 < n ^ ao(.(3. By symmetry, we may assume that n(ocra) < ^(^m)-
Verification on infinite structures
583
• If TLCPTTL) < oo, then it suffices to take a' = ocm and (3' = (3m• If n((3TTL) = oo, t h e n m > 1 and Pm-i ^ V N ^ . L e t B ^ = ( 3 ^ - 1 ; then B - ^ p p with Xp |x = Pra- Thus it suffices to take a' = oCm and |3' = p}x; in particular, a y = a ^ y -- 13m6 = Xp^6 -- p -- p^6 = (3'6.
D
If y =z 5 in the above lemma, then 6 is repetitive: 6 ~ p6 for some p ^ ^, and we can find such a p with a finite norm bounded by bniax-n(cx.|3). where bn = ( n + | V N | ) •max-n(lm(Pf)) • (max-Uf (Im(P)))^. LEMMA
61. For oc, (3 e Visj*, if ocb ^ (36 and a 7^ (3 then 6 ^ y6 /or 5om^ y 7^ £ w/r/z
PROOF. By Lemma 60, there are derivations a - ^ a' and (3 - ^ (3' such that |u| < Qa. p, n(aO ^ Ti((30 and oc'b ^ (3'5. Thus there are derivations
( a ' ^ ^ e and ( 3 ' ^ ^ y)
or
(oc^ ^ ^ y and ( 3 ' ^ ^ e)
such that |v| = min-n(a', (30 and 6 ^ y5. As max-n(VN) ^ max-n(Im(Pf)) + 1, we have that cicx.|3 - 1 ^min-n(a, (3) + |VNI •max-n(Im(Pf)). Furthermore, Tif (a') ^ n ( a ) + |u| • (max-Uf (lm(P)) - 1), nf ((3') < n((3) + |u| • (max-Uf (lm(P)) - 1), nf(y) ^ max-Uf (a , (3') -h |v| • (max-Uf (lm(P)) - 1). So rif (y) ^ max-n(a, (3) + (aa,|3 - 1) • (max-n(Im(Pf)) - 1) + (min-n(a, (3) + (acx,(3 - 1) • (max-n(lm(Pf)) - 1)) x(max-nf(lm(P)) — 1) < (max-n(a, (3) + (aoc,|3 - 1) • (max-n(lm(Pf)) - 1)) • max-Uf (lm(P)) ^ (max-n(a, (3) • max-n(lm(Pf)) + |VN I • max-n(lm(Pf)) • (max-n(lm(Pf)) - 1)) • max-Uf (Im(P)) < (max-n(a, (3) -f | V N | ) • max-n(Im(Pf)) • (max-Uf (Im(P))) = bmax-n(a,(3)-
D
We then define the integer c = bmax-n(VN)(i+max-nf(im(P))) to obtain a sequence of decreasing repetitive states.
584
O. Burkart et ah
LEMMA 62. Let b ^yb with 0 < n(y) < c and max-n(VN) < nf (6). Then there^ exist y, b and p such that b ^yb with 0 < n(y) < c and 6 ~ p6 with rif (6) = rif (p6) and 0 < n(p) < 2max-n(VM).
0 < n{y) < c, we have that y = Ay'' with A G VN . Let A - ^ £ with | u | = n ( A ) . Then 6 = 6 ' 6 ' ' - ^ yib'' such that [ib'' --Y'b where |6'| is minimal. As rif (6) > max-n(V^4) > |u|, we have that 6'' ^ e and b' e VN*. By the minimahty of |6'|, PROOF. AS
we have that 6' - ^ B - ^ |a with B = 6'(|6'|), u'u'' = u and u'' ^ e. Hence n(b') ^ |u'| + n(B) < 2max-n(VN). Furthermore, Uf (H) ^ n(B) + \u"\ • (max-nf (Im(P) + 1) < max-n(VN) • max-nf (Im(P)). We have that b'b'' = 5 - Ay''5 - A^i6''. Suppose that b' ^ A^L. In particular, ^ G VN *, and it suffices to take y = y''A, b = ^6'' and p = A: • ? = ^6'' - Y'b = Y'b'b'' - y''A^5'' = y6. • 0 < n(y) = n(y''A) = n(Ay'0 = n(y) < c. • 5 = 5 ' 6 ' ' - A^i5''= p i • Uf (5) = Tif (5'5'0 = n(6') + Uf (6'') = n(A) + n(^) -f rif (6'')= Uf (A^6'') = Uf (p?). • 0 < n(p) = n(A) ^ max-n(V]M) < 2max-n(V]M). Assume then that 6' 7^ Ajx. Then we have that 6'6" -- A^6'' with n(6') < 2max-n(VN) and n(A|x) ^ max-n(VM) • (1 -h max-Uf (Im(P))). • If ^ G VN *, then by Lemma 61, there is y such that b" ^ yb" and 'H'fCy) < t>max(2max-n(VN).max-n(VN)(l+max-nf(Im(P)))) = C.
• If n(ix) = 00, then 6'6'' -- A|j.. Let 6' - % £ with |v| = n(60. There is A^, - ^ y with b''^y^yb'\ Then nf(y) ^ nf(A^)-h |v| • (max-nf(Im(P)) - 1). Thus nf(y) < max-n(VN) • (l^max-nf(Im(P))) + 2max-n(VN) • (max-nf(Im(P)) - 1) < c. So it suffices to take 6 = y'' and p = y'. D We bound the finite norm of repetitive states with the following integer: d = 2max-n(VN)-|VNr. LEMMA
63. Let b^yb
with rif (y) < c. Then there is b ^ b with rif (5) < d.
PROOF. If n(y) = 00 then it suffices to take 6 = 6 (since c < d). Let 6 ^ y6 with n(y) < c. We may assume that rif (6) is minimal. By repeated applications of Lemma 62, there is a finite sequence (yt, 61, pt) with 1 ^ i ^ n such that • yi = y and 6] = 6; • rif(6n) ^max-n(VN); • for each 1 ^ i < n: 61 ^ yi6i and 0 < n(pi) < 2max-n(VN); and • for each 1 ^ i < n : 61 ^ pt4.i6i+i and rif (61) = rif (pi-^i 61+1). ^ Assume that yt = y j for i < j . Then 61 ~ 6j with rif (6j) < Uf (61). If 6 = P2. • •Pi6j then 6 ^ p2.. .Pi6i ~ 61 = 6 , but rif (6) = rif (p2.. .pi6i) > rif (6). This contradiction to
Verification on infinite structures
585
the minimality of 6 implies that the yt are pairwise distinct. Hence ic-l
n ^ |{y€VN*: n ( Y ) < c } | ^ l + |VNl + - - + |VNr =
(|VNl'-l)/(|VN|-l)<|VNr.
Finally TLf(6) = nf(p2...pn^n) < 2 ( r L - 1 ) • max-n(VN) + niax-n(VN) < 2nmax-n(Visi) < 2max-n(ViM) • |VN|^ = d.
D
The integer e = d + 1 + max-n(VN) • max-n(Im(Pf)) is then a suitable bound. THEOREM
64. The relation Re is complete:
RpH-
=
c = = ^ . To prove the reverse inclusion and using RQ it suffices to R n~ show that for every a, (3 € VN * U VM * Vu, if a -^ (3 then a = (3. We may also assume PROOF.
We have =
that Im(P) C VM * U VM *VU. In the sequel, we let = ^^^ =^^. The proof is carried out by induction on :< as defined in Definition 33: (a, P) :< (y, 6) iff max-Uf (a, (3) ^ maxrif (y, 6). Suppose first that max-nf (a, (3) = 0, that is, ex, (3 € Vu U {£}. As a -^ (3, either a = (3 = £, in which case a = (3; or a, (3 € Vu, in which case a(Re O ^)(3. Assume then that max-Uf (a, (3) > 0. First, let us verify the following property of normed sequences A,, p, G Visj *: (•) If |x ^ X and rif (p) < e and (X, X) < (a, (3) then p = A.. Either n{k) < oo in which case (p, A.) < (a, (3) and by the induction hypothesis p = X; or n(A.) = oo in which case either rif (X) < e so p(Re H --)>., or rif (A.) ^ e in which case (p, A.) -< (A, A,) -< (a, |3), and by the induction hypothesis p = A. Now let Aa' = a and B|3' = |3. By symmetry, we may assume that n(B) ^ n(A), so B G VN . Let B - ^ £ with |u| = rL(B). Then A - ^ y such that yoc' -- (3'. In particular, nf (y) < | u | . (max-nf (lm(P)) - 1) + 1 < max-nCVisi) • (max-Uf (Im(P)) - 1) + 1 < e. Furthermore, Aa^ ~ Bya^ Suppose n(y) = oo. Then y -- (3', and by Property (•), y = (3'. Furthermore Aa' ^ By and rif (By) ^ max-n(VM) • max-nf (Im(P)) -|-1 < e. • If A G Vu then a' = £ and hence oc = A(Re H '-)By = B|3' = (3. • If A G Visj then A - ^ £ such that |v| = n(A). Hence By - ^ a such that a' -^ a. In particular, rif (a) ^ max-n(VN) • (max-Uf (Im(P)) - 1) + rif (By) ^ 2 • max-n(VN) • max-Uf (Im(P)) < e and by Property (•), a = oc'. Furthermore, A a ~ By and rif (Aa) < max-n(VN) • (2 • max-Uf (Im(P)) + 1) < e. Hence Aa(Re n -')By. Finally, a = A a ' = A a = By = B (3' = |3.
586
O. Burkart et al.
Assume then that n(y) < oc. Then A G V N . and since n(y(x') = n(|3'), by induction, ya! = (3'. Furthermore, n(y) ^ |u| • (max-n(Im(Pf)) - 1) + 1 ^ max-n(VN) • (max-n(Im(Pf))-l) + l. • If A - By then A(Re n - ) B y . Hence a = A a ' = By a' = B(3' = (3. • If A / B y then Aa' ^ Byoc'. By Lemma 61, a' ^ ha' for some 6 with nf(6) < bmax^(A,By) < c. By Lemma 63, (x! -^ h for some 6 with rif (6) < ^ . By Property (•), (x! = 6. Furthermore, A6(Re H '^)By6, since A6 ^ By6 with rif (A6) < e and TLf ( B y ^ < max-n(VN) + n(y) 4- d ^ max-n(VN) • max-n(Im(Pf)) -f 1 -f d = e. Finally, a = Aa' = A ? = B y ? = Bya' = B|3' = (3.
D
Although we have a direct decision procedure to decide bisimilarity for any BPA system, the complexity is not polynomial: constant e is exponential in the size of the system. A close analysis would demonstrates that the complexity of the underlying algorithm is in fact doubly exponential in the size of the BPA system.
2.4. Undecidability results for MSA In this section we outline Jancar's technique [83] for demonstrating undecidability results for bisimilarity through mimicking Minsky machines in a weak fashion but faithfully enough to capture the essence of the halting problem. Jancar first employed his ideas to demonstrate the undecidability of bisimulation equivalence over the class of Petri nets. Hirshfeld [66] modified the argument to demonstrate the undecidability of trace equivalence over BPP. Jancar and MoUer [88] then used the technique to demonstrate the undecidability of regularity checking of Petri nets with respect to both simulation and trace equivalence. In the following we generalize Jancar's result by demonstrating the undecidability of (normed) MSA. Jancar's technique applies ideally in this case, as MSA offer precisely the ingredients present in Petri nets which are needed to mimic Minsky machines. Minsky machines [117] are simple straight-line programs which make use of only two counters. Formally, a Minsky machine is a sequence of labelled instructions Xo X]
: comiTio, : coinini,
Xn-1 Xn
:comm^_i, :halt,
where each of the first n instructions is either of the form X£: Co := CO + 1; g o t o Xj
or
X^ : ci := ci H- 1; g o t o Xj
Verification on infinite structures
587
or of the form X£ : i f Co = 0 t h e n g o t o Xj or e l s e Co := co — 1; g o t o Xic
X^ : i f c i = O t h e n g o t o Xj e l s e ci := ci — 1; g o t o X]c
A Minsky machine M starts executing with the value 0 in the counters co and ci and the control at the label XQ. When the control is at label X^ (O^i
we have the MSA rules p^Z—'^PjbZ
and
q^Z—'^qjbZ.
• For each machine instruction X£ : i f Cb = 0 t h e n g o t o Xj e l s e Cb := Cb — 1; g o t o X]c we have the MSA rules p^b-^pic
p^Z-^pjZ
p^b^>qjb
q^b-^qic
q^Z-^qjZ
q^b^>pjb
• We have the one final MSA rule . ..Z
cu
^ Vn
The two states poZ and qoZ of this MSA each mimic the machine M in the following sense. • When M is at the command labelled X^ with the values x and y in its counters, this is reflected by the MSA being in state peO'' 1 ^ Z (or q^C" 1 ^ Z). • If this command is an increment, then the MSA has only one transition available from the control state p£ (q^), which is labelled by i (for 'increment'), resulting in the MSA state reflecting the state of the machine upon executing the increment command.
588
O. Burkart et al.
• If this command is a successful test for zero (that is, the relevant counter has the value 0), then the MSA has only one transition available from the control state p^ (q^), which is labelled z (for 'zero'), again resulting in the MSA state reflecting the state of the machine upon executing the test for zero command. • If this command is a decrement (that is, a failed test for zero), then the MSA in control state p£ (q^) has three possible transitions, exactly one of which is labelled d (for 'decrement') which would once again result in the MSA state reflecting the state of the machine upon executing the decrement command. • In this last instance, the MSA has the option to disregard the existence of a relevant counter symbol in the stack and behave as if the program counter was zero. This reflects the weakness of Petri nets (and hence MSA) in their inability to test for zero (a weakness which works in their favour with respect to several important positive decidability results such as the reachability problem [106]). In this case, the MSA in control state p^ (q^) may make a z transition in either of two ways: either by "honestly" cheating using the rule p^Z ^ > pjZ (q^Z - ^ qjZ), or by "knowingly" cheating using the rule p^b -^ qjb (q^b - ^ pjb) thus moving the control state over into the domain of the other MSA mimicking M. FACT
65. poZ ^ qoZ ijfthe Minsky machine M. does not halt.
PROOF. If M. halts, then a winning strategy for player I in the bisimulation game would be to mimic the behaviour of M in either of the two MSA states. Player IPs only option in response would be to do the same with the other MSA state. Upon termination, the game states will be ^nO^^^Z and qnO^l^Z for some values x and y. Player I may then make the transition \>nO^^^Z - ^ PnO^^l^ which cannot be answered by player II from the state qnO^l^ Z. Hence poZ and qoZ cannot be bisimilar. If M fails to halt, then a winning strategy for player II would be to mimic player Fs moves for as long as player I mimics M, and to cheat knowingly or honestly, respectively, in the instance that player I cheats honestly or knowingly, respectively, so as to arrive at the situation where the two states are identical; from here player II can copy every move of player I verbatim. Hence X^QZ and qoZ must be bisimilar. D
We thus have undecidability of bisimulation equivalence over a very restricted class of Petri nets: those with only two unbounded places and a minimal degree of nondeterminism. Note that this nondeterminism is essential: Jancar [83] shows that bisimulation equivalence is decidable between two Petri nets when one of them is deterministic up to bisimilarity. The above MSA can be made into a normed rewrite transition system by adding a new input symbol n along with the following MSA rules (one for each i = 0...n and each X = Z,0,1). Vt^^^Vt . . —> o^i
q^X-% q^ q^X—>vt
These moves allow the MSA to exhaust its stack at any point during its execution, and continues to allow player II to produce a pair of identical states if player I elects to take
Verification on infinite
589
structures
one of these non-M-mimicking transitions. The same argument can then be made to show that poZ and qoZ are bisimilar exactly when the Minsky machine M does not halt. THEOREM
66. Bisimilarity is undecidable over the class ofnormed MSA.
This result contrasts with that of Stirling [137] regarding the decidability of bisimilarity over the class of normed PDA.
2.5. Summary of results The tables in Figures 2 and 3 summarize a variety of decidability and algorithmic results for bisimulation problems over several classes of infinite-state systems, many of which being as described above, as well as give pointers to where to find these results in the literature. The first column of the first table lists results regarding bisimilarity as discussed in this chapter; the second column lists results regarding the problem of comparing a system to a finite-state system; and the third column lists results regarding the regularity problem, determining if the system is equivalent to some unspecified finite-state system. The second table presents the same collection of results, but this time in relation to weak bisimulation equivalence. To define weak bisimilarity, we assume that there is some label T which represents an unobservable transition label, and we define a new transition relation =^ by:
^^
-FSA
^-regularity
2EXPTIME[23]
BPA
PTIME in the normed case [701 decidable[134]
PDA
PSPACE-
BPP
hard[1121 decidable [36] co-NP-hard[lll] PTIME in the normed case [71]
PTIME [99] EXPTIME [86] PSPACE-
hard[112]
2EXPTIME [24]
PSPACE-
hard[112]
PSPACE [86]
decidable [55] co-NP-hard[lll]
decidable [86]
co-NP-hard[lll]
decidable [55]
decidable [55]
CO-NP-
PA
hard[lll] decidable in the normed case [681
PN
undecidable [84]
EXPSPACE-
EXPSPACE-
hard[1121
hard[112]
Fig. 2. Results for bisimilarity.
590
O. Burkart et al.
^FSA
'^ BPA
1 PSPACEhard[139]
PDA
PSPACE-
BPP PA PN
^-regularity
?
PTIME [99] EXPTIME [86] PSPACE
hard[139]
-hard [112]
NP-hard[139] n^-hard[lll] 1 PSPACEhard[139] undecidable [84]
PSPACE
-hard [112]
PSPACE [86]
n^-hard[lll]
decidable [86]
n^-hard[lll]
undecidable [55]
undecidable [55]
Fig. 3. Results for weak bisimilarity.
=> = —> , and for a 7^ T, =:^ = —^ • - ^ • —^ . Then the definition of weak bisimilarity is the same as for bisimilarity except using this new transition relation =^ in place of the original -^ relation. One-counter automata and one-counter nets. The discussion of equivalence checking in this chapter only touches the surface of this vast topic, and many related studies have been carried out which consider other classes of systems and other equivalences. In particular, there has recently been extensive work done on one-counter automata and one-counter nets, for both bisimulation equivalence and simulation preorder/equivalence. A simulation relation is defined as a "one-sided" bisimulation relation, in the sense that we omit the second clause in Definition 9, and in the third clause we only demand that (3 be a final state whenever a is, but not vice versa. We then say that a is simulated by (3 if the pair (a, (3) is contained in some simulation relation; that is, the simulation preorder is defined to be the union of all simulation relations (and hence the largest simulation relation). Finally, two states are simulation equivalent if they simulate each other. The first relevant result is that of Jancar [85], demonstrating that bisimulation equivalence, as well as the regularity problem with respect to bisimilarity, are decidable for one-counter automata. Although this is subsumed by the later result of Senizergues [132], the technique used by Jancar in his proof of the special case is elegant, employing novel ideas involving representing bisimilarity as a colouring of the plane and demonstrating the existence of a periodicity which can be detected. Abdulla and Cerans [1] recently outlined an extensive and technically-challenging proof of the decidability of the simulation preorder for one-counter nets. This result was subsequently given a concise and intuitive proof by Jancar and Moller [89], again using colourings of the plane. For the shghtly wider class of one-counter automata, Jancar, Moller and Sawa [91] demonstrate the undecidability of simulation equivalence, and hence also simulation preorder; for the equivalence problem, we can even assume that one of the automata is de-
Verification on infinite structures
591
terministic, and for the preorder, we can assume that both are deterministic. Contrasting with these results are, firstly, the decidability of the equivalence problem for deterministic one-counter automata, a result which can be extracted from the early results of Valiant and Paterson [143]; and secondly, the recent result of Jancar, Kucera and MoUer [87] that equivalence is decidable between a deterministic one-counter automaton (in fact, a deterministic PDA even) and a one-counter net. Finally, it is also demonstrated in [87] that the regularity problem for one-counter nets with respect to simulation equivalence is decidable. (The corresponding problem is undecidable for both Petri nets [88] and PA [98].) This proof is carried out by presenting an elegant general reduction from simulation problems over one-counter nets to bisimulation problems over one-counter automata, and then exploiting the original result of Jancar [85].
3. The model checking problem In this section we survey the state-of-the-art in model-checking infinite-state systems. Again, we concentrate exclusively on discrete infinite-state systems and neglect, e.g., dense infinite-state structures related to timed or hybrid systems, which are covered, for instance, in [3] and [2]. Due to the broad scope of existing model checking algorithms, we have chosen to sketch only the main ideas behind the relevant results complemented by appropriate references: for decidable model checking problems we briefly present the developed algorithms together with their complexity; for undecidable problems, we outline the undecidability proof. This style of presentation is intended to provide readers interested in more technical details with access to the original papers, and ensures at the same time that the survey remains readable for those who wish only to glance over the research done in this area. The remainder of this section is organized as follows. We briefly introduce in Section 3.1 the temporal logics we consider together with their branching and linear time classifications; this introduction can be deepened by consulting Chapter 4 in this Handbook [17]. We then proceed by presenting decidability and complexity results about model checking for various classes of infinite-state systems, first for branching time logics in Section 3.2, and subsequently for linear time logics in Section 3.3. The presentation is organized according to the two central parameters of the model checking problem: • the size of the representation of the transition system; and • the size of the temporal formula. This allows us to distinguish three different complexities: • the general case; • the case where the formula is fixed; and • the case where the system is fixed. As in practice the size of the formula is usually very small compared to the size of the system representation, we focus on the first two cases here and neglect the last one in our complexity considerations.
592
O. Burkart et al
3.1. Temporal logics A successful approach to the verification of programs relies on a suitable formalism for specifying central aspects of the intended system behaviour. In the case of sequential programs where the input/output behaviour together with termination plays a predominant role such formalisms are traditionally based on state transformer semantics. In fact, sequential programs are typically verified by considering their (partial) correctness, specified in terms of pre- and postconditions [58]. Reactive systems, on the other hand, are typically nonterminating, as they maintain an ongoing interaction with the environment. Hence, verification methods which rely intrinsically on the existence of a final state are, usually, not applicable and must be replaced by radically different approaches (see [100] for a survey). Pnueli [127] was the first to recognize the need for formalisms which support reasoning about nonterminating behaviour. He proposed the use of temporal logic as a language for the specification of concurrent program properties. Temporal logics are tailored to expressing many important correctness properties characteristic for reactive systems, in particular, liveness properties which assert that something will eventually happen. Since Pnueli's landmark paper a plethora of systems of temporal logic have been investigated concerning their expressiveness and suitability for verification purposes. The majority and better known of these logics belong to the class of point-based, future-tense, and propositional logics. In this survey we will also focus on this class, while elaborating on the differences between branching-time logics and linear-time logics. The reader interested in technical details beyond this exposition is advised to consult [120] and Chapter 4 in this Handbook [17]. Within their respective spectra, branching and linear-time logics can be classified according to their expressive power. Figure 4 shows the respective hierarchies of temporal logics we will consider in the following. In this figure an arrow Li -> L2 indicates that the logic L2 is strictly more expressive than the logic Li. Due to their difference in expressive power the various logics have also different importance for verification purposes. The weakest logics, Hennessy-Milner logic and weak linear-time logic, can only express properties about a finite prefix of a system, and play consequently only a minor role in themselves. They constitute, however, the basis for the more expressive logics and possess some interesting theoretical properties. Most importantly, for finite-branching processes, i.e., for processes where each state admits only finitely many transitions, it is known that two processes are bisimulation equivalent iff they satisfy the same set of Hennessy-Milner logic formulae [65]. To increase the expressiveness of these basic logics, which require infinite sets of formulae for characterizing infinite behaviour, the addition of the "until" operator has been proposed which can express that a property 4) should hold until a second property \|; holds. On the branching-time side this leads to Computation Tree Logic (CTL) [40], while on the linear-time side this yields Linear Temporal Logic (LTL) [127]. Since both logics arise quite naturally and can express practically relevant properties they are widely used in tools for automatic verification. But even the logics EF and EG, complementary fragments of CTL, have stirred up some interest. They both have been successfully used to clarify the borderline between decidability and undecidability, as well as to establish lower complexity bounds for model checking various classes of
593
Verification on infinite structures Branching-Time
Linear-Time
modal mu-calculus alternation-free modal mu-calculus
Imear-time mu-calculus
Hennessy-Milner logic
Weak LTL
simple-PLTL^
Fig. 4. Branching and linear time logics. infinite-State systems. The logic UB is simply the smallest common generalization of EF and EG. Even more expressive temporal logics are obtained by adding least and greatest fixpoint operators to the basic logics. This extension results in the branching-time modal ^-calculus and the hnear-time |x-calculus. Both fixpoint logics play a central role in the theory of model checking due to their syntactic minimality and their pleasing mathematical properties. Accordingly, we will present both logics together with their respective model checking algorithms in greater detail. All the logics mentioned so far have in common that they may express only regular properties. This means that in the branching-time setting the set of states, respectively in the linear-time setting the set of traces, satisfying a given property form regular sets. Whereas the meaning of regularity is clear for traces, regular sets of states need to be explained: a state in a transition system characterizes a tree, and for trees regularity is well-defined [128]. There have, however, been extensions proposed which incorporate nonregular features like counting. The most prominent examples are Presburger Computation Tree Logic (PCTL) [11] which combines CTL with Presburger arithmetic, and Constrained Linear Temporal Logic (CLTL) [10], which enhances LTL by Presburger arithmetic and constraints expressed by finite-state automata. Despite the fact that both logics in their general form are undecidable already for finite-state systems, decidability can be regained for nontrivial fragments.
594
O. Burkart et al
For the following formal introduction of characteristic temporal logics let T = («S, I , -^) be a labelled transition system without start and final states, I*, resp. I ' ^ , denote the set of finite, resp. infinite words over I , and I ^ =df I* U I ^ . Moreover, given a word (T = ai a2 ... € I ^ , (J{1) will denote the first action of a, i.e., a\, and a^ the word a2a3.... A path n — s^ - ^ si - % • • • in T is a finite or infinite transition sequence such that Si —V si+i, for all i, is in the transition relation. By n{i) we denote its i-th state si, whereas TO- denotes the part of TT starting at Si. Moreover, we denote by 7r(l-) its first state, and, if n is finite, by n{-\) its last state, respectively. A run is a maximal path, i.e., a path that is either infinite or terminates in a state without successors. Furthermore, we denote by pathsCi*) the set of paths starting in s, while r u n s ( s ) will denote the set of runs starting in s. The set of finite paths from s is written p a t h s * ( s ) . Finally, we write p r e f s(7t) for the set of finite prefixes of the path n. 3.1.1. Branching-time logics. The main characteristic of branching-time logics is that they model the potential of possible futures in a tree-like structure: each moment in time has at least one, but may have even infinitely many possible successor moments. Together with the temporal order on moments in time, this structure therefore defines infinite trees, which, in a natural way, correspond to computation trees of concurrent processes. Consequently, formulae of a branching-time temporal logic can be conveniently used to loosely specify the behaviour of concurrent systems according to their structural operational semantics. Moreover, as many process algebras assume a set I of observable actions, modal operators of branching-time logics often quantify over action-labelled transitions allowing to specify which property should hold after a specific action has been observed. Hennessy-Milner Logic (HML). The weakest branching-time logic is Hennessy-Milner logic [65], built out of "true", negation, conjunction, and the relativized existential next operator (a). Formally, formulae have the following syntax: ( t ) : : = t t I-4)1(1)1 A (f)2 1(a)(1), where a is an action of I . As is characteristic for a branching-time logic, the semantics [(j)]-^ of a formula ^ is defined with respect to a labelled transition system T, and denotes the subset of the set of states S for which the formula holds. In particular, for formulae of Hennessy-Milner logic the semantics is defined inductively as follows: I t t l ^ =df 5, I-(t>F =df S - I(t)]|^,
1*1 ^^if l{a)^'f
=df Ict)iFni(t)2F, =df {s G 5 I 3s' G S.s ^ > s and s' € |[(t)F}.
Instead of s G l^\^ we also write s f= (f). To ease the notation further, the dual notions false, disjunction and universal next operator are defined using the standard abbreviations f f =df - t t ,
Verification on infinite structures
595
ct>l V(t)2 =df -•(•-'4>1 A-^4)2),
[a](t) =df -^(a>-'(l). Under the customary assumption that atomic propositions are closed under negation, these abbreviations allow us to transform every formula of Hennessy-Milner logic into positive normal form, i.e., an equivalent formula without negation, by driving negation inwards. From a conceptual point of view Hennessy-Milner logic is easy to deal with as validity of a formula at a state s may readily be checked for any process whose computation tree is finite-branching, i.e., has only a finite number of alternatives for each observable action. It simply suffices to investigate the computation tree of the labelled transition graph under consideration up to depth |(j)|, where |(j)| denotes the size of (j) defined in the usual way by counting the number of operators. The logics EF, EG and UB. The logic EF [50] is obtained from Hennessy-Milner logic by adding the operator EFcf), meaning *'there exists a path such that eventually (j) holds". This addition increases the expressive power of the logic significantly, as it becomes possible to reason about paths of arbitrary length. In fact, it already suffices to express the practically relevant reachability properties and the practically even more important dual invariance or safety properties: -"EFct) expresses that a state satisfying a certain undesirable property (}) cannot be reached. The addition of the operator EGcj) to HML, meaning "there exists a path such that 4) always holds" yields, symmetrically, the logic EG, which allows to express inevitability properties, e.g., -iEG(|) means that the considered system is guaranteed to eventually violate property (j). The combination of the logics EF and EG yields the obviously even more expressive Unified System of Branching-Time Logic (UB) [7]. Formally the semantics of the operators EF and EG are given as follows: lEFcJ)]^ =df {s G 5 I 371G p a t h s * ( s ) . 7i(H) G | [ 4 ) F } , [EGct)]^ =df {s G iS I 37T G r u n s ( s ) . VTT' G p r e f s(7r). 7r'(H) G |[(J)1^}. Both operators have also a dual operator which in the case of EF is defined as AGcj) =df -'EF->(|), and in the case of EG as AFcj) =df -'EG--(1). Intuitively, they express properties of the form "always in the future (j) holds" and "eventually in the future (j) holds". Finally, a useful complexity measure for formulae in EF, respectively EG, is their nesting depth which measures the nesting of EF, respectively EG operators. Computation Tree Logic (CTL). Computation Tree Logic (CTL) [40] is one of the earliest proposed branching-time logics. It can be considered as the branching-time counterpart of Linear Temporal Logic (LTL) [127], which was proposed earlier and which will be introduced in the next section. CTL adds to Hennessy-Milner logic an until operator which is either existentially quantified E[(t) U ^ ] or universally quantified A[(t) U ^ ] - The formal semantics of the new operators are as follows. [[E[(t) U^l>]f =df {s G <S I 37t G p a t h s * ( s ) . V TI' G p r e f s(7r), [n' ^n^n{-\) G l
596
O. Burkart et al
[[A[(t)U^l>]]^ =df {s€<SV7rGpaths*(s).V7r'Gprefs(7i). (TT' ^ TT => 7r^(H) e l^f)
A 7t(H) G l^\>f].
Intuitively, E[(|) U ^ ] means that there exists a path on which (|) holds until, eventually, \|; holds, while A[(t)Utl>] expresses that on all paths (j) holds until, eventually, ^\> holds. The until operators are expressive enough to encode both EF and EG by means of the following formulae. EF(l) = E[ttU(t)],
EG(t) = - A [ t t U - ( f ) ] .
As a consequence, CTL subsumes the logic UB. An example that demonstrates the practical applicability of CTL is the specification of the alternation bit protocol, a well-known communication protocol for exchanging messages between a sender process and a receiver process. The alternation bit protocol could be specified by the CTL formulae AG(RcvMsg =^ A[RcvMsgU(-^RcvMsg A A[--RcvMsgUSndMsg])]), AG(SndMsgASndO^ A[SndMsgU(-'SndMsg A A[-'SndMsgU(RcvMsg A RCVO)])]),
AG(SndMsgASndl^ A[SndMsgU(-'SndMsg A A[--SndMsgU(RcvMsg A Rcvl)])]) taken from [41]. The formulae express the fact that sending a message (SndMsg) strictly alternates with receiving a message (RcvMsg), and that if a message with bit 0 (SndO), resp. with bit 1 (Sndl), is sent, then a message with bit 0 (RcvO), resp. with bit 1 (Rcvl), is received. The modal \i-calculus. The modal ^-calculus as introduced by Kozen [97] is one of the most powerful branching-time logics found in the literature. Based on mathematical fixpoint theory, it combines standard modal logic with least and greatest fixpoint operators. Similar to the A-calculus for functional languages, and due to the extreme power of the fixpoint operators, on the one hand it allows us to express very complex (temporal) properties within a sparse syntactic formalism, while on the other hand, due to its syntactic minimalism, it also provides a good basis for the conceptual study of numerous theoretical intricacies which have attracted a lot of research. However, there is a price to be paid for these properties: even for experts, it is often hard to understand the meaning of a one-line ^L-calculus formula. This is the reason for practitioners to prefer syntactically richer and less expressive derived logics. The |a-calculus is nevertheless also practically relevant, as it provides a convenient "assembly language" for temporal logics. The main characteristic which distinguishes the modal |a-calculus from most other branching-time logics is the possibility to specify recursive properties, which adds tremendous expressive power. Keeping in mind that the semantics of branching-time formulae are subsets of the state set *S, such recursive properties can be viewed as equation systems which have to be solved over Although, in general, several solutions may exist there are two prominent solutions with respect to the subset ordering on state sets, namely the
Verification on infinite structures
597
smallest and the largest ones. Due to a theorem of Tarski [140], their existence can be guaranteed whenever the equation system satisfies an easily verifiable monotonicity condition. The desired solution can then be expressed by means of a least or greatest fixpoint operator, where |xX.(|)(X), resp. yX.^(X), denotes the smallest, resp. greatest, solution of X = (t)(X). More formally, the modal ^-calculus is an extension of Hennessy-Milner logic which introduces a (countable) set of variables Var, and a least fixpoint operator [iX.(\) binding X in (j). Its semantics is defined with respect to a valuation V mapping variables to subsets of <S. To ensure the above-mentioned monotonicity condition, it is customary to impose the syntactic restriction for expressions \iX.(^ that any occurrence of X in 4) must occur within the scope of an even number of negations. The semantics for variables and the least fixpoint operator are then given as follows, where V[X \-^ £] is the valuation obtained from V by updating the binding of X to £^. IXJ^ =df V(X), I^X.ct)!^ =df n{£^S\
|[(t)]lv[XH>^] ^ ^ } -
The notions of bound and free occurrences of variables are defined in the usual way, and a formula is said to be closed if it does not contain any free variable occurrence. Using negation, it is possible to introduce also the greatest fixpoint operator vX.c]) by A.X.(t)=df-^X.-(t)[-X/X],
where (1)[-'X/X] denotes the simultaneous replacement of all free occurrences of X by -^X. The semantics of A^X-CJ) can also be defined directly by
l^XMv
=df U{£ c 5 I c 14)1 J^XK.^]}-
The clauses for the fixpoints are reformulations of the characterization in the TarskiKnaster theorem [140] which states that the least fixpoint is the intersection of all prefixpoints and the greatest fixpoint is the union of all post-fixpoints. The fixpoint property also ensures that states satisfy a fixpoint formula iff they satisfy the unfolding of the formula, i.e., s G IdXMv
iff s € [[(t)[(TX.(t)/X]|J,
where a e {^,A^}.
The following encoding of the until operators
A[4)U^^] ^ [ix.^\> V (4) A (AaGz[a]X)) shows that the modal |x-calculus is strictly more expressive than CTL. Formulae resulting from such a translation are rather special as they possess only one sort of fixpoint, namely minimal fixpoints. The modal |j.-calculus, however, permits users to write formulae containing alternating intertwined fixpoint operators, i.e., formulae like the following.
598
O. Burkart et al
which intuitively simply requires the existence of an infinite a-path on which the atomic proposition P is guaranteed to hold infinitely often. 00 =^X.(^Y.((a)Y V (P A (a)X))). Here it is characteristic that a fixpoint expression for a variable X contains another fixpoint expression of the other kind (e.g., greatest instead of least), which itself contains X free. Formulae with such alternations are not only hard to understand, but also hard to check algorithmically: already for finite-state systems, the best known algorithms are exponential in the so-called alternation depth which is defined as follows [123]. DEnNlTlON 67 {Alternation depth). A formula 0 is said to be in the classes I Q and WQ iff it contains no fixpoint operators. To form the class In+i» take I n U TTn, and close under (i) Boolean and modal combinators, (ii) \\X.
Verification on infinite structures
599
Presburger Computation Tree Logic (PCTL) which extends a propositional version of CTL with counting constraints on actions expressed by Presburger arithmetic formulae. More formally, CTL is extended with state formulae TT, i.e.. Boolean combinations of atomic propositions, Presburger arithmetic formulae f, existential quantification over integers written as 3x.<^, and a binding operator [x : 7i\.(p. The binding operator associates the variable x with the state formula TT, and starting from the current state the variable x then counts the number of states satisfying n. These new constructs permit to specify, for example, typical communication protocol properties like ''between the beginning and the end of every session, there are exactly the same numbers of requests and acknowledgements'" [11] by the PCTL formula AG (BEGIN =^ [x : REQ].[y : ACK].AG(END =^ (x = y))). It has turned out, however, that PCTL is too expressive for automatic verification purposes, as it is undecidable already for finite-state systems. The authors therefore also introduce the fragment PCTL+ which differs from PCTL in that the until operators must be of the restricted form E[7rUct)] and A[(t)U7r] where n is required to be a state formula. Despite this syntactic restriction, PCTL^ is still quite expressive and contains, e.g., the formula given above. Moreover, it is decidable for BPA. 3.1.2. Linear-time logics. In contrast to branching-time logics, linear-time logics assume that at each moment in time there is only one determined possible future. This point of view concerning the semantics of time leads immediately to models where the semantic entities are sequences of events along a single time line, called runs. Depending on whether the underlying program structures may or may not contain deadlocks, i.e., states in which no further action is possible, these semantic models then either take into consideration both the finite, as well as the infinite runs, or restrict themselves to the infinite runs only. In either case, formulae of a linear-time logic are then interpreted over the set of all (considered) runs, and the semantics [(()] of a formula (j) is the set of all runs n for which the formula holds, i.e., [c))] = {n\n\=(^}. Also in the case of linear-time logics, for system verification one is typically interested whether a specific state satisfies a certain property. This led to the following convention: a state s of a transition system satisfies a formula if every run starting at s satisfies it. In the following we introduce the linear-time logics most relevant for the study of infinite-state systems. For a better comparison with branching-time logics we will focus on action-based linear-time logics which have relativized next operators, one for each possible action. Weak Linear Temporal Logic (WL). The weakest linear-time logic, called WL, is built in analogy to Hennessy-Milner logic out of true, negation, conjunction, and a relativized
600
O. Burkart et ai
next operator (a)4), one for each action a € I . Formally, WL formulae have the following syntax. (t>::=tt\-'(t)\(i)^
A (|>2 I (a)(t>.
The inductive definition below stipulates when a run n has the property (J), written as 7t|=(t). TThtt, 71 \= ->(p
if 71 f= (t) does not hold,
7t^=(t)i A 4)2 71 f= (a)(1)
if7r^4^i and 71 [=(1)2, if 71(1) - ^ 7r(2) A 71^ h= 4>-
Intuitively, a run satisfies (a)(1) if its first action is a, and the suffix run obtained after chopping off the first state and the first action satisfies (^. Like for HML, we would like to remark that WL is mainly of theoretical interest due to its limited expressive power which only captures finite behaviour. In particular this means that the validity of a formula may readily be checked independently of the type of the considered (finite-branching) system by investigating all runs up to length |(1)|. Linear Temporal Logic (LTL). Linear Temporal Logic (LTL) [127] can be seen as the "standard" linear-time logic. It is widely used in tools for automatic verification of reactive systems [105]. Similar to CTL, LTL is obtained by adding to WL an until operator (1) U ^ . This extension increases the expressive power significantly, as it admits to reason about runs of unbounded length. The formal semantics of the until operator is given as follows. 7r 1= 4) Uij)
if 31: 71^ 1= \|) and Vj
Intuitively, a run SQ - ^ si - ^ • • • satisfies 4>U4> if 4^ holds until eventually \\) holds, i.e., if there exists some suffix si - % st+i ^ ^ • • • satisfying \\), and all preceding suffixes Qj
Clj + 1
Sj —> Sj+1 —> • • • with j < i satisfy 4>It is convenient to use the derived operators F4) = t t U 4^ ("eventually 4^") and its dual G4) = -'F->4) ("always 4>"). They directly and concisely express simple liveness properties like "4) eventually happens" as F4), and simple safety properties like "4) never happens" as G-i4).
Despite its expressive power, there are, however, comparatively basic properties like "at every even moment 4> holds" that cannot be expressed in LTL [146]. The reason for this inability becomes clear when switching to a formal language point of view. Obviously, the set of runs which satisfy a given LTL formula can also be interpreted as a formal a)-language, i.e., as a set of infinite words. Thomas [142] has shown that the LTL definable a)-languages correspond to the class of star-free cu-regular languages, an interesting subclass of the cu-regular languages which results from restricting the monadic second order logic over infinite words (SIS) to first-order logic. Because of this lack of expressiveness of LTL, various more expressive logics have been studied, most notably the linear-time |j.-calculus which we consider next.
Verification on infinite structures
601
The Linear-Time [i-Calculus (LT\i). The linear-time \i-calculus [144] is the linear-time analogue to the modal |i-calculus: it is a powerful fixpoint logic in which all the usual linear-time operators like "always", "eventually", and "until" can be described. In particular, the logic is equivalent in its expressive power to Buchi automata [144,47], and hence also to monadic second order logic over infinite words (S1S) [ 18]. Consequently, the lineartime |x-calculus characterizes the full class of tu-regular languages and is thus strictly more expressive than LTL which may only describe star-free cu-regular languages. This expressiveness is gained from adding variables to WL, together with a least fixpoint operator fxX.cj), which binds the variable X. In order to ensure vital monotonicity properties, X is only allowed to occur in ^ within the scope of an even number of negations. The formal development proceeds structurally similarly as in the branching-time case. The semantics of the linear-time |j.-calculus is defined with respect to a valuation V mapping variables to sets of runs. The denotations for variables and the fixpoint operator are inductively defined by the following rules, where 71 denotes the set of all runs of a given labelled transition system. |[X]|v
=V(X),
I^X.4)]v = n { ^ c 7^ I R c I(t)lv[R^x]}. Monotonicity arguments guarantee that [[|xX.(|)]v is the least fixpoint of the function which assigns to a set R of runs the set |[(t)]v[RH^xj- Dual operators can be defined just as in the branching-time case, allowing to transform every formula into positive normal form, which is very convenient for verification purposes. Finally, the alternation depth of \JL\X. formulae is defined as for the modal |a-calculus. From a semantic point of view, there is, however, an important difference, as alternation depth does not yield a hierarchy of strictly more expressive sublogics. This follows from the fact that LTfx is equally expressive as Biichi automata, and a Biichi automaton can be encoded by an VI\i formulae of alternation depth at most two [124]. Constrained Linear Temporal Logic (CLTL). The most expressive linear-time logic considered here is Constrained Linear Temporal Logic (CLTL), which was introduced in [10]. In analogy to PCTL (see Section 3.1.1) it allows to define nonregular properties, i.e., properties which characterize nonregular sets of runs, and that are therefore not definable by finite-state cu-automata. This expressiveness is achieved by extending LTL with two kinds of constraints: counting constraints, which use Presburger arithmetic formulae to express constraints on the number of occurrences of events, and pattern constraints, which use finite-state Rabin-Scott automata to impose structural constraints on runs. More formally, LTL is first extended with state formulae TT, i.e.. Boolean combinations of atomic propositions. Counting constraints are then introduced, as in the case of PCTL, by Presburger arithmetic formulae f, existential quantification over integers written as 3x.<^, and a binding operator [x : n].(p. Through the binding operator the variable x is associated with the state formula TT, and from the current state on the variable x then counts the number of states satisfying n. For example, the formula [XI : 7 n ] . [ x 2 : 7 t 2 ] . G ( P = ^ ( x i ^ xz))
602
O. Burkart et al.
specifies the property that in every computation starting from the current state we have the invariant "whenever P holds, the number of states satisfying nj is greater or equal than the number of states satisfying TII ". Finally, pattern constraints are introduced using formulae of the form | u.cp, and A^ where A is a deterministic finite-state automaton. The intended meaning is that a formula i u.(p associates the current state with the position variable u, and if A^ is a subformula of (p, then A^ holds whenever the trace of the computation from the state u to the current state is accepted by the automaton A. For instance, the formula i u.[xi : TTi ].[X2 : 712].G(A'' =^ (xi ^ xz)) means that in every computation starting from the current state which is accepted by A, the number of states satisfying nz is greater than or equal to the number of states satisfying TTI . As in the branching-time case, already for finite-state systems this combination of counting and pattern constraints yields undecidability. On the other hand, two important fragments of CLTL which still allow us to specify a wide range of nonregular properties while retaining decidability have been identified: C L T L Q , where counting constraints cannot be introduced in eventuality formulae, and the less expressive simple-PLTLo, which extends LTL with counting constraints, where only propositional formulae may be used in eventuality formulae. C L T L Q , and therefore also CLTL, are strictly more expressive than LTL, since, e.g., the typical property of runs "every finite prefix contains at least as many a actions as b actions" is expressible in CLTLQ but not even in the linear-time }a-calculus. On the other hand, simple-PLTLn is incomparable to LTL, but allows us to express the complement of simple cu-regular languages, which are cu-languages definable by a finite-state Buchi automaton where every loop in its transition graph is a self-loop.
3.2. Algorithms for branching-time logics In the branching-time setting we have to distinguish two rather different situations. First, for sequential type infinite-state systems like BPA, PDA and some extensions thereof monadic second order logic (MSOL) is known to be decidable by a comphcated reduction to the emptiness problem for regular languages on trees definable in monadic second order logic with n successors (SnS) [122]. As a consequence, the modal ^-calculus which can be strictly embedded in MSOL is also decidable, and may thus be used effectively for the specification of properties for these systems. A drawback is, however, that all decision procedures based on this approach are nonelementary. To palliate this problem in the last years some simpler and more direct algorithms have been developed which will be presented in Section 3.2.1 and 3.2.2. Second, for infinite-state models of concurrent computation like BPP, MSA, or Petri nets already the weak logic EG is undecidable [56]. This is mainly due to the possibility of these models to describe grid-like structures, an easy cause of undecidability. The only positive result for this class of infinite-state models concerns the logic EF and the process class BPP [52] which turn out to impose a PSPACE-complete model checking problem [107,109].
Verification on infinite structures
603
3,2.1. BPA Hennessy-Milner logic. Since BPA processes are finite-branching, model checking HML is trivially decidable. As for all finite-branching processes, the given BPA process has only to be unfolded up to depth |(|)|, for a HML formula ^ at hand, as validity of (J) can then readily be checked. The encoding of the unfolded tree as a BPA process is, however, rather concise. More concretely, Mayr [110] has shown that the general model checking problem for HML and BPA is PSPACE-complete by a reduction from the problem of quantified Boolean formulae (QBF). 1 1 General | Fixed formulaj 1 HML 1 PSPACE-complete | PTIME | The modal yi-calculus. The combination of expressive power and syntactic minimality makes the modal ^L-calculus an ideal formalism for conceptual studies. It is therefore not surprising that it is indeed the most studied logic for BPA processes and its extensions. In particular, this line of research has produced several different model checking algorithms which can be classified into being either global or local in nature, and into algorithms dealing with the full logic or only with a fragment thereof. The first algorithm given for BPA processes was a global one handling the alternationfree fragment [27]. Although the original algorithm works on formulations of BPA processes and alternation-free formulae which are rather different from those used in this survey, an adaptation to our setting is straightforward. The model checking algorithm proceeds by iteratively computing a formula specific property transformer for each nonterminal of the given BPA system. To be more precise, let 4) be a fixed ^-calculus formula and D(j, be the power set of subformulae of 4). A property transformer TA for a nonterminal A is then a mapping Dcj) -> D(j) where TA (A) = A' means that A' is the set of subformulae of (J) valid at A under the assumption that all subformulae in A are valid after termination of A, i.e., at the final state e from which no action can occur. Once the property transformers have been computed by means of a fixpoint iteration, the model checking problem is solved by taking the property transformer of the nonterminal corresponding to the initial state of the BPA process, and applying it to the set of subformulae of (J) satisfied by £ (which can be easily locally computed as e has no successor states). Let us illustrate this approach further by a simple example. 8. We take as the system to be model checked the BPA system from Example 1 in Section 1.1 which is defined by the following three rewrite rules
EXAMPLE
X-^XB, X-^£,
B-^£.
For this system we want to automatically verify that from the root X there exists an infinite a-path on which the action c is always enabled. This property can formally be expressed by the alternation-free modal |i-calculus formula (t)=df^Z.(a)ZA(c)tt.
604
O. Burkart et al.
The first step of the second-order model checking algorithm consists now of transforming the formula into an equivalent equational form [43] which explicitly names all subformulae, yielding in our case y{Z^ = Z2 A Z3, Z2 = (a)Zi, Z3 = (c)Z4, Z4 = t t } . Defining Z =df {Zi, Z2, Z3, Z4}, the property transformers to be computed for the nonterminals X and B are thus mappings D(|) ^ D(|j where Dcp=2^. For notational convenience, we split these property transformers further into component property transformers T ^ ' : D4) -^ 2^^^\ for 1 € { 1 , . . . , 4} and N € {X, B}. These component transformers are just the projections on the Zt, i.e., T^'(^^) =df t^KTN(M)) where t^HM) =df {Zt} if Zi € M, and t^^ (M) =df 0 otherwise. Hence we have TN ( M ) = [jt==] ^^^ i^)- The next step combines now the BPA system with the formula in equational form yielding the following equations for the component property transformers T^'=T^^nT^^3
T|'=T3^^nTB^M
T^^=T^'OTB
TB^^-t^
Tx^^=t^^ Tx^^-tT
'B
1
—^
7^4 _ X J.
'B - ^ J where n means argumentwise intersection, and o functional composition. Furthermore, we use t^, respectively t^, to denote the function which maps every subset of D(|) to Z, respectively 0. As we are looking for the largest solution, we have to initialize every component transformer with t^, and get the following fixpoint iteration.
0
1
2
3J
^x'=-^x'^^x'
tT
tT
tZ4
tZ4
TX^-T^'°TB
t^ t^
tT
tT
T^^3^t^4
tT
tZ4
tZ4
tZ4
Tx^^=tT
tT
t^
tT
t^
TB^'=TB^^nT3^3
tT
tT
t^
t^
'B
—^
tT
t^
t^
t^
MB
—^
t^ t^
t^
MB
-^
tT
tT
t^ t^
tT
The final step consists of two parts. First, computing the set of all subformulae of (J) valid for e, which in this example gives {Z4}. Second, applying the property transformer of X to {Z4}, which results in Tx({Z4}) = Z
Verification on infinite structures
605
tells us that, in particular, Z^ and therefore (j) holds at X. Thus, as one might have expected, the considered system does indeed have an infinite path from X on which the action c is always enabled. For more details about second-order model checking see [21]. This second order algorithm has been generalized in [29] to handle the full modal |j,-calculus. Although the actual model checker results directly from a combination of the alternation-free variant and some kind of backtracking, as known from finite-state model checking algorithms (cf. [44]), the corresponding correctness proof requires a stronger framework, which uses dynamic environments [29]. They are needed to explicitly model valuations of free variables during the iteration process. Both model checking algorithms have in common that they are global, as they provide complete information about which of the subformulae of (j) are satisfied by the states of the BPA process under consideration. It is, in fact, even possible to explicitly represent the set of all states S(j) of a given transition system satisfying a given formula (j) by means of a finite automaton constructed from the obtained property transformers. In particular, this shows that S(^ is always a regular set over the set of nonterminals [21]. The two algorithms have a time complexity which is polynomial in the size of the system, while exponential only in the size of the formula. From a practical point of view this means that the verification of BPA processes should be still feasible, since realistic system properties can usually be expressed by small formulae. Mayr [110] has shown that this complexity is essentially optimal by giving a matching lower bound for it. He obtained this lower bound by reducing the acceptance problem for linearly space bounded alternating Turing-machines to model checking BPA and the alternation-free ^-calculus. Sunmiarizing, it follows that model checking the modal ^.-calculus, or its alternationfree fragment, for BPA is EXPTIME-complete. Fixed formula General PTIME EXPTIME-complete Alternation-free modal |x-calculus EXPTIME-complete PTIME Full modal |x-calculus Hungar and Steffen [78] present a local model checking alternative to [27] in form of a remarkably simple tableau system. The sequents of the tableaux are again inspired by the notion of property transformer. They are of the form A h (cj). A), with the intended meaning that cJ) holds at state A under the assumption that all formulae of A hold at the final state. The heart of the tableau system is the following composition rule, which is inspired by the sequential composition rule of Hoare logic: a(^ h ((J), A)
ah((t),r>
|3h(r,A)
The rule has the following intended meaning. In order to show that (j) holds at ajS under the assumption that A holds at the final state, we guess an intermediate assertion F, and prove the following: • if A holds at the final state, then V holds before the execution of 3; • if r holds after execution of a, then (f) holds immediately before its execution.
606
O. Burkart et al.
Hungar [75] extended this tableau system for parallel compositions of BPA processes and the alternation-free modal ^-calculus. In contrast to BPP where no synchronization is possible between processes, he considers a model where BPA processes communicate on conmion actions. The tableau system presented is sound, but, in general, not complete, as the parallel composition of two BPA processes (with communication) can simulate a Turing machine. It is, however, shown to be decidable for the special case in which at most one of the communicating processes is infinite-state. This latter result coincides with the observation of Burkart and Steffen [28] that the synchronous parallel composition of a BPA process with a finite-state process is essentially a pushdown automaton for which the model checking problem is known to be decidable. The logic PCTL. Finally, we mention that the verification of nonregular properties for BPA processes has also been considered. Bouajjani, Echahed and Robbana introduce in [11] the logic PCTL, an extension of CTL with Presburger arithmetic (see Section 3.1.1). First of all they show that the logic PCTL is undecidable even for finite-state systems. This negative result is proved by a reduction to the halting problem for Minsky machines and underpins the expressive power of PCTL. Weakening, subsequently, PCTL to its fragment PCTL+ they regain on the other hand decidability of the model checking problem by reduction to the validity problem of Presburger arithmetic. 3.2.2. Pushdown processes and extensions. Verifying Hennessy-Milner Logic is essentially independent of the considered process class, as long as the transitions systems which have to be considered are finite-branching. Moreover, the considered logics expressing nonregular properties are too powerful to be decidable for the class of pushdown processes and even more expressive models. Our discussion of the process classes beyond BPA will therefore focus on the alternation-free and full ^-calculus. Pushdown processes. In formal language theory, automata are used as a "device" to accept sets of words. This goal leaves the free choice between two equivalent acceptance criteria: acceptance with final control states and acceptance with empty stack. For process theory, however, where automata are considered as a general computational model, acceptance with empty stack provides a much better conceptual match: Reaching a PDA configuration where the stack is empty then simply corresponds to termination of the process associated with the considered pushdown automaton. After the observation that the process class PDA, the class of transition graphs defined by pushdown automata accepting with empty stack, is strictly more expressive than the class BPA [34] there has been a spurt of activity in the development of verification algorithms for such pushdown automata and their extensions. Roughly, these algorithms can be classified as being • global, iterative, or • based on games, or • based on reachability analysis. The first algorithm developed for PDA [28] can handle the alternation-free ^i-calculus and is a generalization of the global, iterative one for BPA [27]. It takes into account the finite control Q = { q i , . . . , qn) of the given pushdown automaton, by observing that
Verification on infinite structures
607
starting from a configuration qA the PDA can terminate in any of the configurations qi £,..., qn£ representing the empty stack. As a consequence, the property transformer for the nonterminal A must now be parameterized by q e Q, and instead of a single assertion the property transformer must take now |Q| assertions into account, one for each of the terminating configurations qte. Besides this more general domain for the property transformers the algorithm is similar to [27], and can be extended along the lines of [29] to handle also the full modal ^-calculus. A second, quite different approach is to consider games on the transition graphs of PDAs. Walukiewicz has shown that model checking a modal |x-calculus formula ([) for a PDA P can be reduced to a parity game on a pushdown tree obtained from the combination of P and the syntax tree for (j) [149]. Furthermore, he proved that the winning strategy for a player in such a game can be realized by a pushdown strategy automaton. Using this strategy automaton, it is then possible to reduce the existence of a winning strategy in the pushdown game to the existence of a winning strategy in a finite parity game associated with the strategy automaton. The last problem can, finally, be decided by any model checking algorithm for finite-state systems. It has to be pointed out, however, that the size of the finite game constructed is exponential in the size of the pushdown automaton. More specifically, Walukiewicz has shown that model checking the alternation-free |x-calculus for PDAs is EXPTIME-complete, and that this result even holds for a fixed formula. The third technique for model checking pushdown automata is to analyze reachable sets of configurations as introduced by Bouajjani, Esparza, and Maler [12]. Their approach is based on alternating pushdown automata, a generalization of the classical notion of PDA which admits AND/OR transition steps. The main idea of the algorithm is, given a PDA P and an alternation-free |i-calculus formula (j), to construct the product of P and (\) by means of an alternating pushdown automaton APpxcj). This representation allows us to exploit that for alternating pushdown automata the set of all predecessors pre*(C) for a regular set of configurations C is always regular and can effectively be computed in terms of alternating finite-state automata. In the case of APpxc}) this means that starting with the regular set C t t of ^^ P^irs of configurations c and atomic formulae i|) such that c |= i|), it is possible to effectively compute the set of all configurations which satisfy ([), and hence to solve the model checking problem. The known complexity results for model checking PDA are summarized in the following table. General
Fixed formula
Alternation-free modal |x-calculus EXPTIME-complete EXPTIME-complete Full modal |x-calculus EXPTIME-complete EXPTIME-complete Regular graphs. Although we have emphasized in this survey the rewriting-based approach for the description of infinite transition systems, other natural representations have also been considered. Especially in graph theory (cf. [8]), a variety of graph generation mechanisms have been studied. A particularly attractive candidate in this field is the framework of deterministic graph grammars. They consist of an initial finite hypergraph together with a set of hyperedge replacement rules where hyperedges play the roles of nonterminals.
608
O. Burkart et al.
A
Q
Graph Grammar
X
>
The Regular Graph defined by X:
^2
Fig. 5. An example graph grammar.
and finite hypergraphs the roles of right-hand side expressions. A particular deterministic graph grammar represents then a single infinite graph which is obtained as the limit of the finite expansions of the initial hypergraph. Figure 5 shows an example graph grammar with a single rule where the initial hypergraph consists of the single edge X. Graph granmiars characterize the class of regular graphs which is equally expressive as the class of pushdown automata when unguarded rewrite rules are allowed [32]. Nevertheless, Courcelle has shown that regular graphs still possess a decidable monadic second order theory [46]. As already for BRA, this decidability result yields, however, only a nonelementary complexity upper bound. Subsequently, Burkart and Quemener [26] have developed a direct model checking algorithm for the alternation-free |a-calculus and regular graphs which generalizes the global, iterative model checking algorithm of [27,28]. They extend the method of computing property transformers for nonterminals to whole finite hypergraphs where the glue vertices play the roles of start and end states. Surprisingly, this generalization has the same worst-case complexity as model checking pushdown automata. Along the lines of [29] the algorithm can even be adapted to cope with the full modal |x-calculus. REC^at graphs. A still more expressive class of transition systems was introduced by Caucal in [33]. He considers the class of infinite transition graphs R E C R Q I defined by rewrite systems where in rewrite rules the left-hand side, as well as the right-hand side may be regular languages. A rewrite rule Li - ^ Li is then interpreted as the infinite collection of "ordinary" rules a - ^ (3 where a is a word of the regular language Li and (3 is a word of the regular language Lz. Since these rules may only be applied with respect to prefix rewriting, RECRat belongs to an extension of sequential rewrite transition systems in which the set of rules may be infinite. Caucal's main results are that this class properly extends the class of regular graphs, and that RECRat has a decidable monadic second order theory. By exploiting an alternative representation of RECRat graphs in terms of inverse regular morphisms and regular restrictions also given in [33] Burkart [22] has developed a more direct model checking algorithm for the full modal ^-calculus. The idea is to combine the given formula 4), the inverse regular morphism H~ ^, and the regular restriction L into a new
Verification on infinite structures
609
|x-formula 0((t), H ~ \ L) which has then to be checked for vaHdity on an infinite, complete tree with backward edges. The latter problem can readily be encoded as a BPA model checking problem for the full modal |x-calculus, thereby resulting in a single exponential model checking algorithm for R E C R Q I . Macro processes. Another natural extension of BPA are macro processes as considered by Hungar in [76]. This framework extends the interpretation of BPA processes as procedures, first given in [27], by allowing transitions with "higher-order procedure calls". Macro processes add to the simple idea that nonterminals correspond to procedure identifiers and right-hand sides to procedure bodies the concept of typed formal procedure parameters: left-hand sides in the grammar have typed formal parameters, which can be instantiated by nonterminals of appropriate type. The typing discipline establishes a strict ''is allowed to be passed as a parameter to" hierarchy among the nonterminals, which, in particular, excludes the possibility of self application: it is not possible to pass a procedure to itself as a parameter. This is essential to maintain the decidability of the model checking problem. The concept of higher-order recursion is quite powerful. In fact, the class of macro processes belonging to the first level in the hierarchy corresponds to the class of potentially infinite-branching pushdown processes, and thus covers the class of regular graphs, while macro processes of higher levels are strictly more expressive [77]. For these macro processes, Hungar developed a local as well as global iterative model checking algorithm for the alternation-free |a-calculus. Both algorithms have complexity 0(tower(k)) for a type hierarchy of depth k where tower(O) =df 0 and t o w e r ( n + 1) =^^2^^^^^^^K In particular, this shows that his algorithm for the general problem, where k remains unspecified, has nonelementary time complexity. 3.2.3. BPP and Petri nets. Going from models for sequential computation to models for concurrent computation the picture concerning decidability of model checking changes dramatically in the branching-time setting. The logic EG. In [56], Kiehn and Esparza show that the model checking problem for the logic EG is undecidable for BPP, and consequently, also for all the other considered branching-time logics except EF. This result is obtained by a reduction from the halting problem for Minsky two counter machines which is known to be undecidable [117]. Given a Minsky two counter machine M, it is possible to construct a BPP ?M which models M in the weak sense that Pjvi may simulate the computations of M, but may also "cheat" at some points during the simulation. Nevertheless, it is still possible to characterize the "honest runs" of the system, as well as reachability of the halting state, in the logic EG, although the formula becomes quite complicated. A closer inspection of the proof reveals that the result even holds for the restricted class of deterministic BPPs, and that the formula expressing that the halting state can be reached along an honest computation is independent of the argument process. The logic EF. The only branching-time logic not covered by the negative result for the logic EG is the logic EF. For this logic Esparza has shown in [52] that the model checking
610
O. Burkart et al.
problem for BPPs is decidable. The result is based on the fact that the reachability relation for BPPs is effectively semilinear, i.e., can be characterized by a formula in Presburger arithmetic. Combining then this Presburger formula with the given EF formula (|> yields again a Presburger formula characterizing the set of reachable states satisfying (j). Based on a decision procedure for the validity of Presburger arithmetic formulae one obtains a double exponential time model checking algorithm for EF and BPPs. On the other hand, Esparza also proved a lower bound for the problem by a reduction of the validity problem for quantified Boolean formula (QBF), which is known to be PSPACE-complete. This PSPACE-hardness result, which even holds for BPPs that describe finite-state systems, was complemented by Mayr [107,109] who showed that the model checking problem for full BPP only requires polynomial space, thereby establishing that it is PSPACE-complete. Thus adding recursion to finite-state BPPs does not increase the complexity of model checking. A further consequence of Mayr's result is that for a fixed formula of nesting depth k the problem lies in I ^ , the k-th level of the polynomial hierarchy. Overall, model checking BPP's with respect to EF has the following complexities. 1
1 General
[ Fixed formula |
1 EF 1 PSPACE^omplet^ 1 I^"
|
Going up in the process hierarchy to the more expressive class of Petri Nets costs decidability for EF as shown by Esparza in [51]. Undecidability is shown by a reduction from the undecidable containment problem for Petri nets, which is defined as follows: determine for every two Petri nets N i and N2 with the same number of places and each bijection f between their places, whether for each reachable marking M of N1 it is guaranteed that f(M.) is reachable in N2. 3.2.4. PA. As PA properly contains BPP, the logic EG is immediately undecidable for PA. Hence, the only branching-time logic not covered by this result is the logic EF for which Mayr [108] has proved decidability. He presents a sound and complete tableau system which is based on process decomposition. This algorithm has complexity 0(tower(k)) for formulae of nesting-depth k. Moreover, when the formula is fixed, the complexity Hes in I ^ . Later, Lugiez and Schnoebelen [104] proved decidability of the logic EF for PA by a completely different method using tree-automata to represent sets of configurations. The complexity of their algorithm is, however, the same as that of Mayr's algorithm. Since the best known lower bound for the problem is PSPACE-hardness, the exact complexity of this model-checking problem is still unknown. 1
1 General
| Fixed formula |
1 EF 1 PSPACE-hard | I ^
|
3.2.5. General processes. We close this section by mentioning that Bradfield has proposed in [15] a sound and complete tableau system for the modal ^-calculus and arbitrary infinite transition systems. This tableau system is of course highly undecidable, but provides a general guideline for interactive proofs.
Verification on infinite structures
611
3.3. Algorithms for linear-time logics From a theoretical point of view linear-time logics are quite attractive as they have a natural connection to automata on infinite strings. More specifically, the set of runs denoted by formulae of classical linear-time logics like, e.g., LTL or the linear-time |x-calculus are always cu-regular sets. Consequently, most of the model checking algorithms for lineartime logics follow the automata-based approach where linear-time formulae are modelled as Biichi automata [146,145]. Intuitively this approach works as follows. Given a process and a linear-time formula (j) a BUchi automaton S-^tj, is constructed, which accepts exactly all runs not satisfying (J). Building the product of this BUchi automaton with the Biichi automaton for the process yields a Biichi automaton, whose language is empty, if and only if it satisfies 0. This reduces the model checking problem to the emptiness problem for Biichi automata. Two different methods for the construction of a '^property automaton" 64, have been proposed. The first method could be termed global, as it constructs two automata B\_ and BR such that C{B(^) = C(B]_) n C(BR). Here the automaton Bi_ checks some local conditions on the model, while 6 R is the complement automaton of BR which checks for non-wellfoundedness of a regeneration sequence related to minimal fixpoints [144]. The second method takes the compositional approach where with each connective in the logic a corresponding construction on automata is associated. The final automaton B(^ is then obtained by starting with the basic automata for the variables in cj), and applying the corresponding automata constructions inductively according to the structure of (\). The main difficulty of this method, which has been developed by Dam for the linear-time VL-calculus [47], is concerned with the automata constructions related to the fixpoint operators. All algorithms considered in the sequel follow the automata-based approach and may use either the global or the compositional construction for the property Biichi automaton. Since Biichi automata are equally expressive as the linear-time (i-calculus all algorithms directly deal with the more expressive linear-time |x-calculus, and subsume model checking LTL as a special case. Before we proceed with the specifics of the infinite-state case, we mention that LTL, respectively LT}x, model checking for finite-state systems has intensively been studied. For instance, it is well-known that model checking LTL, respectively LTfa, is PSPACEcomplete for finite-state systems [135,144]. Both results follow from a polynomial reduction to satisfiability testing which is shown to be PSPACE-complete itself. Fortunately, the complexity is exponential only in the size of the formula which is in practice often small, but linear in the system size [ 102]. Despite these at first sight negative results, the feasibility of linear-time model checking for finite-state systems has been demonstrated by practical verification tools like SPIN [73], PROD [147] or PEP [148]. 3.3.1. BPA and pushdown processes LTL and LT\i. The decidability of the model checking problem for pushdown processes and the linear-time vi-calculus follows immediately from the decidability of the corre-
612
O. Burkart et al
spending problem for the modal |x-calculus, since the linear-time |x-calculus can be interpreted in its branching-time equivalent, however at the price of an exponential blowup. This blowup in the translation can, however, be avoided by a more direct approach which applies automata-theoretic techniques. Given a PDA V and a linear-time formula ((), one constructs as usual a BUchi automaton B-.4) accepting exactly all runs which do not satisfy (J). Combining then this BUchi automaton with the PDA V yields a Biichi PDA V x B-^^^ representing the synchronized product of V and B-n(j> where a run is accepted if it visits a certain set of control locations infinitely often. Accordingly, all runs starting in a configuration c of P satisfy ({) iff c has no accepting run in P X B^^^. Bouajjani, Esparza, and Maler have shown in [12] that the set C-.(j) of all configurations of this Biichi PDA possessing an accepting run can effectively be computed by means of a certain kind of finite automaton, called multi-automaton. The model checking problem then simply reduces to checking whether the initial configuration of the PDA P is a member of C^^. This algorithm shows that model checking pushdown processes with LTL, as well as the linear-time p^-calculus, is in EXPTIME. A reduction of the acceptance problem for linearly bounded alternating Turing machines, which is known to be EXPTIME-complete [93], shows, furthermore, that the problem is EXPTIME-hard. Overall, these results establish that the model checking problem for pushdown automata wrt. LTL, as well as the lineartime }x-calculus, is EXPTIME-complete. Fixing a formula 4), on the other hand, the model checking problem has only polynomial complexity in the size of the system representation. Thus the problem is only slightly harder than in the finite-state case which is PSPACEcomplete, and it is also polynomial in the system size for a fixed formula. Shortly afterwards Mayr [109] has also settled the exact complexity of model checking LTL for BPA processes which is not covered by the previous results. He has shown, by generalizing the proof of Bouajjani, Esparza, and Maler, that model checking the weaker class of context-free processes with LTL is EXPTIME-complete as well. Summarizing, we have the following complexity results for model checking LTL, respectively LT^, on sequential processes.
FSA BPA PDA
General PSPACE-complete EXPTIME-complete EXPTIME-complete
Fixed formula PTIME PTIME PTIME
In addition, Esparza et al. [54] have developed efficient algorithms for model checking pushdown processes when the negation of the specification is already given in form of a Biichi automaton. This circumvents the exponential conversion from LTfJ. to Biichi automata. The logic CLTL. Finally, decidability of nonregular linear-time properties has been investigated by Bouajjani and Habermehl in [13]. They consider CLTL, a linear-time logic which extends LTL with pattern constraints expressed by finite-state automata and counting constraints using Presburger arithmetic formulae. As full CLTL is undecidable even for finite-state systems [10], its fragment CLTLQ which essentially does not allow eventuality
Verification on infinite structures
613
formulae with counting constraints is introduced. It turns out that CLTLD is decidable for pushdown automata which is shown in four steps: • First, since CLTLn is not closed under negation, the syntactic complement of C L T L Q , called CLTLo, is introduced. Both fragments are related by the property that for each (j) G CLTLQ there exists (()' e CLTLo such that -"(j) and (^' have the same semantics, and vice versa. • Second, it is shown that any formula of CLTLo can be transformed into a normal form which is essentially a conjunction of an cu-regular property expressed in terms of a linear-time |x-calculus formula and a pure counting constraint eventuality formula. • Third, it is proved that satisfiability of a formula (j) G CLTLo relatively to a set of sequences S can be reduced to a constrained emptiness problem. If S, a technical set construction related to S, has the additional property that its intersection with an cu-regular language always yields a semilinear set, then the satisfiability problem can further be reduced to the nonemptiness problem of semilinear sets which itself is known to be decidable. • Fourth and last, the fact that pushdown processes generate cu-context-free languages, which are semilinear and closed under intersection with tu-regular languages shows that the satisfiability problem for CLTLo i^ decidable, and consequently so is the modelchecking problem for CLTLQ.
3.3.2. BPP and Petri nets LTL and LT\i. Here, only the model checking problem for the more expressive class of Petri nets and the stronger logic LT|j. has been considered. As it turns out, the decidability of the model checking problem for LT|a and Petri nets is sensitive to whether atomic propositions beyond just true are allowed in the logic or not. As shown by Esparza, the case with general atomic propositions is undecidable [53], while in case that true is the only allowed atomic proposition this problem becomes decidable [51]. The given decision procedure is based on an automata-theoretic characterization of the logic which was introduced by Vardi and Wolper [146]. Refining a technique of [47] Esparza has shown that, given a closed formula 4), there exist two finite automata A-.(^ and B^cj) accepting the finite, respectively infinite, words that do not satisfy 4). Consequently, the Petri net N satisfies ^ iff C{n) n C{\-.^) = 0 and C(N) O C(B^^) = 0. In order to decide these two properties the finite automata are transformed into certain Petri nets and combined with N in a way similar to the classical automata product yielding N x N A _ ^ and N x N B . ^ such that C(N x N A . ^ ) = /^(N) n C(NA-.^) and £(N X N B ^ ^ ) = C(N) n / : ( N B ^ ^ ) . Esparza then proves that (1) £(N) n £(A-.4)) # 0 iff the Petri net N x N A^^ has a reachable dead marking which marks some place of a certain set S. (2) £(N) n £(B-,(t)) 7^ 0 iff the Petri net N x N B _ ^ has a run which contains infinitely many occurrences of transitions of a certain set T. Now the existence of a reachable dead marking in (1) can be decided solving an exponential number of instances of the reachability problem for Petri nets. The reachability problem is known to be decidable since the early eighties when Kosaraju [96], as well as Mayr [106], presented a non-primitive recursive algorithm. Recently, Bouziane [14]
614
O. Burkart et al.
claimed a doubly-EXPSPACE algorithm, which approaches the EXPSPACE lower bound of Lipton [103]; however, the correctness of this algorithm is unclear. The existence of a run in (2) containing infinitely many occurrences of transitions of a given set T was shown to be decidable by Jantzen and Valk [92]. Later Yen has shown that this can be decided also within exponential space [150]. Overall, this yields an EXPSPACE-algorithm. Since on the other hand the reachability problem for Petri nets can be encoded in LTL, the model checking problem is also EXPSPACE-hard, proving the problem to be EXPSPACE-complete. For reactive systems, which often are assumed to provide a certain service forever without ever terminating, another, non-standard semantics is of interest, which only takes infinite runs into account. When restricted to these cu-semantics, the space complexity of Esparza's decision procedure is exponential in the size of the Petri net and double exponential in the size of the formula. Recently, Habermehl [62] has improved on this complexity by showing that the space complexity can be reduced to be polynomial in the size of the formula, which is known to be a lower bound already for finite-state systems. However, also in the cu-setting the problem remains EXPSPACE-hard in the size of the system. Even more surprisingly, the same complexity is obtained already for the weaker model of BPP and the weaker logic LTL [64]. In this case EXPSPACE-hardness can be shown in five steps: • First, the EXPSPACE-complete problem whether an exponentially space-bounded Turing-machine accepts a given input, is reduced to the problem whether the exponentially space-bounded universal Turing-machine accepts a given input. • Second, the universal Turing-machine is encoded in an exponentially space-bounded universal Minsky n-counter machine, for which, consequently, the acceptance problem is EXPSPACE-hard. • Third, this universal Minsky n-counter machine can be encoded as a parallel composition of a BPP and a finite automaton yielding a PPDA similar to the construction in [103] or [53]. The size of this finite automaton is a function in the size of the finite control of the universal counter machine and thus fixed and finite. • Fourth, the problem if the resulting PPDA has an infinite run can be encoded in a model checking problem for BPP and an LTL-formula. The LTL-formula depends only on the fixed finite automaton and is thus also fixed. This encoding of the automaton in LTL is possible, since, by choosing the atomic actions accordingly, the automaton can be made star-free. Sunmiarizing, we have the following complexities when model checking LTL, respectively LT^. LTL and LT|x with standard semantics 1 General | Fixed formula BPP/PN 1 EXPSPACE-complete | ^XPSPACE-complete 1 LTL and LTM. with cu-semantics | 1 1 Fixed system | Fixed formula 1 1 BPP/PN 1 PSPACE-complete | EXPSPACE-complete |
Verification on infinite structures
615
The logic CLTL. Pursuing their research on CLTL, Bouajjani and Habermehl have shown that CLTLn is also decidable for Petri nets [13]. Since Petri nets are in contrast to pushdown processes not semilinear, the proof for the decidability of CLTLn on pushdown processes does not carry over. This time satisfiability of CLTLo is reduced in several steps to the reachability problem in Petri nets. • First, the regular part of the CLTLo formula ([) is transformed into an equivalent Btichi automaton B which is then combined with the net N such that N x B represents their synchronized product. • Second, one can show that the set of markings M of N x ;B from which the Biichi automaton accepts every run is semilinear. • Third, since the counting constraint part of (j) also describes a semilinear set of markings M^ and since semilinear sets are closed under intersection, the satisfiability problem reduces to the reachability problem for the semilinear set of markings M fi M'. • Fourth and last, the previous reachability problem for semilinear sets can be reduced to the classical reachability problem for single markings in Petri nets. 3.3.3. PA LTL and LT\i. Although LTL is decidable for BPA, as well as for BPP, this result does not longer hold in their common generalization PA. As shown in [10], a Minsky machine can be simulated by three BPA processes in parallel, such that their "honest" synchronization, as well as the reachability of the halting state, is expressible by a LTL formula. More technically, the halting of the Minsky machine is encoded as the nonemptiness of the intersection of an cu-star-free language with a PA cu-language. Undecidability of the model checking problem for LTL and PA follows then immediately from the undecidability of the halting problem for Minsky machines [117]. The logic CLTL. As a corollary, the undecidability of model checking LTL also proves that PA cu-languages are not closed under intersection with cu-star-free languages. On the other hand, it is shown in [13] that PA cu-languages are closed under intersection with the smaller class of simple cu-regular languages, i.e., cu-languages definable by a finite-state Biichi automaton where every loop in its transition graph is a self-loop. Since the fragment simple-PLTLn of CLTL, which is incomparable to LTL, expresses exactly the simple tu-regular languages, it can, finally, be shown that simple-PLTLp is indeed decidable for PA.
3.4. Summary From a bird's perspective we may conclude that sequential-type systems, like BPA and PDA, are inherently easier to analyze than parallel-type systems. This conclusion is supported by both the (un)decidability as well as the complexity results: For BPA and PDA, most branching and linear-time logics are decidable, while for parallel-type systems, like BPP and Petri nets, except for the very restrictive branchingtime logics HML and EF only linear-time logics are decidable. In particular the modal
616
O. Burkart et al
1 Class 1 BPA
Logic
Complexity
HML
G: F: G: F: G: F: G: F: G: F:
BPA
modal M-'Calculus
PDA
modal fj.-calculus
BPP
EF
PA
EF
Class FSA
Logic LTL / LT^i
BPA
LTL / LT^
PDA
LTL / LT^
BPP/PN
LTL / LT^i
PSPACE-complete[110] PTIME EXPTIME-compIete [149,110] PTIME [29] EXPTIME-complete [149] EXPTIME-complete [149] PSPACE-complete [52,107,109] i f [52,107,109] PSPACE-hard [108,109] I f [109]
Complexity G: PSPACE-complete [135,144] PTIME F: G: EXPTIME-complete [ 109] F: PTIME [12] G: EXPTIME-complete[12] PTIME [12] F: G: EXPSPACE-complete [51,109] EXPSPACE-complete [51,109] F:
| 1
|
Fig. 6. Complexities of model checking problems.
^-calculus as well as LTL (and even C L T L D ) are decidable for PDA, while on the other hand all branching-time logics except HML are undecidable for Petri nets, and merely the linear-time |Li-calculus with true as only atomic proposition is decidable for Petri nets. Considering the complexity results for model checking the picture is similar. For example on the sequential side model checking the modal |a-calculus and the linear-time |x-calculus are both EXPTIME-complete for PDA, while on the parallel side the model checking problem for Petri nets with respect to the linear-time |x-calculus is already EXPSPACEcomplete. The following corresponding tables summarize these results and the pointers to the relevant Uterature. To abbreviate the notation, G: indicates the complexity of the general problem, while F: specifies the complexity of the problem when the formula is fixed. The central results presented in this chapter concern worst-case estimations within the classical complexity class structure. This classification, although constituting a very good guideline also for practical purposes, must often be refined in order to provide a real basis for implementation decisions. We therefore propose to investigate • finer complexity class structures, e.g., in many cases people only accept hnear or at most quadratic algorithms, and even constant factors may play a significant role; • average or *in practice' behaviours: systems developed by people are often much better behaved as suggested by worst-case analyzes; and • special restrictive but practical system/property combinations, which can be treated efficiently. Whereas the first two points do not require any further explanation, the third should become clearer by considering program analysis as an illustrating example. Here the so-
Verification on infinite structures
617
called bitvector problems constitute a highly relevant but tractable class. In fact, along the lines of [ 108,57,131 ] it is straightforward to deduce that interprocedural bitvector analyzes, even for programs with fork/join parallelism and shared variables, admit model checking in linear time. Special cases like this, which depend on rather specific patterns of formulae and/or models, will always have to be considered case by case. However, we are convinced that the overview of the general complexities provides beneficial guidelines even for such refined complexity considerations, as one cannot construct a scenario avoiding 'bottlenecks' without knowing exactly where they are located.
Acknowledgements Sections 1 and 2 are based on the survey Infinite Results [118] presented at CONCUR'96, and the origins of Section 3 are found in the survey More Infinite Results [25] presented at INFINITY'96. However, there has been a flood of new results in the intervening years, and these earlier surveys are vastly extended here. We wish to thank Richard Mayr and Markus Mueller-Olm for detailed comments on earlier drafts of this survey.
References [1] P.A. AbduIIa and K. Cerans, Simulation is decidable for one-counter nets, CONCUR'98, Nice, Lecture Notes in Comput. Sci. 1466, D. Sangiorgi and R. de Simone, eds. Springer (1998), 253-268. [2] R. Alur, C. Courcoubetis, T.A. Henzinger, N. Halbwachs, RH. Ho, X. Nicollin, A. Olivero, J. Sifakis and S. Yovine, The algorithmic analysis of hybrid systems, Theoret. Comput. Sci. 138 (1995), 3-34. [3] R. Alur and T.A. Henzinger, Real-time systems = discrete systems + clock variables. Software Tools for Technology Transfer 1 (1997), 86-109. [4] J.C.M. Baeten, J. A. Bergstra and J.W. Klop, Decidability of bisimulation equivalence for processes generating context-free languages, R\RLE'87, Eindhoven, Lecture Notes in Comput. Sci. 259, J.W. de Bakker, A.J. Nijman and RC. Treleaven, eds. Springer (1987), 94-113. [5] J.C.M. Baeten, J. A. Bergstra and J.W. Klop, Decidability of bisimulation equivalence for processes generating context-free languages, J. ACM 40 (3) (1993), 653-682. [6] Y. Bar-Hillel, M. Perles and E. Shamir, On formal properties of simple phrase structure grammars, Zeitschrift fur Phonetik, Sprachwissenschaft, und Kommunikationsforschung 14 (1961), 143-177. [7] M. Ben-Ari, Z. Manna and A. Pnueli, The temporal logic of branching time. Acta Inform. 20 (3) (1983), 207-226. [8] C. Berge, Graphs and Hypergraphs, North-Holland, Amsterdam (1973). [9] J.A. Bergstra and J.W. Klop, Algebra of communicating processes with abstraction, Theoret. Comput. Sci. 37 (1985), 77-121. [10] R. Bouajjani, R. Echahed and P. Habermehl, On the verification of nonregular properties for nonregular processes, LICS'95, San Diego, IEEE Comput. Soc. Press (1995), 123-133. [11] A. Bouajjani, R. Echahed and R. Robbana, Verification of nonregular temporal properties for context-free processes, CONCUR'94, Uppsala, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer (1994), 81-97. [12] A. Bouajjani, J. Esparza and O. Maler, Reachability analysis of pushdown automata: Application to model-checking, CONCUR'97, Warsaw, Lecture Notes in Comput. Sci. 1243, A. Mazurkiewicz and J. Winkowski, eds. Springer (1997), 135-150. [13] A. Bouajjani and P. Habermehl, Constrained properties, semilinear systems and Petri nets, CONCUR'96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 481-497.
618
O. Burkart et al
[14] Z. Bouziane, A primitive recursive algorithm for the general Petri net reachability problem, FOCS'98, Palo Alto, IEEE Comput. Soc. Press (1998), 130-136. [15] J.C. Bradfield, Verifying Temporal Properties of Systems, Birkhauser (1992). [16] J.C. Bradfield, The modal mu-calculus alternation hierarchy is strict, CONCUR'96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 233-246. [17] J.C. Bradfield and C.P. Stirling, Modal logics and mu-calculi: An introduction. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 293-330. [18] R. Buchi, On a decision method in restricted second order arithmetic, Proc. of the 1960 International Congress for Logic, Methodology and Philosophy of Science, Berkeley, Stanford University Press (1962), 1-11. [19] R. Biichi, Regular canonical systems. Archive fiir Mathematische Logik und Grundlagenforschung 6 (1964), 91-111. [20] J.R. Burch, E.M. Clarke, K.L. McMillan, D.L. Dill and L.J. Hwang, Symbolic model checking \Qr^ states and beyond, LICS'90, Philadelphia, IEEE Comput. Soc. Press (1990), 428-439. [21] O. Burkart, Automatic Verification of Sequential Infinite-State Processes, Lecture Notes in Comput. Sci. 1354, Springer (1997). [22] O. Burkart, Model-checking rationally restricted right closures of recognizable graphs. Electron. Notes in Theoret. Comput. Sci. 9 (1997). [23] O. Burkart, D. Caucal and B. Steffen, An elementary bisimulation decision procedure for arbitrary contextfree processes, MFCS'95, Prague, Lecture Notes in Comput. Sci. 969, J. Wiedermann and P. Hajek, eds. Springer (1995), 423^33. [24] O. Burkart, D. Caucal and B. Steffen, Bisimulation collapse and the process taxonomy, CONCUR'96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 247-262. [25] O. Burkart and J. Esparza, More infinite results. Electron. Notes in Theoret. Comput. Sci. 5 (1997). [26] O. Burkart and Y.-M. Quemener, Model-checking of infinite graphs defined by graph grammars. Electron. Notes in Theoret. Comput. Sci. 5 (1997). [27] O. Burkart and B. Steffen, Model checking for context-free processes, CONCUR'92, Stony Brook, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed.. Springer (1992), 123-137. [28] O. Burkart and B. Steffen, Composition, decomposition and model-checking of pushdown processes, Nordic J. Computing 2 (1995), 89-125. [29] O. Burkart and B. Steffen, Model-checking the full-modal mu-calculus for infinite sequential processes, ICALP'97, Bologna, Lecture Notes in Comput. Sci. 1256, P. Degano, R. Gorrieri and A. MarchettiSpaccamela, eds, Springer (1997), 419-429. [30] D. Caucal, A fast algorithm to decide on the equivalence of stateless dpda, RAIRO 27 (1) (1990), 23^8. [31] D. Caucal, Graphes canoniques de graphes algebriques, RAIRO 24 (4) (1990), 339-352. [32] D. Caucal, On the regular structure of prefix rewriting, Theoret. Comput. Sci. 10 (1992), 61-86. [33] D. Caucal, On infinite transition graphs having a decidable monadic theory, ICALP'96, Paderbom, Lecture Notes in Comput. Sci. 1099, F. Meyer auf der Heide and B. Monien, eds. Springer (1996), 194-205. [34] D. Caucal and R. Monfort, On the transition graphs of automata and grammars, Graph-Theoretic Concepts in Computer Science, Beriin, Lecture Notes in Comput. Sci. 484, R.H. Mohring, ed.. Springer (1990), 311-337. [35] S. Christensen, Decidability and Decomposition in Process Algebras, Ph.D. thesis. The University of Edinburgh, Department of Computer Science, ECS-LFCS-93-278 (1993). [36] S. Christensen, Y. Hirshfeld and F. Moller, Bisimulation equivalence is decidable for basic parallel processes, CONCUR'93, Hildesheim, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer (1993), 143157. [37] S. Christensen, Y. Hirshfeld and F. Moller, Decomposability, decidability and axiomatisability for bisimulation equivalence on basic parallel processes, LICS'93, Montreal, IEEE Comput. Soc. Press (1993), 386-396. [38] S. Christensen, H. Hiittel and C. Stirling, Bisimulation equivalence is decidable for all context-free processes, CONCUR'92, Stony Brook, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed.. Springer (1992), 138-147. [39] S. Christensen, H. Hiittel and C. Stirling, Bisimulation equivalence is decidable for all context-free processes. Inform, and Comput. 12 (2) (1995), 143-148.
Verification on infinite structures
619
[40] E.M. Clarke and E.A. Emerson, Design and synthesis of synchronization skeletons using branching time temporal logic, Proc. of the Workshop on Logics of Programs, Lecture Notes in Comput. Sci. 131, Yorktown Heights, Springer (1981), 52-71. [41] E.M. Clarke, E.A. Emerson and A.P. Sistla, Automatic verification offinitestate concurrent systems using temporal logic specifications, ACM Trans. Programming Languages and Systems 8 (2) (1986), 244-263. [42] E.M. Clarke, O. Grumberg and D.A. Peled, Model Checking, MIT Press (1999). [43] R. Cleaveland, M. Klein and B. Steffen, Faster model checking for the modal mu-calculus, CAV'92, Lecture Notes in Comput. Sci. 663, Montreal, G. Bochmann and D.K. Probst, eds. Springer (1992), 410-422. [44] R. Cleaveland and O. Sokolsky, Equivalence and preorder checking for finite-state systems. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 391-^24. [45] R. Cleaveland and B. Steffen, Computing behavioural relations, logically, ICALP'91, Lecture Notes in Comput. Sci. 510, Madrid, J.L. Albert, B. Monien and Rodriguez, eds. Springer (1991), 127-138. [46] B. Courcelle, Graph rewriting: An algebraic and logic approach. Handbook of Theoretical Computer Science, J. van Leeuwen, ed., Elsevier Science Publisher B.V. (1990), 193-242. [47] M. Dam, Fixpoints of Buchi automata, FSTTCS'92, New Delhi, Lecture Notes in Comput. Sci. 652, R. Shyamasundar, ed.. Springer (1992), 39-50. [48] L.E. Dickson, Finiteness of the odd perfect and primitive abundant numbers with distinct factors, Amer. J. Math. 35 (1985), 413^22. [49] E.A. Emerson and C.-L. Lei, Efficient model checking in fragments of the propositional mu-calculus, LICS'86, Cambridge, Massachusetts, IEEE Comput. Soc. Press (1986), 267-278. [50] E.A. Emerson and Srinivasan, Branching time temporal logic. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Springer (1989), 123-172. [51] J. Esparza, On the decidability of model checking for several \i-calculi and Petri nets GAAP'94, Edinburgh, Lecture Notes in Comput. Sci. 787, S. Tison, ed.. Springer (1994), 115-129. [52] J. Esparza, Decidability of model-checking for concurrent infinite-state systems. Acta Inform. 34 (1997), 85-107. [53] J. Esparza, Decidability and complexity of Petri net problems: An introduction, Lectures on Petri Nets I: Basic Models, Lecture Notes in Comput. Sci. 1491, W. Reisig and G. Rozenberg, eds. Springer (1998), 374-428. [54] J. Esparza, D. Hansel, P. Rossmanith and S. Schwoon, Efficient algorithms for model checking pushdown systems. Submitted for publication. [55] J. Esparza, P. Jancar and F. MoUer, Petri nets and regular behaviours, J. Comput. and System Sci. 59 (3) (1999), 476-503. [56] J. Esparza and A. Kiehn, On the model checking problem for branching time logics and basic parallel processes, CAV'95, Liege, Lecture Notes in Comput. Sci. 939, P. Wolper, ed.. Springer (1995), 353-366. [57] J. Esparza and A. Podelski, Efficient algorithms for pre"^ and post* in interprocedural parallel flow graphs, POPL'OO, Boston, ACM Press (2000), 1-12. [58] R.W. Floyd, Assigning meanings to programs. Symposium on Applied Mathematics, Vol. 19, J.T. Schwartz, ed., Amer. Math. Soc. (1967), 19-32. [59] R.J. van Glabbeek, The linear time - branching time spectrum, CONCUR'90, Amsterdam, Lecture Notes in Comput. Sci. 458, J.C.M Baeten and J.W. Klop, eds. Springer (1990), 278-297. [60] J.F. Groote, A short proof of the decidability of bisimulation for normed BPA-processes, Inform. Process. Lett. 42 (1991), 167-171. [61] J.F. Groote and H. Hiittel, Undecidable equivalences for basic process algebra. Inform, and Comput. 11 (2) (1994), 354^371. [62] P. Habermehl, On the complexity of the linear time mu-calculus for Petri nets, 18th International Conference on Application and Theory of Petri Nets, Toulouse, Lecture Notes in Comput. Sci. 1248, P. Azema and G. Balbo, eds. Springer (1997), 102-116. [63] M. Hack, Decidability Questions for Petri Nets, Ph.D. thesis, Massachusetts Institute of Technology, Laboratory for Computer Science (1976). [64] P. Hebermehl and R. Mayr, Personal communications (January 2000). [65] M. Hennessy and R. Milner, Algebraic laws for nondeterminism and concurrency, J. ACM 32 (1) (1985) 137-161.
620
O. Burkart et al
[66] Y. Hirshfeld, Petri nets and the equivalence problem, CSL'93, Swanseea, Lecture Notes in Comput. Sci. 832, E. Borger, Y. Gurevich and K. Meinke, eds. Springer (1993), 165-174. [67] Y Hirshfeld, Congruences in commutative semigroups. Technical Report ECS-LFCS-94-291, Department of Computer Science, University of Edinburgh, UK (1994). [68] Y Hirshfeld and M. Jemim, Bisimulation equivalence is decidable for normed Process Algebra, ICALP'99, Prague, Lecture Notes in Comput. Sci. 1644, J. Wiedermann, P. van Emde Boas and M. Nielsen, eds. Springer (1999), 412-421. [69] Y Hirshfeld, M. Jerrum and P. MoUer, A polynomial algorithm for deciding bisimilarity of normed contextfree processes, FOCS'94, Santa Fe, IEEE Comput. Soc. Press (1994), 623-631. [70] Y Hirshfeld, M. Jerrum and F. Moller, A polynomial algorithm for deciding bisimilarity of normed contextfree processes, Theoret. Comput. Sci. 15 (1996), 143-159. [71] Y Hirshfeld, M. Jerrum and F Moller, A polynomial algorithm for deciding bisimulation equivalence of normed basic parallel processes. Math. Structures Comput. Sci. 6 (1996), 251-259. [72] Y Hirshfeld and F. Moller, A fast algorithm for deciding bisimilarity of normed context-free processes, CONCUR'94, Uppsala, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer (1994), 48-63. [73] G.J. Holzmann, Design and Validation of Computer Programs, Prentice-Hall, Englewood Cliffs, NJ (1991). [74] J.E. Hopcroft and J.D. UUman, Introduction to Automata Theory, Languages and Computation, AddisonWesley(1979). [75] H. Hungar, Local model checking for parallel compositions of context-free processes, CONCUR'94, Uppsala, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer (1994), 114-128. [76] H. Hungar, Model-checking of macro processes, CAV'94, Stanford, Lecture Notes in Comput. Sci. 818, D.L. Dill, ed.. Springer (1994), 169-181. [77] H. Hungar, Model-checking and higher-order recursion, MFCS'99, Szklarska Poreba, Lecture Notes in Comput. Sci. 1672, L. Pacholski, ed.. Springer (1999), 149-159. [78] H. Hungar and B. Steffen, Local model-checking for context-free processes, Nordic J. Comput. 1 (3) (1994), 364-385. [79] H. Hiittel, Undecidable equivalences for basic parallel processes, TACS'94, Sendai, Lecture Notes in Comput. Sci. 789, M. Hagiya and J.C. Mitchell, eds. Springer (1994), 454-464. [80] H. Hiittel and C. Stirling, Actions speak louder than words: Proving bisimilarity for context-free processes, LICS'91, Amsterdam, IEEE Comput. Soc. Press (1991), 376-386. [81] D.T. Huynh and L. Tian, Deciding bisimilarity of normed context-free processes is in I 2 ' Theoret. Comput. Sci. 12 (1994), 183-197. [82] D.T. Huynh and L. Tian, On deciding readiness and failure equivalences for processes. Inform, and Comput. 11 (1995), 193-205. [83] P. Jancar, Decidability questions for bisimilarity of Petri nets and some related problems, STAGS'94, Caen, Lecture Notes in Comput. Sci. 775, P. Enjalbert, E.W. Mayr and K.W. Wagner, eds. Springer (1994), 581-592. [84] P. Jancar, Undecidability of bisimilarity for Petri nets and some related problems, Theoret. Comput. Sci. 148 (1995), 281-301. [85] P. Jancar, Bisimulation equivalence is decidable for one-counter processes, ICALP'97, Bologna, Lecture Notes in Comput. Sci. 1256, P. Degano, R. Gorrieri and A. Marchetti-Spaccamela, eds. Springer (1997), 549-559. [86] P. Jancar, A. Kucera and R. Mayr, Deciding bisimulation-like equivalences with finite-state processes, ICALP'98, Aalborg, Lecture Notes in Comput. Sci. 1443, K.G. Larsen, S. Skyum and G. Winskel, eds. Springer (1998), 200-211. [87] P. Jancar, A. Kucera and F Moller, Simulation and bisimulation over one-counter processes, STAGS'2(X)0, Lecture Notes in Comput. Sci. 1770, H. Reichel and S. Tison, eds. Springer (2000). [88] P. Jancar and F. Moller, Checking regular properties of Petri nets, CONCUR'95, Philadelphia, Lecture Notes in Comput. Sci. 962,1. Lee and S.A. Smolka, eds. Springer (1995), 348-362. [89] P. Jancar and F. Moller, Simulation of one-counter nets via colouring {abstract). Workshop Joumees Systemes Infinis, A. Finkel, ed., Cachan, (1998), 1-6. Report CNRS URA 2236, Ecole Normale Superieure
Verification on infinite structures
[90]
[91] [92] [93] [94] [95] [96] [97] [98]
[99]
[100]
[101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116]
621
de Cachan. Full 10-page paper available as Uppsala University CSD Report No. 159 at http://www.csd.uu. se/papers/report.html. P. Jancar and F. MoUer, Techniques for decidability and undecidability for bisimilarity, CONCUR'99, Eindhoven, Lecture Notes in Comput. Sci. 1664, J.CM. Baeten and S. Mauw, eds. Springer (1999), 3045. R Jancar, F. MoUer and Z. Sawa, Simulation problems for one-counter machines, SOFSEM'99, Milovy, Lecture Notes in Comput. Sci. 1725, J. Pavelka, G. Tel and M. Bartosek, eds. Springer (1999), 398^07. M. Jantzen and R. Valk, The residue of vector sets with applications to decidability problems in Petri nets. Acta Inform. 21 (1985), 643-674. D. Johnson, A catalog of complexity classes. Handbook of Theoretical Computer Science, J. van Leeuwen, ed.. Vol. A, Elsevier (1990), 67-161. D.E. Knuth, J.H. Morris and V.R. Pratt, Fast pattern matching in strings, SIAM J. Comput. 6 (1977), 323-350. A.J. Korenjak and J.E. Hopcroft, Simple deterministic languages, 7th Annual IEEE Symposium on Switching and Automata Theory, Berkeley, IEEE (1966), 36-46. S.R. Kosaraju, Decidability of reachability in vector addition systems, STOC'82, San Fransisco (1982), 267-281. D. Kozen, Results on the propositional yi-calculus, Theoret. Comput. Sci. 27 (1983), 333-354. A. Kucera and R. Mayr, Simulation preorder on simple process algebras, ICALP'99, Prague, Lecture Notes in Comput. Sci. 1644, J. Wiedermann, P. van Emde Boas and M. Nielsen, eds. Springer (1999), 503-512. A. Kucera and R. Mayr, Weak bisimilarity with infinite state systems can be decided in polynomial time, CONCUR'99, Eindhoven, Lecture Notes in Comput. Sci. 1664, J.C.M. Baeten and S. Mauw, eds. Springer (1999), 368-382. L. Lamport, Verification and specification of concurrent programs, A Decade of Concurrency, Noordwijkerhout. Lecture Notes in Comput. Sci. 803, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Springer (1994), 347-374. G. Lenzi, A hierarchy theorem for the mu-calculus, ICALP'96, Paderbom, Lecture Notes in Comput. Sci. 1099, F. Meyer auf der Heide and B. Monien, eds. Springer (1996), 87-109. O. Lichtenstein and A. Pnueli, Checking that finite state concurrent programs satisfy their linear specification, POPL'85, New Orleans, ACM Press (1985), 97-107. R. Lipton, The reachability problem requires exponential space. Technical Report 62, Yale University (1976). D. Lugiez and Ph. Schnoebelen, The regular viewpoint on PA-processes, CONCUR'98, Nice, Lecture Notes in Comput. Sci. 1466, D. Sangiorgi and R. de Simone, eds. Springer (1998), 50-66. Z. Manna and A. Pnueli, Temporal Logic of Reactive and Concurrent Systems: Specification, Springer (1992). E.W. Mayr, An algorithm for the general Petri net reachability problem, SIAM J. Comput. 13 (3) (1984), 441^59. R. Mayr, Weak bisimulation and model checking for basic parallel processes, FSTTCS'96, Hyderabad, Lecture Notes in Comput. Sci. 1180, V. Chandru and V. Vinay, eds. Springer (1996), 88-99. R. Mayr, Model checking PA-processes, CONCUR'97, Warsaw, Lecture Notes in Comput. Sci. 1243, A. Mazurkiewicz and J. Winkowski, eds. Springer (1997), 332-346. R. Mayr, Decidability and Complexity of Model Checking Problems for Infinite-State Systems, Ph.D. thesis, Technische Universitat Miinchen (1998). R. Mayr, Strict lower bounds for model checking BPA, Electron. Notes in Theoret. Comput. Sci. 18 (1998). R. Mayr, On the complexity of bisimulation problems for basic parallel processes. Submitted for publication. R. Mayr, On the complexity of bisimulation problems for pushdown automata. Submitted for publication. R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer (1980). R. Milner, A complete inference system for a class of regular behaviours, J. Comput. and System Sci. 28 (1984), 439-466. R. Milner, Communication and Concurrency, Prentice-Hall (1989). R. Milner and F. Moller, Unique decomposition of processes, Theoret. Comput. Sci. 107 (1993), 357-363.
622
O. Burkart et ah
[117] M. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall (1967). [118] F. Moller, Infinite results, CONCUR'96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 195-216. [119] F. Moller, A taxonomy of infinite state processes. Electron. Notes in Theoret. Comput. Sci. 18 (1998). [120] F. Moller and G. Birtwistle, eds. Logics for Concurrency, Lecture Notes in Comput. Sci. 1043, Springer (1996). [121] E.F Moore, Gedanken experiments on sequential machines. Automata Studies (1956), 129-153. [122] D.E. Muller and P.E. Schupp, The theory of ends, pushdown automata and second-order logic, Theoret. Comput. Sci. 37 (1985), 51-75. [123] D. Niwinski, On fixed-point clones, ICALP'86, Rennes, Lecture Notes in Comput. Sci. 226, L. Kott, ed.. Springer (1986), 464^73. [124] D. Niwinski, Fixed point characterization of infinite behaviour of finite state systems, Theoret. Comput. Sci. 189(1997), 1-69. [125] D. Park, Concurrency and automata on infinite sequences, 5th GI Conference on Theoret. Comput. Sci., Karlsruhe, Lecture Notes in Comput. Sci. 104, P. Deussen, ed.. Springer (1981), 167-183. [126] J.L. Peterson, Petri Net Theory and the Modelling of Systems, Prentice-Hall (1981). [127] A. Pnueli, The temporal logic of programs, FOCS'77, Providence, IEEE Comput. Soc. Press (1977), 4657. [128] R.O. Rabin, Decidability of second-order theories and automata on infinite trees. Trans. Amer. Math. Soc. 141 (1969), 1-35. [129] L. Redei, The Theory of Finitely Generated Commutative Semigroups, Oxford University Press (1965). [130] A. Salomaa, Two complete axiom systems for the algebra of regular events, J. ACM 13 (1966), 158-169. [131] H. Seidel and B. Steffen, Constraint-based inter-procedural analysis of parallel programs, ESOP'OO, Beriin, Lecture Notes in Comput. Sci. 1782, G. Smolka, ed.. Springer (2000), 135-150. [132] G. Senizergues, The equivalence problem for deterministic pushdown automata is decidable, ICALP'97, Bologna, Lecture Notes in Comput. Sci. 1256, P. Degano, R. Gorrieri and A. Marchetti-Spaccamela, eds. Springer (1997), 671-681. [133] G. Senizergues, L(A) = L(B)? Technical Report 1161-97, LaBRI, Bordeaux, France (1997). [134] G. Senizergues, Decidability of bisimulation equivalence for equational graphs of finite out-degree, FOCS'98, Palo Alto, IEEE Comput. Soc. Press (1998), 120-129. [135] A.P. Sistla and E.M. Clarke, The complexity ofpropositional linear temporal logic, J. ACM 32 (3) (1985), 733-749. [136] C. Stirling, Local model checking games, CONCUR'95, Philadelphia, Lecture Notes in Comput. Sci. 962, I. Lee and S.A. Smolka, eds. Springer (1995), 1-11. [137] C. Stirling, Decidability of bisimulation equivalence for normed pushdown processes, CONCUR'96, Pisa, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer (1996), 217-232. [138] C. Stirling, Decidability ofdpda equivalence. Technical Report ECS-LFCS-99-411, Department of Computer Science, University of Edinburgh, UK (1999). [139] J. Stffbma, Hardness results for weak bisimilarity of simple process algebras. Electron. Notes in Theoret. Comput. Sci. 18(1998). [140] A. Tarski, A lattice-theoreticalfixpointtheorem and its applications. Pacific J. Math. 5 (1955), 285-309. [141] D. Taubner, Finite Representations of CCS and TCSP Programs by Automata and Petri Nets, Lecture Notes in Comput. Sci. 369, Springer (1989). [142] W. Thomas, A combinatorial approach to the theory of o)-automata. Inform, and Control 48 (1981), 261283. [143] L.G. Valiant and M.S. Paterson, Deterministic one-counter automata, J. Comput. and System Sci. 10 (1975), 340-350. [144] M.Y. Vardi, A temporal fixpoint calculus, POPL'88, San Diego, ACM Press (1988), 250-259. [145] M.Y. Vardi, Alternating automata and program verification. Computer Science Today: Recent Trends and Developments, Lecture Notes in Comput. Sci. 1000, J. van Leeuwen, ed.. Springer (1995), 471^85. [ 146] M.Y. Vardi and P. Wolper, Automata-theoretic techniques for modal logics ofprograms, J. Comput. System Sci. 32 (1986), 183-221.
Verification on infinite
structures
623
[147] K. Varpaaniemi, Prod 3.3.02: An advanced tool for efficient reachability analysis. Technical report. Department of Computer Science and Engineering, Helsinki University of Technology, Finland, 1998. Available at http://www.tcs.hut.fi/pub/prod. [148] F. Wallner, Model checking LTL using net unfoldings, CAV'98, Vancouver, Lecture Notes in Comput. Sci. 1427, A.J. Hu and M.Y. Vardi, eds. Springer (1998), 207-218. [149] I. Walukiewicz, Pushdown processes: Games and model-checking, CAV'96, New Brunswick, Lecture Notes in Comput. Sci. 1102, R. Alur and T.A. Henzinger, eds. Springer (1996), 62-74. [150] H. Yen, A unified approach for deciding the existence of certain Petri net paths. Inform, and Comput. 96 (1)(1992), 119-137.
Subject index alternation depth, 598 base, 573 Basic Parallel Processes (BPP), 553 Basic Process Algebra (BPA), 553 bisimulation base, 568 bisimulation equivalence, 558 bisimulation game, 558 bisimulation relation, 558 Cancellation Lemma - for normed BPA, 566 - for normed BPP, 568 Chomsky hierarchy of process classes, 552, 561 complete base, 578 Computation tree logic (CTL), 595 Constrained Linear Temporal Logic (CLTL), 601 decomposing function, 573 determinacy, 557 Dickson's lemma, 551 EF, 595 EG, 595 finite-branching, 559 finite-state automata (FSA), 552 full base, 573 graph grammar, 608 halting problem, 587 Hennessy-Milner Logic (HML), 594 image-finite, 559 labelled transition system (LTS), 551 language, 556 language equivalence, 557 Linear Temporal Logic (LTL), 600 Linear-Time ^-Calculus (LT^), 601
macro processes, 609 Minskey machines, 586 Modal ^.-calculus, 596 multiset automata (MSA), 555 nesting depth, 595 norm, 557 one-counter automata, 565 one-counter nets, 565 parallel labelled rewrite transition, 551 path, 594 Petri nets (PN), 556 positive normal form, 595 Presburger Computation Tree Logic (PCTL), 598 prime process, 566 Process Algebra (PA), 565 push-down automata (PDA), 554 RECRat graphs, 608 regular graphs, 607 run, 594 sequential labelled rewrite transition system, 551 simple grammars, 576 simulation equivalence, 590 simulation preorder, 590 simulation relation, 590 stratified bisimulation relations, 559 UB, 595 unique decomposition base, 576 Unique Factorization Theorem - for normed BPA, 567 - for normed BPP, 567 Unique solutions lemma, 569 weak bisimulation equivalence, 589 Weak Linear Temporal Logic (WL), 599
This Page Intentionally Left Blank
Part 4 Extensions
This Page Intentionally Left Blank
CHAPTER 10
Process Algebra with Timing: Real Time and Discrete Time J.C.M. Baeten', C.A. Middelburg'-^ Computing Science Department, Eindhoven University of Technology, P.O. Box 513, 5600 MB Eindhoven, The Netherlands ^ Department of Philosophy Utrecht University, P.O. Box 80126, 3508 TC Utrecht, The Netherlands E-mails: josb @ win. tue. nl, keesm @ win. tue.nl
Contents 1. Introduction 2. Real time process algebra: absolute timing 2.1. Basic process algebra 2.2. Algebra of communicating processes 2.3. Time-stamped actions 3. Extension of ACP^^^ 3.1. Integration 3.2. Initial abstraction 3.3. Standard initialization axioms 4. Real time process algebra: relative timing 4.1. Basic process algebra 4.2. Algebra of communicating processes 4.3. Embedding ACP''^ in ACP'^V 5. Discrete time process algebra 5.1. Discrete time process algebra: absolute timing 5.2. Discrete time process algebra: relative timing 5.3. Embedding ACP^^V in ACP^^^y 6. Concluding remarks A. Proofs of theorems Al. Theorem 6 A2. Theorem 12 References Subject index
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
627
629 631 632 640 643 645 646 648 652 652 652 656 657 660 661 666 669 673 674 674 678 681 683
628
J.C.M. Baeten, CA. Middelburg
Abstract We present real time and discrete time versions of ACP with absolute timing and relative timing. The starting-point is a new real time version with absolute timing, called ACP^^^ featuring urgent actions and a delay operator. The discrete time versions are conservative extensions of the discrete time versions of ACP being known as ACPjat and ACPdrt- The principal version is an extension of ACP^^^ with integration and initial abstraction to allow for choices over an interval of time and relative timing to be expressed. Its main virtue is that it generalizes ACP without timing and most other versions of ACP with timing in a smooth and natural way. This is shown for the real time version with relative timing and the discrete time version with absolute timing.
Process algebra with timing: real time and discrete time
629
1. Introduction Algebraic concurrency theories such as ACP [13,11,10], CCS [33,34] and CSP [18, 28] have been extended to deal with time-dependent behaviour in various ways. First of all, timing is either absolute or relative and the time scale on which time is measured is either continuous or discrete. Besides, execution of actions and passage of time are either separated or combined. Separation corresponds to the two-phase scheme of modehng time-dependent behaviour and combination corresponds to the time-stamping scheme. Absolute timing and relative timing have been studied in the framework of ACP for both a continuous time scale and a discrete time scale. See, e.g., [2] and [7]. The versions of ACP with timing where time is measured on a continuous time scale are usually called real time versions. In the remainder of this chapter, we adhere to this terminology. In the principal real time versions of ACP, viz. ACPp and ACPrp, which were both introduced in [2], and ACPpa, which was introduced in [4], execution of actions and passage of time are combined. On the contrary, they are separated in the principal discrete time versions of ACP, viz. ACPdat and ACPdn. which were both introduced in [7]. A real time version where execution of actions and passage of time are separated is ACPst, which was introduced in [6], and [8] focusses on discrete time versions where they are combined. Measuring time on a discrete time scale does not mean that the execution of actions is restricted to discrete points in time. In the discrete time versions of ACP, time is divided into time sHces and timing of actions is done with respect to the time slices in which they are performed - within a time slice there is only the order in which actions are performed. Thus, the discrete time versions permit to consider systems at a more abstract level than the real time case, a level where time is measured with finite precision. This also occurs in practice: software components of a system are executed on processors where the measure of time is provided by a discrete clock and, in case a physical system is controlled, the state of the physical system is sampled and adjusted at discrete points in time. In any case, the abstraction made in the discrete time versions makes the time-dependent behaviour of programs better amenable to analysis. ACP can simply be embedded in the discrete time versions ACPdat and ACPdn [7] by projecting the untimed process a (for each action a) onto the delayable process a - a delay able process a is capable of performing the action a in any time slice. Similarly, ACP can be embedded in the real time versions ACPp and ACPrp [2]. In other words, these discrete time and real time theories generalize the time free theory smoothly. Furthermore, in the discrete time case as well as the real time case, the relative time version can simply be embedded in the absolute time version extended with an initial abstraction operator to deal with relative timing. However, the real time versions do not generalize the discrete time versions as smoothly as they generalize the time free theory. It turns out, as shown in [3], that the discrete time processes correspond to the real time processes for which the following holds: (1) if an action can be performed at some time p € R such that « < p < n + 1 (A? G N), it can also be performed at any other time p' G M such that M < p' < n -h 1; (2) no actions can be performed at times p G N. Clearly, such an embedding seriously lacks naturalness. The real
630
J.C.M. Baeten, CA. Middelburg
time versions ACPp and ACPr/o as well as the discrete time versions ACPdat and ACPdn are generalizations of ACP by intention. Since the real time versions were developed in advance of the discrete time versions, the former versions were not intentionally developed as generalizations of the latter versions. This explains at least partially the contrived embedding. In this chapter, we present a new real time version of ACP with absolute timing which originates from ACPsp, a real time version introduced in [6]. In this version, which features urgent actions and a delay operator, execution of actions and passage of time are separated. We explain how execution of actions and passage of time can be combined in this version. We further add an integration operator, with which a choice over an interval of time can be expressed, and an initial abstraction operator, with which relative timing can be expressed, to this version. We show how a real time version of ACP with relative timing, which originates from ACPst [6], can be embedded in the extended real time version with absolute timing. We also present discrete time versions of ACP with absolute timing and relative timing which are conservative extensions of ACPdat and ACPdrt [7]. We add an initial abstraction operator to the discrete time version with absolute timing as well. Showing how the discrete time version with relative timing can be embedded in the extended discrete time version with absolute timing, can be done similarly to the real time case. We show that the extended real time version generalizes the extended discrete time version smoothly. In this case, the following holds for those real time processes that correspond to the discrete time processes: if an action can be performed at some time /? € M such that « ^ /7 < /I -h 1 (n G N), it can also be performed at any other time p' eR such thatn ?' < « + l. The main virtue of the extended real time version of ACP presented here is that it generalizes time free ACP as well as most other versions of ACP with timing in a smooth and natural way. The lack of a real time version of ACP with these characteristics was our main motivation to develop it. Different from the real time versions of [2] and [4], this version does not exclude the possibility of two or more actions to be performed consecutively at the same point in time. That is, it includes urgent actions, similar to ATP [37] and the different versions of CCS with timing [19,35,44]. This is useful in practice when describing and analyzing systems in which actions occur that are entirely independent. This is, for example, the case for actions that happen at different locations in a distributed system. In [2] and [4], the main idea was that it is difficult to imagine that actions are performed consecutively at the same point in time. But yet, this way of representing things is perfectly in line with modeling parallelism by interleaving. In point of fact it allows for independent actions to be handled faithfully. In [2] and [4], ways to deal with independent actions are proposed where such actions take place at the same point in time by treating it as a special case of communication. This is, however, a real burden in the description and the analysis of the systems concerned. Of course, this does not limit the practical usefulness of ACPp and ACPrp for systems in which no independent actions occur. The real time versions ACPsp and ACPst of [6] simply do not exclude the possibility of two or more actions to be performed consecutively at the same point in time. Embedding in ACP/O and ACPr/o, respectively, is obtained by extending the time domain to a domain that includes non-standard real numbers. We con-
Process algebra with timing: real time and discrete time
631
jecture that the real time version presented in this chapter, which originates from ACPsp, can be embedded in ACPp as well. We do not intend to give in this chapter a comprehensive overview of existing algebraic concurrency theories that deal with time-dependent behaviour. As suggested by the above, our aim is instead to present a coherent collection of algebraic concurrency theories that deal with time-dependent behaviour in different ways. The structure of this chapter is as follows. First of all, in Section 2, we present the new real time version of ACP with absolute timing. We also explain how execution of actions and passage of time can be combined in this version. Then, in Section 3, we add integration and initial abstraction to this real time version of ACP. Next, in Section 4, we first present a real time version of ACP with relative timing and then show that it can be embedded in the real time version of ACP with absolute timing presented in Sections 2 and 3. After that, in Section 5, we first present conservative extensions of the discrete time versions ACPdat and ACPdrt of [7] and then show that the presented discrete time version with absolute timing can be embedded in the real time version with absolute timing presented in Sections 2 and 3. Finally, in Section 6, we make some concluding remarks.
2. Real time process algebra: absolute timing In this section, we give the signature, axioms and term model of ACP^^S a standard real time process algebra with absolute timing. In this theory, the non-negative standard real numbers (R^o) are used as the time domain. ACP^^^ originates from the theory ACPsyo, presented in [6]. Unlike ACPsp, it separates execution of actions and passage of time. In case of ACP^^^ it is assumed that a theory of the non-negative real numbers has been given. Its signature has to include the constant 0 : -^ M^o. the operator -h : M^o x R^o -^ M^o. and the predicates ^ : M^o x R^o and = : R^o x R^Q. In addition, this theory has to include axioms that characterize -h as a commutative and associative operation with 0 as a neutral element and ^ as a total ordering that has 0 as its least element and that is preserved by -I-. In ACP^^\ as in the other versions of ACP with timing presented in this chapter, it is assumed that a fixed but arbitrary set A oi actions has been given. It is also assumed that a fixed but arbitrary communication function, i.e. a partial commutative and associative function y : A x A -> A, has been given. The function y is regarded to give the result of the synchronous execution of any two actions for which this is possible, and to be undefined otherwise. The weak restrictions on y allow many kinds of communication between parallel processes to be modeled. First, in Section 2.1, we treat BPA^^\ basic standard real time process algebra with absolute timing, in which parallelism and communication are not considered. After that, in Section 2.2, BPA^^^ is extended to ACP^^^ to deal with parallelism and communication as well. Finally, we demonstrate in Section 2.3 how one can combine execution of actions and passage of time in ACP^^^
632
J.CM. Baeten, CA. Middelburg
2.1. Basic process algebra In BPA^^\ we have the sort P of (absolute time) processes, the constants a (one for each a G A), 5 and 5, and the operators o^^^ (absolute delay), • (sequential composition) and + (alternative composition). The constants a stand for a at time 0. Similarly, the constant 6 stands for a deadlock at time 0. The constant h stands for an immediate deadlock, a process that exhibits inconsistent timing at time 0. This means that h, different from 5, is not existing at time 0. The process o^^^^{x) is the process x shifted in time by p. Thus, the process cf^^^^ia) is capable of first idling from time 0 to time p and then upon reaching time p performing action a, immediately followed by successful termination. The process a^^5(5) is only capable of idling from time 0 to time p. Time p can be reached by o^^^(h). This is the difference with the process o^^^^(h), which can only idle upto, but not including, time p. So o^^^{S) can not reach time p. The process jc • y is the process x followed upon successful termination by the process y. The process jc + >' is the process that proceeds with either the process x or the process y\ but not both. As in the untimed case, the choice is resolved upon execution of the first action, and not before. We also have the auxiliary operators v^^^ (absolute time-out) and v^^^ (absolute initialization). The process v^^^{x) is the part of x that starts to perform actions before time p. The process V^}Q^{X) is the part of X that starts to perform actions at time p or later. A real time version of ACP with absolute timing where the notation a was used earlier for urgent actions is ACPsp [6], but there it always carries a time-stamp. The binary operator a^jjg generalizes the unary operator dabs of ACPdat [7] in a real time setting: for a real time process x that corresponds to a discrete time process x\ crl^^^ix) corresponds to <^abs(-^0- In earlier papers, including [2-4,6], the notations JC > /? and p:^ x were used instead of v^^^{x) and v^^^{x), respectively. Besides, the time-out operator and the initialization operator were sometimes called the bounded initialization operator and the time shift operator, respectively. It can be proved, using the axioms of BPA^^\ that each process expressed using the auxiliary operators v^^^ and v^^^ is equal to a process expressed without them. In other words, in BPA^^S all processes can be constructed from the constants using absolute delay, alternative composition and sequential composition only. SIGNATURE OF BPA^^^ The signature of BPA^^^ consists of the urgent action constants a : -> P (for each a e A), the urgent deadlock constant ^ : -> P, the immediate deadlock constant 5 : ^- P, the alternative composition operator + : P x P -> P, the sequential composition operator • : P x P -^ P, the absolute delay operator a^^^ : M^o x P -> P, the absolute time-out operator v^^^ : E^o x P ^^ P. and the absolute initialization operator ^abs-^^OxP^P.
We assume that an infinite set of variables (of sort P) has been given. Given the signature of BPA^^^ terms of BPA^^S also referred to as process expressions, are constructed in the usual way. We will in general use infix notation for binary operators. The need to use parentheses is further reduced by ranking the precedence of the binary operators. Throughout this chapter we adhere to the following precedence rules: (i) the operator •
Process algebra with timing: real time and discrete time
633
has the highest precedence amongst the binary operators, (ii) the operator -f has the lowest precedence amongst the binary operators, and (iii) all other binary operators have the same precedence. We will also use the following abbreviation. Let (f,)/Gj be an indexed set of terms of BPA^^^ where J = {/i,..., /„}. Then we write YlieX ^' ^^^ ^'i ~t ^ ^'» • We further use the convention that X!j eZ ^i stands for 5 if J = 0. We denote variables by x,x',y,y\ An important convention is that we use a, a\ b, b\ ... to denote elements of A U {6} in the context of an equation, and elements of A in the context of an operational semantics rule. Furthermore, we use H to denote a subset of A. We denote elements of M^o by p, p',q,q' and elements of R>o by r, r'. We write A5 for AU {^}. AXIOMS OF BPA^^^
The axiom system of BPA^^^ consists of the equations given in Ta-
bles 1 and 2. Axioms A1-A5 are common to AC? and all real and discrete time versions of ACP. Axioms A6ID and A7ID are simple reformulations of the axioms A6 and A7 of ACP: the constant 6 has been replaced by the constant h - which is introduced because the intended interpretation of 5 in ACP"^^^ differs from h. These axioms or similar reformulations of A6 and A7 are found in all real and discrete time versions of ACP. Axiom SATl, and a few axioms treated later, become easier to understand by realizing that in BPA^^\ as well as in ACP^^^ the equation v^^^it) = t is derivable for all closed terms t. This equation expresses that initialization at time 0 has no effect on processes with absolute timing. To accommodate for the extension with initial abstraction in Section 3.2, we have used UgjjgCjc) instead of x where the former is needed in the extension. Axioms SATl and SAT2 point out that a time shift by 0 has no effect in case of absolute timing and that consecutive time shifts add up. Axioms SAT3-SAT5 represent the interaction of absolute delay with alternative composition and sequential composition. Axiom SAT3, called the time factorization axiom, shows that passage of time by itself can not determine a choice. Axioms SAT4 and SAT5 express that if a process terminates successfully at some point in time, it can only be followed by the part of another process that starts to perform actions at the same time or later. Axiom SAT6 is a generalization of axiom A7ID. Using axioms A6SAa and A6SAb, the equation t -\-l = t can be derived for all closed terms t unless t — 6 -
Table 1 Axioms of BPA with immediate deadlock jc-)-V = V + ^
Al
(x + v)-Hz = jc+ (>' + :) A2 jc + X = jr
A3
(^ -f v) • z = X • z + V • z
A4
(jc.v)-2=-x-(vz) jc-f5 = jc
A5 A6ID
h-x = h
A7ID
634
J.C.M. Baeten, C.A. Middelburg Table 2 Additional axioms for BPA^^^ (a 6 A^, /?,^ ^ 0, r > 0) <^S,s(^) = ^abs<^)
SATl
<^£,s«^abs(^)) = < b t ' ( ^ )
SAT2
< b s W + <^a''bs<-V) =
SAT3
< ^ a ' ' b s W < b s W = '^^s<'^-^)
SAT4
< ^ L ( ^ ) • ("rbs(.v) +
A6SAa
A6SAb
^•JC=5
A7SA
SATOO
^absW=^
SATOl
^abs(^)=^
SAT02
< b t ' ( < b s ( ^ ) ) =
SAT03
^ L ^ ^ + :^) = ^fbs^-^) + ^abs(>')
SAT04
^abs(-^->') = ^abs(-^)>'
SAT05
^a'bs(^) = ^
SAIOa
^;bs(^) = ^abs(^)
SAIOb
^abs(«) = ^
SAIl
^abs(^) =
SAI2
^ a b t ' ( < b s ( ^ ) ) =
SAB
^rbs(^ + ^ ) = ^ a b s ( ^ ) + < b s ( v )
SAM
^fbs(^-3'> = ^abs(-^)>'
SAI5
obviously h-\-l = l. Axiom ATS A is another simple reformulation of axiom A7 of ACP. Axioms S ATOO-S AT05 and S AIO-S AI5 reflect the intended meaning of the time-out and initialization operators clearly. Axioms SATOl and SAI2 make precise what happens if a part that starts to perform actions before the time-out time and a part that starts to perform actions at the initialization time or later, respectively, do not exist. Equations SAT03' and SAI3' given in Table 3 are derivable from the axioms of BPA'^^ In BPA'^^ and ACP'^\ and also in the further extension with initial abstraction, axiom SATOl can be replaced by equation SAT03' just as well. In BPA^^^ and ACP'^^ but not in the further extension with initial abstraction, axioms SAIOa, SAIl and SAD together can be replaced by the equations SAIl'' and SAI3'' given in Table 3. The absolute initialization operator could have been added later with the addition of the initial abstraction operator. However, having it available in BPA^^^ and ACP^^^ makes it possible to express interesting properties of real time processes with absolute timing such as the properties presented in Lemmas 1 and 3 below. We can prove that the auxiliary operators 1^3^55 ^^d v^^^ can be eliminated in closed terms of BPA^^^ We can also prove that sequential compositions in which the form of the
Process algebra with timing: real time and discrete time
635
Table 3 Some derivable equations and alternative axioms {p,q > 0)
vl^,{x) = x
SAIl"
< b t ' ( < b s ( ^ ) ) =
first operand is not a {a e k) and alternative compositions in which the form of the first operand is cj^^^it) can be ehminated in closed terms of BPA'^^ The terms that remain after exhaustive elimination are called the basic terms over BPA^^^ Because of this elimination result, we are permitted to use induction on the structure of basic terms over BPA^^^ to prove statements for all closed terms of BPA^^^. EXAMPLES.
We give some examples of a closed term of BPA'^^ and the corresponding
basic term: 4s(^)-^abs(^)=^abs(^-^) 4 s ( « ) •(4s(^) + 4s(^)) = 4 s ( ^ • 4s(^))
4s(4s(^)+4s(^))=4s (^+4s(^)) ^abs(4s(^) + 4 s ( ^ ) ) = 4 s ( ^ )
The following lemmas are also useful in proofs. They are, for example, used in the proof of Theorem 12 (embedding of ACP^^V in ACP'^^IV). These lemmas, as most other lemmas in this chapter, call for proofs by induction on the structure of basic terms. The proofs are generally straightforward, but long and tedious. For that reason, we will present for each such proof only one of the cases to be treated. The selected case is usually typical of the proof and relatively hard. We write = to indicate that the induction hypothesis of the proof is used. LEMMA 1. In BPA^^^ and ACP'^^^ as well as in the further extensions with restricted integration and initial abstraction introduced in Section 3: 1. the equation t — 4 s ( ^ ) + ^abs(^) ^^ derivable for all closed terms t such that t = 17^,3 ( O a n J r = r + 4 3 ( 5 ) ; 2. the equations t = 4 s (^) ^^^ ^^bs^^) = 4 s ( ^ ) ^^^ derivable for all closed terms t such that t = FgbsCO and t^^t-^- 4 s ( ^ ) -
it is straightforward to prove both 1 and 2 by induction on the structure of t. 1. We present only the case that t is of the form ol^^{t'). The other cases are similar, but simpler, and do not require case distinction. PROOF,
636
J.CM. Baeten, CA. Middelburg
Case p^,:
a^^,^it') + a^,^i8) '=^ a^,^i8) + a^^,^it^) '^''^'''
v[,^ia^,,(t'))
Case p>,:
a^^,^it^) + a^.^iS) '^^^ a^^,,ir^) + a^,,,ia^,-^^ (5)) ' ^ ol,,it'
+
v',,,ic.^,y))
+ a^,-^' (8)) 15
In applying SAB we assume that t' = v^^^s^t'). In case of BPA^^^ ACP^^^ and ACP^^^ with integration, this equation is derivable for all closed terms t'. The assumption is also justified in case of extension with initial abstraction. In that case, we are permitted, because of elimination results presented in Section 3.2, to consider here only closed terms of the form cr^^^it') where no initial abstraction occurs in r^ 2. Observe that v^^^(t) = c^abs^^^ follows immediately from t = v^^^^it) by axiom SI3. So it suffices to prove only t = v^^^{t). Again, we present only the case that / is of the form cTg^^g^^'^Case p^g:
a^^^t') ^^^ .[,,ic^^/u'))
Case p>g:
al,^(t') + a^^.^)
^^^
+ a^,^i8) '^^U^' t'^t'^
By the induction hypothesis, a'^^^)
a^'
(S)
= a^^sC^b? (^')) ' =""' ^bsK'bs^^'))
^
From Lemma 1 we readily conclude the following. C O R O L L A R Y 2. In BPA^^^ and ACP^^S as well as in the further extensions with restricted integration and initial abstraction introduced in Section 3, the equation cr^^^(t) • t' = ^a^bs(^) • v^^^(t') is derivable for all closed terms t and t' such that t' = t^abs^^')L E M M A 3. In BPA^^^ and ACP^^^ as well as in the further extensions with restricted integration and initial abstraction introduced in Section 3, for each /? € R ^ o ^ " ^ ^^ch closed term t, there exists a closed term t' such that t'abs^^) — ^abs(^') ^^^ ^' ~ ^abs^^'^- ^^ ^^^~ sequent proofs, we write t[p] for a fixed but arbitrary closed term t' that fulfills these conditions. P R O O F , it is straightforward to prove this by induction on the structure of r. We present only the case that t is of the form (^^^^(t"). Again, the other cases are similar, but simpler, and do not require case distinction. Case p^q:
v^i-LC"))
' = ' -a'bsC") " " ^bs'^aVs"*'")) » d
C.scp>q:v[,^(a!,^ir''))'^'a^^,^(V[,-Ur^^^^^^ In applying SAB we assume that t" = '^%^^{t"). As described in the previous proof, this assumption is justified in all cases. D Lemma 1 indicates that a process that is able to reach time p can be regarded as being the alternative composition of the part that starts to perform actions before p and the part that
Process algebra with timing: real time and discrete time
637
starts to perform actions at p or later. Lemma 3 shows that the part of a process that starts to perform actions at time p or later can always be regarded as a process shifted in time by/7. SEMANTICS OF BPA^^^ A real time transition system over A consists of a set of states S, a root state p eS and four kinds of relations on states:
a binary relation a unary relation a binary relation a unary relation
(_, /?> A (_, p) for each a eA, p e R^o, (_,/?) A (^, p) for each a e A, p e E^o. (_,/?) h4 (_,g) for each r e E>o, p,g ^ E^o where q^ ID(_, p) for each p e E^o;
p-\-r,
satisfying (1) if {s, p) \^—> {s\ q), r, r' > 0, then there is a s" such that (^, p) ^
{s", p-\-r) and
{s\p^r)^{s\qy. r-\-r
(2) if (5, p) \-> {s'\ p-\-r) and {s", p-^r)\-^ {s\ q), then {s, p) i > {s\ q). The four kinds of relations are called action step, action termination, time step and immediate deadlock relations, respectively. We write RTTS(A) for the set of all real time transition systems over A. We shall associate a transition system TS(r) in RTTS(A) with a closed term t of BPA'^^^ by taking the set of closed terms of BPA^^^ as set of states, the closed term t as root state, and the action step, action termination, time step and immediate deadlock relations defined below using rules in the style of Plotkin [38]. A semantics given in this way is called a structural operational semantics. On the basis of these rules, the operators of BPA^^^ can also be directly defined on the set of real time transition systems in a straightforward way. Note that, by taking closed terms as states, the relations can be explained as follows: {t, p) A (r^ p)\ process t is capable of first performing action a at time p and then proceeding as process t'\ {t, p) A {y, p)\ process / is capable of first performing action a at time p and then terminating successfully; (t, p) \-^ {t',q): process / is capable of first idling from time p to time q and then proceeding as process t'; ID(r, p): process t is not capable of reaching time p. The rules for the operational semantics have the form c//..'. ,C;,' ' where s is optional. They are to be read as "if h \ and ... and h^ then c\ and ... and c„, provided s'\ As customary, /z i , . . . , /i,„ and c i , . . . , c„ are called the premises and the conclusions, respectively. The conclusions of a rule are positive formulas of the form {t, p) A- {t\ /?), (r, p) A (y, p), (r, p) A (t\q) or ID(r, /?), where t and t' are open terms of BPA''*^ The premises of a rule are positive formulas of the above forms or negative formulas of the form -^ID(r, p). The rules are actually rule schemas. The optional s is 3. side-condition restricting the actions over which a, b and c range and the non-negative real numbers over which /7, q and r range. Within the framework of term deduction systems introduced in [9],
638
J.CM. Baeten, CA. Middelburg
the instances of the rule schemas that satisfy the stated side-conditions should be taken as the rules under consideration. For the rest, we continue to use the word rule in the broader sense. The signature of BPA^^^ together with the rules that will be given constitute according to the definitions of [43] a strictly stratifiable term deduction system. For a term deduction system having rules with negative premises, it is not immediately clear whether the term deduction system is meaningful. That is, it is not clear whether there exist relations for which exactly those formulas hold that can be derived using the rules of the term deduction system (see, e.g., [25] and [15]). However, if the term deduction system is stratifiable then there exist such relations. If it is strictly stratifiable then there exist unique such relations. The restriction to stratifiable term deduction systems is essential for the congruence theorem mentioned below. Term deduction systems support only unary and binary relations on closed terms over some one-sorted signature. Generalization to the many-sorted case is harmless if it is confined to unary and binary relations on closed terms of one of the sorts. Therefore, we chose to have, for instance, many binary action step relations for each action in A, viz. one for each element of M^o. instead of one ternary or quaternary relation. For the operational semantics of BPA^^\ as well as ACP^^^ and the further extensions described in Section 3, we will only define time step relations for which (r, p) \-^ {t\ q) holds only if r = r^ The given rules define relations for which exactly those formulas hold that can be derived using the rules. Consequently, there are no rules with conclusions of the form {x,p) \-^ {x\q) where x ^ x'. Hence, it makes no difference if in a rule a premise of the form (x, /?) i-> {x,q) is replaced by {x, p) y^ {x\q) if jc' is a variable different from the variables occurring in the rule. We prefer the premises of the form {x, p) \-^ {x,q) because they are better suited to a natural explanation of the rules. However, the replacements are usually needed whenever general results about term deduction systems, e.g., results of [43], are used. In the remainder of this chapter, we will refrain from making mention of the need for the replacements because they are trivial and make no difference with respect to the relations defined. The structural operational semantics of BPA^^^ is described by the rules given in Table 4. These rules are easy to understand. We will only explain the rules for the absolute delay operator (or^^s)- ^ ^ ^^^^ P^^^ ^^ ^^^ expresses that the action related capabilities of a process
Process algebra with timing: real time and discrete time Table 4 Rules for operational semantics of BPA^^^ (a e A, r > 0, p,q
\D{8,p) \D(8,r)
(a,0)^(y,0)
{x,p) A {x',p) (^abs(^)' P) ^
{x,p) A
(-^^ P)
^0)
ID(a,r)
{^,p)
(^abs^^)' /^) ^
(^, P) A (jc', /7)
(A-, p) A (V, p)
{x, p) i-> (.y, p + r)
IDU,p)
(? > p
-^ID(.x:,0)
( ^ a b t ' W ' / ^ ) ^ (^abt'(^)'/' + '-)
K b t ' ( ^ ) ' ^ ) ^ (^abr(^)'^+'-)
{X + V, /7) A {x\ p), (y +x,p)^ {x\ p)
{X + y, p) A (V, p), (y + X, p) A (^, p)
{x,p)^
{x,p-\-r)
{x + y, p)\^
{x -{- y, /7 -I- r),
(y + A, p) 1-^ (y + :<:, /? + r)
\D{x,p), ID(y,p) ID(A- + y, p)
( X , P ) A {x\p) {x -y^p) {x,p)h-^ {x
(.V • y, /?) A (y, p)
-^ ix' • y, p) (-^,p + r)
ID(.V,/7)
IDU • y, p)
•y,p)h-> (^•y,/7 + r)
{x,p)^{x'
{x,p) A (V, p), ^ > p
.P)^ q> P a
1 1
\
{vl,(x),p)^U.p)
(^abs(^)'/^) {x,p)h->
{x.,/7 + r), q>
i
p + r
\Dix,p), q > p
+ r)
ID(<'bs(^)'/^)
'D(^L(^)'/^) (.t,p)^(7.p).^^p
(•^,P) A ( x ' ,,p),q^P (^abs(^)'/') (A,/7) A
"v
(JC,, P
(^abs(^)'P)'
/
'
\
+ r), ( 7 ^ /7 + r P + r)
ID(j:.p).
q^p
\D(vl^^(x). p) ^\D(x.q+r)
639
640
J.CM. Baeten, C.A. Middelburg
capable of doing the same step and next going on as a process bisimilar to the subsequent process. More precisely, a bisimulation on RTTS(A) is a symmetric binary relation R on the set of states S such that: (1) if R{s,t) and {s,p) A {s',p), then there is a t' such that {/,/?) A {t\ p) and (2) if R{s, t), then {s, p) A (V, p) iff (r, p) A (V, p); (3) if R{s,t)
and (^,/?) H> (5',<7), then there is a r' such that {t,p) i-^ {r',<5f) and
R{s\ty (4) if /?(^, 0 , then ID(5, p) iff ID(r, p). We say that two closed terms s and t are bisimilar, written 5 1± r, if there exists a bisimulation R such that R(sj). It is known from [43] that if a stratifiable term deduction system is in panth format, bisimulation equivalence as defined here is a congruence for the operators in the signature concerned. This collection of constraints on the form of the rules of a term deduction system is defined in [43] for the one-sorted case, but in case of the real time and discrete time versions of ACP presented in this chapter we have in addition to the sort of processes also the sort of non-negative real numbers or the sort of natural numbers. In order to conform to the panth format as defined in [43], the number of constants and operators in the first argument of a conclusion must be either zero or one. In case of most term deduction systems given in this chapter, this condition is only fulfilled if we disregard constants and operators that do not yield processes. Careful checking of the proof of the congruence theorem for the panth format given in [43], the only result about the panth format that we will use, shows that the result goes through for the many-sorted case if the above-mentioned condition is relaxed in such a way that only the number of constants and operators that yield processes is restricted to zero or one. Therefore, we will refer to this panth-like format in the remainder of this chapter as the panth format. We note here that checking of the proof of the congruence theorem includes checking of the proofs of many related lemmas and theorems given in [15] and [43]. For a comprehensive introduction to rule formats guaranteeing that bisimulation equivalence is a congruence, the reader is referred to [1]. The signature of BPA^^^ together with the rules for the operational semantics of BPA^^^ constitute a stratifiable term deduction system in panth format. Consequently, bisimulation equivalence is a congruence for the operators of BPA^^^ For this reason, the operators of gp^sat ^^^ ^Q defined on the set of bisimulation equivalence classes. We can prove that this results in a model for BPA'^^^ i.e. all equations derivable in BPA^^^ hold. In other words, the axioms of BPA^^^ form a sound axiomatization for the model based on bisimulation equivalence classes. As in the case of the other axiomatizations presented in this chapter, we leave it as an open problem whether the axioms of BPA^^^ form a complete axiomatization for this model.
2.2. Algebra of communicating processes In ACP^^^ we have, in addition to sequential and alternative composition, parallel composition of processes. The process x || y is the process that proceeds with the processes x and y in parallel. Furthermore, we have the encapsulation operators 8// (one for each // c A)
Process algebra with timing: real time and discrete time
641
which turns all urgent actions 5, where a e H, into 5. As in ACP, we also have the auxiliary operators [[ (left merge) and | (communication merge) to get a finite axiomatization of the parallel composition operator. The processes x \ly and x \\ y are the same except that X Hy must start to perform actions by performing an action of JC. The processes x \ y and X II y are the same except that JC | y must start to perform actions by performing an action of X and an action of y synchronously. In case of ACP^^S an additional auxiliary operator v^abs (absolute urgent initialization) is needed. The process yabs(-^) is the part of process x that starts to perform actions at time 0. The operator Vabs of ACP^^^ is simply the operator Vabs of ACP^^^ [5] lifted to the real time setting. SIGNATURE OF A C P ' ' ' ^ The signature of ACP''^^ is the signature of BPA'''^ extended with the parallel composition operator ||: P x P ^- P, the left merge operator [[: P x P -> P, the communication merge operator |: P x P ^- P, the encapsulation operators 9// : P ^ P (for each H c A), and the absolute urgent initialization operator Vabs : P ^^ P. AXIOMS OF A C P ' ^ ^ The axiom system of ACP'''^ consists of the axioms of BPA'^^ and the equations given in Table 5.
Axioms CMl, CM4, CMS, CM9, D3 and D4 are common to ACP and all real and discrete time versions of ACP. Axioms CFISA, CF2SA, CM2SA, CM3SA, CM5SA-CM7SA, DISA and D2SA are simple reformulations of the axioms CFl, CF2, CM2, CM3, CMSCM?, Dl and D2 of ACP: constants a {a e ks) have been replaced by constants 5, and in addition to that certain variables x have been replaced by x -f- ^ in CM2SA and CM3SA. Recall that x 4 - 5 = x i f j C 7 ^ 5 , and h-\-l = 1. This means that JC + ^ never stands for h. Axioms SACMl and SACM2 represent the interaction of absolute delay with left merge. Axiom S ACM2 shows that if two parallel processes start to perform actions by performing an action of one of them and that process starts to perform actions at a certain time, only the part of the other process proceeds that starts to perform actions at the same time or later. What happens if such a part does not exist, is reflected more clearly by a generalization of axiom SACMl than by that axiom itself. This generalization, which is derivable from the axioms of ACP^^^ is equation SACMT given in Table 6. Note that a term of the form v^)Q^{y) stands for an arbitrary process that starts to perform actions before time /?; and that a term of the form cf^^^{va!cis{z) 4-1) stands for an arbitrary process that starts to perform actions at time p or deadlocks at time p. So equation SACMl' expresses that if the process that would perform the first action can only do so after the ultimate time to start performing actions or to deadlock for the other process, the result will be a deadlock at this ultimate starting time. Note that in case of sequential processes, the process that would first perform actions can always do so, irrespective of the ultimate starting time for the other process. This difference is apparent from equation SAT4^ given in Table 6, which is derivable from the axioms of ACP^^^ and the standard initialization axioms SI 13 and SI 16 (Table 14, page 651). Axioms SACM3-SACM5 represent the interaction of absolute delay with communication merge. Axioms S ACM4 and S ACM5 are similar to axioms SACMl and SACM2. Axiom SACM3 is needed as well because communication merge requires that both processes concerned start performing actions at the same time.
642
J.CM. Baeten, C.A. Middelburg Table 5 Additional axioms for ACP^^^ (a,b£A8^ CGA, / 7 ^ 0 , r > 0 ) a \b = c \^ y{a,b) = c a \b = 8 \iy(a,b) undefined
CFISA CF2SA
^ll>' = UlL>' + vlL-^) + -^l V Slx = 8 X 18 = 8
CMl
a [LU + ^ ) = « - ( j c + 5 ) ~a • x\^{y V8) =~a• {x\\{y
^8))
CMIDl CMID2 CM2SA CM3SA SACMl
CM6SA
~a-x\b-y
CM7SA
=
{a\b)-{x\\y)
(vabsU) + ^)l
SACM3 SACM4
^ibs^-^) 1 ^ibs^:^) = ^abs^^ 1 >'> U + j) 1 z = X 1 z + V 1 z X 1 (y + z) = A: 1 y + jc 1 z
CMS CM9
a//(i) = i df^(a)=a dH(a)=8
WaiH \iaeH
SACM5
DO DISA D2SA
9//(
SAD
Vabs(^) = <5
SAUO SAUl SAU2 SAU3 SAU4
i^abs(«) = ^ i^abs(<^abs(^)) = ^ v^absU + v) = v^absU) + v^abs(v) v^absU • V) = ^absU) • >'
D3 D4
Axiom SACM5 is simpler than axiom SACM2 just because of the left distributivity of the communication merge (axiom CM9). Equations SACM3' and SACM4' given in Table 6 generaUze axioms SACM3 and SACM4 like equation SACMT generalizes axiom SACMl. Axiom SAD represents the (lack of) interaction of absolute delay with encapsulation. Axioms SAU0-SAU4 reflect the intended meaning of the urgent initialization operator clearly.
Process algebra with timing: real time and discrete time
643
Table 6 Some derivable equations (p^O, r > 0) ^ b f ^ ^ ) • (<s(y)
+
^ b f (^) ^ ( < b s ( v ) +
SACMl'
SACM3'
< b t ' (^) I
SACM4'
We can prove that the operators ||, ll_, |, 9// and Vabs can be eUminated in closed terms of ACP^^^ Because of the ehmination result for BPA^^\ we are permitted to use induction on the structure of basic terms over BPA^^^ to prove statements for all closed terms of ACP^^^ EXAMPLES. We give some examples of a closed term of ACP^^^ and the corresponding basic term (in case y{a,b) and y{a,c) are undefined): ^abs(^) II ^abs(^) • ^a^s(^) = ^abs^^ " ^ " ^ + ^ ' ^) ^abi(«) II ^aVs(^) • ^abs(^) = <^^^
' ^abi^^ " ^ + ^ ' ^))
<^abs(«) II ^abs(^) • ^a'bs(^) = <^^^
' ^abs^^ ' ^abs^^)))
Vabs(cT|bs(^)ll4s(^)-^abs(^)) = ^
SEMANTICS OF ACP^^^ The structural operational semantics of ACP^^^ is described by the rules for BPA^^^ and the rules given in Table 7.
These rules are easy to understand. We will only mention that the first two rules for the parallel composition operator (||) express that a process x loses all its action related capabilities at time p if it is put in parallel with a process y that can not reach time p, and that the last rule for this operator expresses that in such cases the parallel composition can not reach time p either. As in the case of BPA^^S we obtain a term deduction system in panth format that is stratifiable, so bisimulation equivalence is also a congruence for the additional operators of ACP^^^ Therefore, these operators can be defined on the set of bisimulation equivalence classes as well. As in the case of BPA^^\ we can prove that this results in a model for ACP^^^
2.3. Time-stamped actions The real time versions ACPp, ACPrp and ACPpa [2,4] feature time-stamped actions - and thus combine execution of actions and passage of time. The time-stamped actions defined below are more closely related to the ones in ACPsp [6], the real time version of ACP from which ACP''^^ originates. This is because ACPsp, like ACP''^^ and unlike ACPp, ACPrp and ACPpa, does not exclude the possibility of two or more actions to be performed consecutively at the same point in time. Time-stamped actions are defined in terms of urgent actions and the delay operator in Table 8. We also define a time-stamped version of immediate deadlock. In ACPp and ACPrp,
644
J.C.M. Baeten, C.A. Middelburg Table 7 Additional rules for ACP^^^ ( a > , c € A, r > 0, /? ^ 0) {x,p)A{x\p),
-ID(v,/7)
{x II y, p) A (x' II V, p), (V II X, p) A (V II x\ p), {X 11 V, p) A (.v' II V, p) {x,p)-^W,p),
--\D{y\p)
{X II >', p) A (V, p), (y II X, p) A (y, p), (.V li y, /7) A (y, p) {x,p) A (x',p), (y, p) -» (y\ /7), y («, ^) = c c
(^ II y,
a
{x'W y ,P), {X \ y,p) ^ ( : t ' II y'^P)
{x' ,p), (y.^p) ^ ( V ^ P ) , K ( « , b) = c
{X\\y,p)^{x',p), {x\y,p)-^{x\p),
{y\\x,p)^{x\p), {y\x,p)^{x\p)
{X, p) A (y, p), (y, /7) -^ (V, p), x(fl, /?) = c {x\\y,p)^{V,p)^ {x, p) ^ (x \\y,p)y^
{x\y,p)^{V^p) {x,p-\-r),
(y, p) A (y, p-\-r)
(-^ II y , p + r), {x |[y,/7) A (A- |Ly,p4-r), (A ! y , p ) A (A | y , p + r) IDU,P)
IDU||y,p), ID(y||x,p), IDUHy,/?), ID(y [ix,p), ID(x|y,p), ID(yU,p) {x,p)-^{x',p),a^H {dH(x), P) A O/y U'), /7) {x,p)y^
{x,p-\-r)
{x,p)^U,p).aiH O^(.v), p) - ^ (V, p) \D(x,p)
{dH(x),p)^{dH{x),p-\-r)
IDO//(.v),p)
(VabsU),0) A (A',0)
(vabs(-O,0) - ^ (^,0)
ID(jc,0)
ID(yabsU),0)
Table 8 Definitions of time-stamped actions and immediate deadlock (a eAg, p^O)
kp)=<jLi^)
ID(vabsU),r)
Process algebra with timing: real time and discrete time
645
Table 9 Additional axioms for time-stamped actions (a € A^, /7,^ > 0 , r > 0) X + ^(0) = X
A6TSIDa
~8{p) + 8{p)=^8{p)
A6TSIDb
8ip)x=8ip)
A7TSID
aip)-x==a{p)-v^^^^{x) a{p)-\-8(p) = aip)
SATTS A6TSa
8(p-\-r)-\-8ip) = ~8(p-hr) 8{p)-x = 8(p)
A6TSb A7TS
'^abs^kp-\-q))
SATSIl SATSI2
= 8(p-^q)
Kbsi^iP)) = kp-^r)
SATSI3 SATSI4
^abs(^ + - V ) = ^ L ( ^ ) + ^ a b s ^;>') SATSI5 SATSI6 ^abs(^-^) = ^abs^^)>'
which exclude the possibiUty of two or more actions to be performed consecutively at the same point in time, there is no reason to distinguish, for instance, between the processes a{p -h r) • 8{p + r) and a{p -h r) - b(p) (r > 0). In ACP'^S unlike in ACPsp, distinction is made in comparable cases by introducing immediate deadlock to deal with timing inconsistencies. Therefore, we have to introduce time-stamped immediate deadlock here. We now consider the signature of BPA^^^ with time-stamped actions, i.e. the signature of BPA^^\ but with the urgent action constants a, the urgent deadlock constant 8, the immediate deadlock constant 8 and the delay operator a^^^ replaced by the time-stamped action constants a(p) and the time-stamped deadlock constants 8(p) and 8(p). From the axioms of BPA^^^ and the definitions of time-stamped actions and immediate deadlock, we can easily derive the equations given in Table 9 for closed terms. Axioms A1-A5 from Table 1 and the equations from Table 9 together can be considered to form the axioms of BPA^^^ with time-stamped actions. The differences with the axioms of BPAsp5 in [6] are all due to the different treatment of timing inconsistencies. Extension of this version to ACP is left to the reader. 3. Extension of ACP'^^ In this section, we describe the extension of ACP^^^ with integration and initial abstraction. The extension with integration is needed to be able to embed discrete time process algebras, as exemplified in Section 5.3. The extension with initial abstraction is needed to be able to embed process algebras with relative timing, as illustrated in Section 4.3. Integration and initial abstraction are both variable binding operators. Following, e.g., [24], we will introduce variable binding operators by a declaration of the form
646
J.C.M. Baeten, C.A. Middelburg
/ : 5i 1,..., ^i^, . ^i X • • • X 5,,!,..., Snkn • ^n "^ S. Hereby is indicated that / combines an operator / * : {{SM X • • • X S\k,) -> 5i) x • • • x ({Sn\ x • • • x Snk,,) -> Sn) -^ S with A-calculus-Uke functional abstraction, binding /:, variables ranging over 5 / 1 , . . . , 5/^. in the ith argument (0 ^ / ^ n). Applications of / have the following form: fix\ i , . . . , xu, . .tn), where each Xij is a variable of sort Sij and each r, is a term of sort Si. Integration requires a more extensive theory of the non-negative real numbers than the minimal theory sketched at the beginning of Section 2 (page 631). In the first place, it has to include a theory of sets of non-negative real numbers that makes it possible to deal with set membership and set equality. Besides, the theory should cover suprema of sets of non-negative real numbers. First, in Section 3.1, ACP^^^ is extended with integration. After that, in Section 3.2, initial abstraction is added. Finally, some useful additional axioms, derivable for closed terms, are given in Section 3.3.
3.1. Integration We add the integration operator / t o ACP'^^^ It provides for alternative composition over a continuum of alternatives. That is, /,^^ P, where i; is a variable ranging over R^o. V ^ E^o and P is a term that may contain free variables, proceeds as one of the alternatives P[p/v] for p eV. The resulting theory is called ACP^^4. Obviously, we could first have added integration to BPA^^^ resulting in BPA^^4, and then have extended BPA^^^I to deal with parallelism and communication. SIGNATURE OF ACP'^^I. The signature of ACP'^'^I is the signature of ACP'''^ extended with the integration (variable-binding) operator / : 'P(E^o) x E^o • P -> P.
We assume that an infinite set of time variables ranging over R^o has been given, and denote them by u, w;,.... Furthermore, we use V,W,... to denote subsets of E^o- We denote terms of ACP^^^I by P, Q,.... We will use the following notational convention. We write/^^^P for/(V,i;./>). AXIOM SYSTEM OF ACP^^^I. The axiom system of ACP'^^^ consists of the axioms of ^(^psat ^^^ jj^g equations given in Table 10.
Axiom INTl is similar to the a-conversion rule of A-calculus. Axioms INT2-INT6 are the crucial axioms of integration. They reflect the informal explanation that f^^^y P proceeds as one of the alternatives P[p/v] for p G V. The remaining axioms are all easily understood by reaUzing that /stands for an infinite alternative composition. We can prove that the auxiliary operators u^^g and v^^^, as well as sequential compositions in which the form of the first operand is not a (a e A) and alternative compositions in which the form of the first operand is cr^^s^t), can be eliminated in closed terms of BPA^^^I with a restricted form of integration. Basically, this restriction means that in terms of the form f^^y P, V is an interval of which the bounds are given by linear expressions over
Process algebra with timing: real time and discrete time
647
Table 10 Axioms for integration (p ^ 0, u not free in R) Lev ^'= Lev ^^^/^^ fre^P = ^
INTl INT2
fve{r}^ = ^^P/'^
INT3
fvevuw P = fvev P-^ Lew f" V^0 =^ f^^^yR = R
INT4 INT5
(Vp e V . P[p/v] = Q[p/v])
^
f^,^y P = J^,^y Q INT6
^ ^ 0 => /r.V^abs(^) = ^abs '^(^) V ^ 0, sup V ^ V ^ /^,^^ CT^,3(5) = a^ll ^5)
INT7 INT8
supVEV => A,ev
INT9
/ . . V < b s ( ^ ) =
^NTIO
A,,v(^ + e) = / , e v ^ + / . e v e f^,^y{P-R) = {f^,^yP)-R
INTll INT12
/,ev^(^U./?) = ( / , e v n i [ / ? f,^y{P\R) = {f,^yP)\R ^ ^ ^ ( / ? | P ) = /?|(/^,^,./>)
INT13 INT14 INT15
LeV^H{P)=^^Hif,evP)
INT16
SAT06 SAI6 SAU5
time variables and P is of the form o^^^{a) or o^^^{a) -1 (a e As). This restricted form of integration is essentially the same as prefix integration from [29] (see also [22,23]). The terms that remain after exhaustive elimination are called the basic terms over BPA^^^ with restricted integration. We can also prove that the operators ||, [[, |, 3// and Vabs can be eliminated in closed terms of ACP^^^ with restricted integration. Because of these elimination results, we are permitted to use induction on the structure of basic terms over BPA^^^ with restricted integration to prove statements for all closed terms of ACP^^^ with restricted integration. EXAMPLES . We give some examples of a closed term of ACP^^^ with restricted integration and the corresponding basic term: /.el4.9.5.1)^abs(^absK^bs(«) H ^Jbs^^); ^^b's^^))) = ^abs^^) /i'Gl4.9.5.1) ^abs(^> + /re|4.9.5.1) ^abs(^> = /r€l4.9.5.1) ^abs^« + ^> (/rGl4.9.5.1)^abs(^))l(/.el4.9.5J)
ifK(«»=c
(/i-€[4.9.5.1)^abs(«)) I (/r6(4.9.5.I)^abs(^» = /r€(4.9.5.I)^abs(^) if K(«,/.) undefined SEMANTICS OF ACP'^^I. The structural operational semantics of ACP'^^^I is described by the rules for ACP^^^ and the rules given in Table 11.
648
J.C.M. Baeten, CA.
Middelburg
Table 11 Rules for integration ( a e A , r > 0 , p , ^ > 0 )
{P[q/vlp)^{P',p),qeV (Lev {P{q/v], {Lev
{P[q/vlp)-^W,p),qeV
^ ' P) -^ iP'^ P) p) A {P[q/vl P^ P) ^
p + r), qeV
(fveV ^ ' /^ + '-)
(IveV P' P) ^ \DiP[q/vlp)
(V^ P^
for all ^ € V
' D ( / r e V ^ ' P)
The rules for integration are simple generalizations of the rules for alternative composition to the infinite case. The panth format does not cover variable binding operators such as integration. The integration operator combines an ordinary operator / * : ^(R^o) x (E^o ^ P) ^ P with A-calculus-like functional abstraction, binding one variable ranging over R^o in the second argument. This implies that we have additional sorts here, including the sort of functions from non-negative real numbers to processes. These functions, denoted by closed terms of the form v . P, where v may occur free in P, cannot be dealt with in the same way as the non-negative real numbers: (1) they are denoted using open terms of the sort of processes and (2) their application is syntactically represented by means of substitution. As for (1), we can define bisimulation equivalence on closed terms v . P and w . Q SLS well as on open terms P and Q in such a way that it corresponds to the pointwise extension of the original bisimulation equivalence: v . P ±±w . Q iff P[p/v] 1± Q[p/w] for all p G R^o; P 1± Q iff G{P) ±> G{Q) for all substitutions a of non-negative real numbers for time variables. As for (2), we have to make a clear distinction between variables that range over a semantic domain, such as v in the rules for integration, and meta-variables that range over a syntactic domain, such as P and P' in the rules for integration. In [24], the former variables are called actual variables and the latter ones formal variables. Careful checking of the proof of the congruence theorem for the panth format given in [43] shows that the result goes through for the case with variable binding operators if the condition about the number of constants and operators in the first argument of a conclusion is as in the manysorted case without variable binding operators: the number of constants and operators that yield processes is restricted to zero or one. The signature of ACP^^4 together with the rules for the operational semantics of ACP^^^I constitute a stratifiable term deduction system in this generalized panth format, so bisimulation equivalence is also a congruence for the integration operator. Hence, this operator can be defined on the set of bisimulation equivalence classes as well. As in the case of BPA^^^ and ACP^^\ we can prove that this results in a model for ACP'^4. We will call this model MA. 3.2. Initial abstraction We add the initial abstraction operator v^ to ACP^^4. It provides for (simple) parametric timing: ^ f . F, where i; is a variable ranging over R^o and F is a term that may contain
Process algebra with timing: real time and discrete time
649
free variables, proceeds as F[p/v] if initialized at time p e M^o- This means that yj^v . F denotes a function / : E^o -^ P that satisfies f{p) = v^^^ifip)) for all p e E^o- In the resulting theory, called ACP^^^IV, the sort P of (absolute time) processes is replaced by the sort P* of parametric time processes. Of course, it is also possible to add the initial abstraction operator to ACP^^S resulting in a theory ACP^^V. SIGNATURE OF ACP'^'^V/. The signature of ACP'^^V is the signature of ACP'''^ extended with the initial abstraction (variable-binding) operator vi • ^^o . P* ^ P*.
We now use JC, y , . . . to denote variables of sort P*. Terms of ACP^^^V are denoted by F,G,.... We will use the following notational convention. We write ^^ f . F for ^ ( u . F). AXIOM SYSTEM OF A C P ' ^ ^ W . The axiom system of ACP'^'^v/ consists of the axioms of ACP^^^I and the equations given in Table 12.
Axioms SIAl and SIA2 are similar to the a- and ^-conversion rules of X-calculus. Axiom SIA3 points out that multiple initial abstractions can simply be replaced by one. Axiom SIA4 shows that processes with absolute timing can be treated as special cases of processes with parametric timing: they do not vary with different initialization times. Axiom SIA5 is an extensionality axiom. Axiom SIA6 expresses that in case a process performs an action and then proceeds as another process, the initialization time of the latter process is the time
Table 12 Axioms for standard initial abstraction (/? > 0, v not free in G)
SIAl SIA2
v^ u . ( ^ u;. F) = ^ u . F[v/w] G = ^^v.G
SIA3 SIA4
y/^W .G = y/^V . G[V/W]
(V;7€M^0*I^L(^) = ^abs(>')) => ' = y SIA5 SIA6
SIA7 SIA8
^abs^Vs v.F) = ^^v. v^^^(F) if p ^ u Ws^.F)lG = ^^v.(Flv^^^iG)) GlU^.F) = ^^v.(vl^^{G)lF)
SIAIO SIAll
Ws^.F)\G G\(4v.F) dHWsV.F)
= = =
^^v.(F\v^^^(G)) ^^v.(vl^^{G)\F) ^^v.dH(F)
i^absCvs y • n = y/s^ . i^abs(^)
IveV^^s^-^)
= \/s^-(fveV^^
SIA9
SIA12 SIA13 SIA14 SIA15 SIA16
'^^'^ w SIAl7
650
J.CM. Baeten, C.A. Middelburg
at which the action is performed. Notice that the equation a • x =a - V^}Q^{X) is a special case of axiom SIA6. The related equation cf^^^{x) = o^a^bs^^abs^-^^^ follows immediately from axioms SATl and SAT2 (Table 2, page 634). Axioms SIA7-SIA17 become easier to understand by realizing that y/^v > F denotes a function / : M^o -^ P such that f(p) = Ug^jgC/C/?)) for all p e R^o- This is reflected by the equation which can be derived using axioms SIA2 and SIA5 and a useful special case of standard initialization axiom SI2 presented in Section 3.3, viz. ^fbs^^abs^-^^^ ~ ^abs^-^^The ehmination results for ACP^^^I^ with the restricted form of integration mentioned in Section 3.1 are essentially the same as the ones for ACP'^4 with the restricted form of integration. Besides, all closed terms of ACP^^^W with this restricted form of integration can be written in the form y/^v . F where F is a basic term over BPA^^^ with restricted integration. EXAMPLES. We give some examples of a closed term of ACP^^^ W with restricted integration, the corresponding term of the form y/^v . F where F is a basic term and, if possible, the corresponding basic term without initial abstraction:
Vs ^ • ^a^s^"^(Vs ^ • '^abs(^)) = ^s^ • ^abt'''^^^) ^abs(Vs V . K^s'^\L^[e.6.U
^abs(^))) = 4 ^ • ^aVs^^) = ^ i ^ ^ )
^abs^Vs V ' ^ai'"^(/u-€(6.6.1) ^abs(^)» = Vs ^ • /.•6(6.6.I) ^abs^^) = /,r6|6.6.1) ^abs^^)
Table 13 Definition of operators on RTTS* (<^:]R>O^RTTS*(A), aeA^, pel " 8 = Xt .8
< b s ( / ) = ^^-^abs(
=
Xt.(f{t)-\-git)) Xt.(f(t)*g)
< b s ( / ) = ^^-^abs(
=
flg
=
f\g dHif)
kt.if(t)\\g(t))
=
^t.(f(t)lg(t)) Xt.(f{t)\g(t))
=
xt.dH(f(t))
Vabs(/) = A/-i^abs^^abs(/(0))
Process algebra with timing: real time and discrete time
651
On the basis of the rules for its operational semantics, the operators of ACP^^^I can also be directly defined on real time transition systems in a straightforward way. In the following, we will describe a model of ACP^^^W in terms of these operators. SEMANTICS OF A C P ' ^ ^ V .
We have to extend RTTS(A) to the function space
RTTS*(A) = {/ : E^o -^ RTTS(A) | Vp € E^o • f{p) =
Kbs(f(P)))
of real time transition systems with parametric timing. We use f,g, •.. to denote elements of RTTS*(A). In Table 13, the constants and operators of ACP^^^V are defined on RTTS*(A). We use X-notation for functions - here t is a variable ranging over R^oWe write f{t) * g for the real time transition system obtained from / ( / ) by replacing (5, p) A ( y , p) by {5, p) A {s , p), where s' is the root state of g(p), whenever s is reachable from the root state of / ( r ) . We say that f^ge RTTS*(A) are bisimilar if for all p G R ^ O , there exists a bisimulation R such that R{f{p), g(p)). It is easy to see that bisimulation equivalence as defined here is a congruence for the operators of ACP^^^V. We obtain a model of ACP^^^v/ by defining all operators on the set of bisimulation equivalence classes. We will call this model M^. Notice that / € RTTS*(A) corresponds to a process that can be written with the constants and operatorsof ACP^^^I only iff u^^gC/) = / . In fact. MA is isomorphic to a subalgebra of M^.
Table 14 Standard initialization axioms {p,q,q' ^ 0 , r > 0)
SIl
-L
SI2 SB
v'^Mbs''M)=
SI4
'^abs(^)+^rbs<^) = "abs(^)
S15
< b s ( ^ ) + < b s ( ^ + ^) = "abs(^ + ^)
SI6
KbsM
+ '» = %t>sM
SI7
SI8
< b s ( ^ : b s « ' b s ( - ) ) ) = ^ a r " ' ' " < ^ a V • - » SI9 " L ( - ^ I .V) = < b s < ^ ) i ^abs<>')
SI 10
"a^bs(^l.v)=^rbsWl^abs(>')
Sill
"absO«(^)) = 3H(
SI12
"abs(''absU)) = Vabs(i^abs(-^)>
SI13
tJ;bs(''absU)) =
SI14
>'abs(i^;bs(-^)) = ^
SI15
"abs'^absU)) = "absU)
SI16
''abs(i'abs<-^)^ = ^absU)
SI17
652
J.CM. Baeten, CA. Middelburg
3.3. Standard initialization axioms In Table 14, some equations concerning initialization and time-out are given that hold in the model M^, and that are derivable for closed terms of ACP^^^W. We will use these axioms in proofs in subsequent sections. Notice that the very useful equation t^fbs^^abs^-^)) = ^abs(^) ^^ ^ special case of axiom SI2. We can easily prove by means of the standard initialization axioms, using axioms SIA2 and SIA5 (Table 12, page 649), that initial abstraction distributes over +, ||, [L and |: {y/^v.F)n{^^v.F') = Vs^'• (^n P")
DISTRD
for D = +, II, [[, |. Using this fact shortens many of the calculations needed in the proof of Theorem 6 (embedding of ACP''^ in ACP'^V). 4. Real time process algebra: relative timing In this section, we give the signature, axioms and term model of ACP^'^, a standard real time process algebra with relative timing. ACP^'^ originates from the theory ACPst, presented in [6]. Like ACPst, it separates execution of actions and passage of time. First, in Section 4.1, we treat BPA^'^, basic standard real time process algebra with relative timing, in which parallelism and communication are not considered. After that, in Section 4.2, BPA^'^ is extended to ACP^'^ to deal with parallelism and communication as well. Finally, we show in Section 4.3 how ACP^'^ can be embedded in ACP^^V.
4.1. Basic process algebra In BPA^'^, we have the constants a and I instead of ^ and I, and the operator a^g, (relative delay) instead of cr^i^g (absolute delay). The constants a and I stand for a without any delay and a deadlock without any delay, respectively. The process ojl^ix) is the process x delayed for a period of time p. We also have relative counterparts of the absolute timeout and initialization operators: u^g, (relative time-out) and u^g, (relative initialization). The process v^^^ix) is the part of x that starts to perform actions after a period of time shorter than p. The process t'rei(jc) is the part of x that starts to perform actions after a period of time longer than or equal to p. In BPA^'^, the sort P of (absolute time) processes is replaced by the sort P"" of relative time processes. The notation a for urgent actions in case of relative timing was also used in ACPst [6], the theory from which ACP^'^ originates. SIGNATURE OF BPA^'^. The signature of BPA'^'^ consists of the urgent action constants a.^^P^ (for each a e A), the urgent deadlock constant S : ^ P^ the immediate deadlock constant 5 : ^- P^ the alternative composition operator + : P"" x P"^ ^- P^ the sequential composition operator • : P*" x P"" ^- P^ the relative delay operator a^g, : M^o x P'^ ^- P^ the relative time-out operator u^g, : M^o x P"^ -> P^ and the relative initialization operator u^g,: R^o X P^ -^ P^
Process algebra with timing: real time and discrete time
653
Table 15 Additional axioms for BPA^"^ (« G A^, p , ^ ^ 0 , r > 0) o%,{x) = x
SRTl
<^i-»)=o,::Hx)
SRT2
< | W +
a+l —a
A6SRa
a;,(x) + ? = a;,(x)
A6SRb
l-x = l
A7SR
<,(^)-^ vi,{x) = S u;g,(a)=a
SRTOO
u/I,(;cv) = i;/'(jc)-v
SRT05
"r'elW^ = <'/el(« ""e|(^) = JC
SRIO
^;ei(«) = <el<^)
SRI2
SRTOl
SRTO2
SRIl
SRI3
"re|(-^ • .v) = u / g | U ) . y
SRI5
vl'jx + y) = vl'jx)
AXIOMS OF BPA^'*^.
+ Lv';,(.v ) SRI4
The axiom system of BPA^'^ consists of the equations given in Ta-
bles 1 and 15. The axioms of BPA^'^ are to a large extent simple reformulations of the axioms of BPA^^^ That is, constants a(a eAs) have been replaced by constants a, and the operators ^3^5, Ug^^g and Ugjjg have been replaced by a^^,, v^^^ and TJ^g,, respectively. Striking is the replacement of the axioms SAT4, SAT5 and SAT6 by the simple axiom SRT4. This axiom reflects that timing is relative to the most recent execution of an action. Axioms SRI0-SRI5 are reformulations, in the above-mentioned way, of alternative axioms for axioms SAI0-SAI5 - which, unlike axioms SAIO-SAI5, do not accommodate the addition of initial abstraction (see also Section 2.1). Similar to the case of BPA'''\ we can prove that the auxiliary operators v^^^ and u^e,, as well as sequential compositions in which the form of the first operand is not a (a € A) and alternative compositions in which the form of the first operand is (T/g,(r), can be eliminated in closed terms of BPA^'^. The terms that remain after exhaustive elimination are called the basic terms over BPA^'^. Because of this elimination result, we are permitted to use induction on the structure of basic terms over BPA''^ to prove statements for all closed terms of BPA^'^.
654
J.CM. Baeten, CA. Middelburg
EXAMPLES.
We give some examples of a closed term of BPA^'^ and the corresponding
basic term:
SEMANTICS OF BPA^'^^ In case of relative timing, we can use a simple kind of real time transition system. A real time transition system with relative timing over A consists of a set of states S, a root state p eS and four kinds of relations on states:
a binary relation a unary relation a binary relation a unary relation
_ A _ for each a e A, _ A y for each a e A, _ i-^ _ for each r € M>o, ID(_);
satisfying (1) if 5-1
> s\ r, r' > 0, then there is a s" such that s i-> s" and 5'' 1—> s';
(2) if ^ h^ s^' and s^^ h-> s\ then s \-^—> s'. We write RTTS'^(A) for the set of all real time transition systems with relative timing over A. We shall associate a transition system TS^(r) in RTTS''(A) with a closed term t of BPA^"^ like before in the case of absolute timing. In case of relative timing, the action step, action termination, time step and immediate deadlock relations can be explained as follows: t -^ t': process t is capable of first performing action a without the least delay and then proceeding as process t'\ t -^ ^: process t is capable of first performing action a without the least delay and then terminating successfully; t \-^ t'\ process t is capable of first idling for a time period r and then proceeding as process t'\ ID(0: process t is not capable of reaching the present time. The structural operational semantics of BPA^'^ is described by the rules given in Table 16. In one of the rules for the alternative composition operator, a negative formula of the form t \^ is used as a premise. A negative formula t ^ means that for all closed terms t' of BPA^^ not t h^ t\ Hence, ri;^ is to be read as "process t is not capable of idling for a time period r". Clearly, changing from absolute timing to relative timing leads to a significant simplification of the operational semantics. However, note that there are two rules now for the alternative composition operator concerning time related capabilities of a process x -f y. These rules have complementary premises. Together they enforce that the choice between two idling processes is postponed till at least one of the processes cannot idle any longer.
Process algebra with timing: real time and discrete time Table 16 Rules for operational semantics of BPA^*^ (« G A, r > 0, /7 > 0)
~
ID(^)
a
IDU)
1
X\~^
X
p , .
p+f
,
/7>0 <7re|(.v)h^.v a 1 X ^f X
X + }' —> X , y + jc —> .V '•
/
r
r
jc I—> jc , y f A /
'•
,
r
,
-V h ^ .V , y I—>• y ' •
x-\-y\-^x,y-\-x\-^x
-v + >' ^ ^ V ' >" + -^ ^ ^ V
/
/
' •
/
x -\- y v-^ x + y
iPU), ID(y) IDU + y) Cl I X - ^ X
il X ^f
/ ^
X • y -^ X • V
ID(A-) ID(jc • y )
X • y \~^ X • y
.Ay
a 1 X -^ X r
t
\
(^
1
v\^^{x)-^x r ,
<el(^)^V 0
u,^+''U)^u/:,(x')
ID(.v) ID(u;,,(.v))
ID(uO|U)) JC — ^ JC
xA^
-?e,W--'
->)'^V
x\-^ X , p ^r —p..r , v^^^{x)\-^x
—P+''/
X^ , p>0 Wei
(•^)'-^Wel ih)
X h^ x', p > 0 \ '' —P / '\
IDU) ID(i7f^3,U))
655
656
J.C.M. Baeten, C.A. Middelburg
Also the notion of bisimulation becomes simpler in case of relative timing. A bisimulation on RTTS''(A) is a symmetric binary relation R on the set of states S such that: (1) if R{s, t) and s A s\ then there is a t' such that t A t' and R{s\ t')\ (2) if R{s, r), then 5 A V iff r A 7 ; (3) if R{s, t) and s h4 s\ then there is a t' such that / A t' and /?(5', r'); (4) if/?(5,0,thenlD(^)ifflD(r). As in the case of absolute timing, we obtain a model for BPA'^'^ by identifying bisimilar processes. 4.2. Algebra of communicating processes In ACP^'*^, we have a relative counterpart of the absolute urgent initialization operator: Vrei (relative urgent initialization). The process VreiU) is the part of process x that starts to perform actions without any delay. Like before in the case of absolute timing, we use the relative urgent initialization operator to axiomatize the parallel composition operator. SIGNATURE OF ACP^'^. The signature of ACP^'^ is the signature of BPA^'^ extended with the parallel composition operator ||: P"^ x P"^ ^ P^ the left merge operator [[: P*" x P"* ^ P^ the communication merge operator |: P'^ x P"^ ^ P^ the encapsulation operators 9// : P*^ ^ P"" (for each H c A), and the relative urgent initialization operator Vrei: P"^ ^ P^ AXIOMS OF ACP^^. The axiom system of ACP^'^ consists of the axioms of BPA"^ and the equations given in Table 17.
The additional axioms of ACP^'^ are just simple reformulations of the additional axioms of ACP^^^ That is, constants a (a e As) have been replaced by constants a, and the operators ^abs' ^abs ^^^ ^abs have been replaced by (7^^,, u^g, and Vreu respectively. Similar to the case of ACP^^^ we can prove that the operators ||, [[, I, 9// and Vrei can be ehminated in closed terms of ACP^*^. Because of the elimination result for BPA^'*^ we are permitted to use induction on the structure of basic terms over BPA^"^ to prove statements for all closed terms of ACP^'^. EXAMPLES. We give some examples of a closed term of ACP^"^ and the corresponding basic term (in case y(a,c) is undefined): 5 Ca)IIII"rel ^5-1 a«v'(^) ^Lia ' "rel • a«,> • a^v^C^)) ^^^(g). * "rel ^*-^ " ="rel^" ^^(h " "rel ^,re|V"^ rel' (^) II ^rel(^) ' ^rel'^^) = 4 l ^ ^ * ^rel ^^ " ^reV rel («) II < ^ ^ ) • ^rel'(^) = ^ r t ^ ^ " ^ r e ^ ^ " ^•
SEMANTICS OF ACP^'^. The structural operational semantics of ACP'''^ is described by the rules for BPA^'*^ and the rules given in Table 18.
Changing from absolute timing to relative timing also leads to a simplification of the additional rules for parallel composition, left merge, etc. As in the previous cases, we obtain a model for ACP^'^ by identifying bisimilar processes.
Process algebra with timing: real time and discrete time
657
Table 17 Additional axioms for ACP^'^ (a,beA8, ceA, p^O,r>0) a\h
= c \iy{a,b)
a\h
= ^ if y («,/?) undefined
=c
CFISR
X \\y = (x [Ly + y [Ljc)+A:|y 8lx
CF2SR CMl
=8
CMIDl
X 18 = 8
CMID2
« ILU-f l ) = a - U + ! )
CM2SRID
a-xl{y-\-h
CM3SRID
=
a-ix\\(y~\-h)
<|U)lL(Vrel(y) + ^) = ?
SRCMIID
< , U ) l ( t ^ r e , ( y ) + a^^,(c)) = a/^,( xlz)
SRCM2ID
U + y) IL z = X U. z + y IL z
CM4
8\x=8
CMID3
X \8 = 8
CMID4
a • X \h = (a \h) • X
CM5SR
a\B • X = {a \B) • X
CM6SR
a-x\h-y
CM7SR
= (a\B)-(x\\
(Vre\ix) +
y)
h\cr;e\(y)=^
cr,'^\ix)\{Vre\(y)
+ h = ~^
SRCM3ID SRCM4ID
< , U ) l < , ( y ) = a/^,Uly)
SRCM5
{x-^y)\z=x\z
y\z
CMS
x\y-\-x\z
CM9
x\iy-^z)
+ =
dH(S) = 8
DO
dH{a)=a
Wa^H
DISR
dH{a) = l
\iaeH
D2SR
a//Ke,U)) = <,(a//(A))
SRD
9//U + y) = a//U) + 9/y(y)
D3
dnix
D4
y) =
dH(x)dH{y)
Vrel (^) = ^
SRUO
Vrei (a) = a
SRUl
Vre\(cT^'Q\(x)) = l
SRU2
VreiU + y) = VrelU) + Vrel(y)
SRU3
VreiU-y) = VrelU) y
SRU4
4.3. Embedding ACP''^^ in ACP'^V Consider two theories T and 7'. An embedding of T in 7 ' is a term structure preserving injective mapping 6 from the terms of T to the terms of T' such that for all closed terms s,t of T, s = t is derivable in T implies €(s) = €(t) is derivable in T\ If there exists an embedding of T in T\ we say that T can be embedded in T'. It roughly means that what
658
J.CM. Baeten, C.A. Middelburg Table 18 Additional rules for ACP''^ (a, ^, c € A, r > 0)
xAx\ x\\y-^x'
-ID(v)
II J , y \\x-^
y \\x\ x
ILvAx'lly
jr A y , -.|D(y) II
^
II
tt
II
^'
^ II V - ^ V, V II ^ ^ ^ V, X |[ V ^ ^ V X —> jc , y - ^ y , y ( « , b) = c x\\y-^x'\\
x^
v ' , X 1 V - ^ j c ' II v' X ^f^ X , y ^
^,
V' v - ^ V ' K(«,/^)=c -v II y ^
y , -V 1 y ^
V
y{a,b) = c /
1
f
/
x II y ^ - jc , y II jc - ^ A- , jc 1 y ^^ jc, y 1 jc - > .V /• , r , X \-^ X , y\-^ y • X II y 1-^ A ' II y ' , jc IL y 1-^ jc' |[ y'.jc 11 y 'h^ jc' 1 1 ' y
ID(jc) I D ( x l l y ) , ID(y||jc), ID(jclLy), ID(y ILx), I D U l y ) , ID(y U ) x-^x',aiH
x-^^^aiH
9// U ) - ^ 9// ix')
dn ix) A
XY^x'
ID(JC)
a//U)H^a//U')
y
IDO//U))
^Ax'
A ^ v
IDU)
i^relU)->-^
Vre(U)-^V
ID(vrelU))
is expressible in T remains expressible in T' and what is derivable in T remains derivable in ^ ^ The requirement that e is term structure preserving means that, for all terms t of T with free variables among x\,...,Xn and all closed terms r i , . . . , /„ of T of appropriate sorts, €(t[t\,
. . . , tn/x\,
. . . , Xn]) = €(t)[€(t\),
. . . , € ( r „ ) / X i , . . . , X,,].
Let / be an operator that is not in the signature of theory T. An explicit definition of / in T is an equation / ( j c i , . . . , x„) = r where t is a term of T that does not contain other free variables than ;ci,..., JC„. An extension of theory T with constants and operators defined by explicit definitions in T is called a definitional extension of T. Consider again two theories T and T\ Suppose that the constants and operators in the signature of T that are not in the signature of T' can be defined in T' by explicit definitions. Let r ' ' be the resulting definitional extension of T\ Suppose further that the axioms of T are derivable for closed terms in T'\ Then T can be embedded in T'. The explicit definitions induce the following embedding:
Process algebra with timing: real time and discrete time €{x)=x €ifit\,..., €(f(t\,...,
tn)) = f{€{t\),..., r„)) = t[€(t\),...,
€{tn)) €(tn)/x\,...,
659
if / in the signature of 7'; jc„] if the explicit definition of / i s / ( x i , . . . , X ; , ) = r.
In this chapter, we will show the existence of embeddings in the way outlined above. The explicit definitions needed to show that ACP^^ can be embedded in ACP^^V are given in Table 19. The following lemma presents an interesting property of processes with relative timing. 4. For each closed term t of ACP^^V generated by the embedded constants and operators of A C F ^ v^^^(t) = a^^^it). LEMMA
PROOF, it is straightforward to prove this by induction on the structure of /. We present only the case that t is of the form 5 • r^ The other cases are similar, but simpler.
—P p
/ P /~\\ ./SAI3' ,~ _ 0 . / . . SAT1.2
p . ^ . ^, S1A6
n ,~- _ / ; . /. IH
p .-.
p . / SAT5
p , _ 0 . 0 / - —0 /.f\\\\^^^-
"ibs^" • ^absC » = '^ibs(^abs<'^abs<''" ^abs*' » » =
'^a''bs(^abs(Vs V . a^^,(a • v^^^^it')))) ''II'- a^^^U ^ • '^^bs(« ' ^abs*''") ' ' = ' "
^ •
°
Lemma 4 expresses that, for a process with relative timing, absolute initialization of the process at time p is the same as shifting the process in time from time 0 to time p which implies preceding absolute initialization at time 0. It follows from Lemma 4 and axiom SAI5 that for each pair of closed terms r, r' of ACP'^^ V generated by the embedded constants and operators of ACP'"^, cr^^^(t • t') = cr^^s^t) • t\ The condition that t is a term generated by the embedded constants and operators of ACP^'^ can not be dropped here. However, Lemma 5 points out that this condition is not a necessary one, since VabsCO is not equal to a term generated by the embedded constants and operators of ACP^'^ - unless t = S. Lemma 5 is needed in the proof of Theorem 6.
Table 19 Definitions of relative time operators
v^relU) = \ 4 i^ • f^abs^^absU))
660
J,C.M. Baeten, CA. Middelburg
5. For each pair of closed terms t, t' of ACP^^V generated by the embedded constants and operators of ACP''^, crg^bs(vabs(0 • t') = cr^^^ivabsiO) • t'. LEMMA
PROOF, it is straightforward to prove this by induction on the structure of r. The proof is extremely long. We present only the case that t is of the form G^^^{t"). The other cases are similar, but simpler, and do not require case distinction.
Case^ = 0: oP^^(^,^^,(a^^,it")) • t') %' a^^,(v,ts(<^'^^y')) • t') ''^' -rbs(^a'bs(''abs(/") • ' ' ) ) ''='
•,') '^ ^r^^^^^a^sit")) •'' ' = '
• t' ''^'
/
/p\\
^/SAUl
p
.p.
^/SAL'2
ffibs(''abs(^)) • ' = o'abs*^*' ^a''bs(^absKt|('")))-/'
p
.
.
q
• t' ^ ^ '
^^>u..
/ seeII
= °'abs<''abs(
=
I.
- • <>^abs(
II, III and IV: The proofs are similar to the proof of I - axioms SATl and SAIl are used in addition in III and IV. D The existence of an embedding of ACP^'^ in ACP^^V is established by proving the following theorem. THEOREM 6 (Embedding ACP"^ in ACP'^'V). For closed terms, the axioms of ACP^^ are derivable from the axioms of ACP^^W and the explicit definitions of the constants and operators a, cr^g,, u^g,, u^g,, and Vrei in Table 19.
The proof of this theorem is given in Appendix Al. The proof is a matter of straightforward calculations. Equations SIAI (page 650) and D I S T R D (page 652), the standard initialization axioms (Table 14, page 651), and Lemmas 4 and 5 (pages 659, 660) are very useful in the proof. D PROOF.
5. Discrete time process algebra In this section, we present ACP^^^ and ACP^'^, discrete time process algebras with absolute timing and relative timing, respectively. ACP^^^ and ACP'*'^ are conservative extensions of ACPdat and ACPdrt [7], respectively. First, in Section 5.1, we present ACP^^^ and ACP^^V, the extension of ACP^^^ with initial abstraction. After that, in Section 5.2, we present ACP^^. Finally, we show in Section 5.3 how ACP^^V can be embedded in ACP'^^lV.
Process algebra with timing: real time and discrete time
661
5.1. Discrete time process algebra: absolute timing In this subsection, we give the signature, axioms and term model of ACP^^\ a discrete time process algebra with absolute timing. ACP^^^ is a conservative extension of the theory ACPdat, presented in [7]. Like ACP^^^ it separates execution of actions and passage of time. In ACP^^^ time is measured on a discrete time scale. The discrete time points divide time into time slices and timing of actions is done with respect to the time slices in which they are performed- "in time slice « + T' means "at some time point p such that n ^ p
We denote elements of N by m, m',«, n'. AXIOMS OF BPA^^^
The axiom system of BPA^^^ consists of the equations given in Ta-
bles 1 and 20. The axioms of BPA^^^ are to a large extent simple reformulations of the axioms of BPA^^^ That is, constants a (a e As) have been replaced by constants a, and the first argument of the operators a^^^, v^^^ and v^^^ has been restricted to elements of N. Striking is the new axiom DAT7. This axiom makes the reformulations of axioms A6SAb and A7SA, i.e. ^abs^ (x) + 5 = a^^J (jc) and 5 x = 5, derivable. Axiom DAT7 expresses that an immediate deadlock shifted in time by 1 is identified with an undelayable deadlock in the first time slice.
662
J.CM. Baeten, C.A. Middelburg Table 20 Additional axioms for BPA'*^^ (a € A^) ^abs(^) = ^abs(^)
DATl
-absKbs(-)) = < i r ( - )
DAT2
< b s ( ^ ) +
DAT3
< b s ( ^ ) - ^ a b s ( v ) =
DAT4
< b s ( ^ ) • (^absO') + < b s ( ^ ) ) = ^abs^-^- ' ^abs^^^)) DAT5 < b s ( ^ ) - ^ =
DAT6
^Jbs(^)=^ a + 5= a
DAT7 A6DAa
u;'bs('^) = ^ uO,3U) = ^
DATOO DATOl
^l^siQ) = a
DAT02
^aJ,t"Kbs(^)) = ^abs^^abs^'^)) ^abs(^ + -V) = vl^^ix) + i;;',3( V)
DAT03 DAT04
^abs(^-^) = ^ a b s ( ^ ) v
DAT05
^abs^^> = ^
DAIOa
^abt'(^) =
DAIOb DAIl
^abt'(^ =
DAI2
^ a b t " K b s ( ^ ) ) =^;'bs^^abs<
^AB
^abs(^ + ^ ) = ^ a b s ( ^ ' ) + ^abs(v)
^^^^
^abs(^-^)=^abs^^)-v
^^^^
Like in the case of BPA^^^ we can prove that the auxiHary operators v^^^ and u^j^g, as well as sequential compositions in which the form of the first operand is not ^ (« e A) and alternative compositions in which the form of the first operand is cf!^}Qs^t), can be eliminated in closed terms of BPA^^^ The terms that remain after exhaustive elimination are called the basic terms over BPA^^^ Because of this elimination result, we are permitted to use induction on the structure of basic terms over BPA'^^^ to prove statements for all closed terms of BPA^^^ EXAMPLES.
We give some examples of a closed term of BPA^^^ and the corresponding
basic term: ^abs^^abs^^ + ^abs^^)) = ^abs^^) ^ a b s ( ^ i s ( ^ + ^abs(^)) = 4 s ( ^ )
SEMANTICS OF BPA'*^^ In case a discrete time scale is used, we use a variant of real time transition systems. A discrete time transition system over A consists of a set of states S, a root state p € S and four kinds of relations on states:
Process algebra with timing: real time and discrete time
a binary relation a unary relation a binary relation a unary relation
663
(_, AZ) A (_, n> for each A G A, « € N, (_,«) A (y, n) for each a G A, A? € N, (_,n> h ^ (-,^'> for each m G N>o,n,A?' G N where n' = n -\-m, ID(_, n) for each n G N;
satisfying (1) if (^,«) I and(s\n+m)^
> {s\n'),
m,m' > 0, then there is a 5^' such that {s,n) \—^ (s'\n -\-m) {s\n')\
(2) if (5, n) A {s\ n+m) and {s\ n-\-m)y^ {s\ n'). then {s. n) h ^ ^ ^ (^^ n'). We write DTTS(A) for the set of all discrete time transition systems. Associating a transition system in DTTS(A) with a closed term / of BPA^^^ proceeds in essentially the same way as associating a transition system in RTTS(A) with a closed term t of BPA^^^ The only difference is that in the rules for the operational semantics of BPA^^^ all numbers involved are restricted to N. Therefore, we refrain from giving the rules. Bisimulation on DTTS(A) is defined as on RTTS(A). As in the real time cases, we obtain a model for BPA^^^ by identifying bisimilar processes. Algebra of communicating processes. In ACP^^^ we do not have a discrete time counterpart of Vabs- Unlike before in the case of real time, we can use vl^^ instead. SIGNATURE OF NCP^^\ The signature of ACP'*''^ is the signature of BPA^^^ extended with the parallel composition operator ||: P x P -^ P, the left merge operator [[: P x P -^ P, the communication merge operator |: P x P -> P, and the encapsulation operators 9// : P -> P (for each H c A). AXIOMS OF ACP^^^ The axiom system of ACP"^^^ consists of the axioms of BPA"*"^^ and the equations given in Table 21.
The additional axioms of ACP^^^ are to a large extent simple reformulations of the additional axioms of ACP^^^ That is, constants a (a e As) have been replaced by constants a, the first argument of the operators a^^^ and v^^^ has been restricted to N, and the operator Vabs has been replaced by v^^^. A counterpart of SACMl is missing. However, axiom DAT7 makes the simple reformulation of axiom SACMl, i.e.
•b-\-ba))
664
J.C.M. Baeten, C.A. Middelburg Table 21 Additional axioms for ACP'^^^
{a,beAs,ceA)
g^\b = c '\^y(a,b) —c
CFIDA
Q.\b_ = h_ Wyia.b) undefined
CF2DA
^ll>' = U !!>' + >'lLA:)+x|y htx = h
CMl CMIDl
X 18 = 8
CMID2 CM2DA
al(x-¥8)=a-ix-\-8)
CM3DA :)
a-xl{y-^8)
=
a-(x\\(y-^8))
g^x \b = {g_\b) • X
CM5DA
G.\bx = (g_\b)x a-x\b-y = ia\b)-{x\\y)
CM6DA CM7DA
ivL(^)^SJ\a^^^\y)
DACM3 DACM4
= 8_
DACM5
dHi^) = S dH(Q)=a
DO WaiH
dH(G)=S
'\iaeH
9//Kbs(^))=
=
dHix)dH(y)
CMS CM9
DIDA D2DA DAD D3 D4
SEMANTICS OF ACP^^^ Like for the rules for the operational semantics of BPA^^S the additional rules for ACP^^^ differ from the corresponding rules for the real time case only in that all numbers involved are restricted to N. Therefore, v^e refrain again from giving the rules.
Again, we obtain a model for ACP^^^ by identifying bisimilar processes. Initial abstraction. We add the initial abstraction operator Vd to ACP^^^ This operator is the discrete counterpart of ^ . This means that y/^i > F, where / is a variable ranging over N and F is a term that may contain free variables, denotes a function / : N -^ P that satisfies / ( n ) = ^abs(/(")) ^^^ ^^^ n G N. In the resulting theory, called ACP'^^V, the sort P of (absolute time) processes is replaced by the sort P* of parametric time processes. SIGNATURE OF ACP'^^V. The signature of ACP^'^V is the signature of ACP^^^ extended with the initial abstraction (variable-binding) operator v{j • N . P* -> P*.
Process algebra with timing: real time and discrete time
665
Table 22 Axioms for discrete initial abstraction (/ not free in G) VdJ.G = Vd^G[//7]
DIM DIA2
^abs^Vd^-n^^^'bs^^t'^/^]) DIA3 Vd/.(Vdi-^) = Vd^-^[^/j] DIA4 G = V d ' • <^ (VnGN.i72bs(^)=^abs(>')) => ^ = > DIA5 DIA6
DIA7
( V d / . n + G = Vd/.(/^ + n;bs(G)) (Vd/.F)-G = Vd'-.(F-G)
DIA8
^abs(Vd^-^) = Vd/-^abs(^) *^^^' W^i.F)lG = ^^i.{Flv^^^^{G)) GlU^i.F) = ^^i.{%^^{G)lF) Q^i.F)\G
= ^^i.{F\v^^^^{G))
G\{^^i.F)
=
dHW^i-F) =
^^i.{v'^^^{G)\F) ^^i.dH{F)
DIA9 DIAIO DIAll DIA12 DIA13 DIA14 DIA15
We assume that an infinite set of variables ranging over N has been given, and denote them by /, 7 , . . . . We denote terms of ACP^^V by F, G , . . . . AXIOM SYSTEM OF A C P ^ ^ V . The axiom system of ACP'^^V consists of the axioms of ACP^^^ and the equations given in Table 22.
The axioms for discrete initial abstraction are simple reformulations of the axioms for standard initial abstraction. That is, the operator v^ has been replaced by Vcj' ^^^ the variables ranging over R^o have been replaced by variables ranging over N. As in the case of ACP^^^ V, all closed terms of ACP"^^^ V can be written in the form ^/^i.F where F is a basic term over BPA^^^ EXAMPLES .
We give some examples of a closed term of ACF*^^ y, the corresponding term of the form y/^i. F where F is a basic term and, if possible, the corresponding basic term without initial abstraction: ^abs^Vd i • <^s^(^)) = Vd '• • ^abs^^ = ^Ibs^^^ ^abs^Vd i • < i ^ « ) ) = Vd '• •
SEMANTICS OF A C P ^ ^ V .
= Vd ^' • ^^bs^' (£)
We have to extend DTTS(A) to the function space
DTTS*(A) = {/ : N -> DTTS(A) | VAZ G N • f(n) = Uabs(/(^))}
666
J.CM. Baeten, CA. Middelburg
The constants and operators of ACP^^V can be defined on DTTS*(A) in the same way as for the real time case. We say that f,g e DTTS*(A) are bisimilar if for all « 6 N, there exists a bisimulation R such that R(f(n), g(n)). Like before, we obtain a model of ACP^^V by defining all operators on the set of bisimulation equivalence classes.
5.2. Discrete time process algebra: relative timing In this subsection, we give the signature, axioms and term model of ACP^'^, a discrete time process algebra with relative timing. ACP^*^ is a conservative extension of the theory ACPdrt, presented in [7]. Like ACPdrt, it separates execution of actions and passage of time. First, we treat BPA^'^, basic discrete time process algebra with relative timing, in which parallelism and conmiunication are not considered. After that, BPA^*^ is extended to ACP^*^ to deal with paralleUsm and communication as well. Basic process algebra. In BPA^'^, we have the constants g_ and 5 instead of ^ and 5, and the operator a^g, instead of a^,^^. The constants a_ and 5 stand for a in the current time slice and a deadlock in the current time slice, respectively. The process cr^^iix) is the process x delayed for a period of time n on the discrete time scale, i.e. till the n-ih next time slice. We have relative counterparts of the absolute time-out and initialization operators as well: u^gi and u^g|. The process vl^^ix) is the part of x that starts to perform actions before the n-th next time slice. The process v"^^ (x) is the part of x that starts to perform actions in the «-th next time slice or a later time slice. As in Section 4, we use P"^ for the sort of relative time processes. In some presentations of ACPdrt, including [7], the notation c\s{a) was used instead of a. The notation a for actions in the current time slice was first used in ACPdt [3]. The signature of BPA"**^ consists of the undelayable action constants g:-> P^ (for each a e A), the undelayable deadlock constant | : -^ P^ the immediate deadlock constant 5 : -> P^ the alternative composition operator + : P*" x P'' -^ P^ the sequential composition operator •: P"^ x P"" -» P^ the relative delay operator a^^,: N x P'^ ^• P^ the relative time-out operator u^g,: N x P"" -> P^ and the relative initialization operator u^gi: N X P^ -» P^ SIGNATURE OF BPA^'^.
AXIOMS OF B P A ^ ^ .
The axiom system of BPA^'^ consists of the equations given in Ta-
bles 1 and 23. The axioms of BPA^'^ are to a large extent simple reformulations of the axioms of BPA^^^ That is, constants g_(a e fi^s) have been replaced by constants g_, and the operators a^j^g, Ugjjg and Ugjjg have been replaced by a^g,, u^g, and u^gi, respectively. The replacement of the axioms DAT4, DAT5 and DAT6 by the simple axiom DRT4 as well as the replacement of the axioms DAI0-DAI5 by the axioms DRI0-DRI5 are strongly reminiscent of the real time case.
Process algebra with timing: real time and discrete time
667
Table 23 Additional axioms DRTl DRT2
<^;e|(<|(^))^ < | ( ^ ) + < l (y) = < , U + y) DRT3 DRT4 < | W - y = .^;;i(^ y) DRT7
oUh=i
£ + ^= £
A6DRa
'^;;,w=^
DRTOO
^•iiW = «
DRTOl DRT02
";;r(a)=« ,,'"+" r/T"Yv
\\—
rei
^-rer^^
n " /-l.'^Vv^^
nPTO'^
- r e r rer'*'^
i^;e|U + y) = < | U ) + < | ( y ) DRT04
u;^,(x->') = i;;;,(jc)-v
DRTOS
v%\M = x
DRIl
^rel'(^=<|(4) DRI2 ^rel^''(<|(^)) = <|(^;e|(^)) DRI3 V\'Q\{X + y) = u;;|U) + u;;,(v) D R I 4
I7;^,U-v) = I7;;,U)-v
DRI5
Similar to the case of BPA'*^^ we can prove that the auxiliary operators u^e, and u^e,, as well as sequential compositions in which the form of the first operand is not a (« 6 A) and alternative compositions in which the form of the first operand is a/g|(/), can be eliminated in closed terms of BPA^'^. The terms that remain after exhaustive elimination are called the basic terms over BPA^'^. SEMANTICS OF B P A ^ ^ . In case of relative timing, we can use a simple kind of discrete time transition system. A discrete time transition system with relative timing over A consists of a set of states S, a root state p eS and four kinds of relations on states:
a binary relation a unary relation a binary relation a unary relation
_ - ^ _ for each a eAy _ A ^ for each a eA, _ i—> _ for each n G N>o, ID(_);
satisfying (1) if ^ H ^ ^ s\ n, n' > 0, then there is a s" such that s A s" and s" h^ s'\ (2) if 5 h^ s^' and s'^ i—> s\ then s i > s'. We write DTTS'^(A) for the set of all discrete time transition systems with relative timing over A. Associating a transition system in DTTS'^(A) with a closed term t of BPA"^*^ proceeds in essentially the same way as associating a transition system in RTTS'^(A) with a
668
J.C.M. Baeten, CA.
Middelburg
closed term t of BPA^^. The only difference is that in the rules for the operational semantics of BPA^^ all numbers involved are restricted to N. Therefore, we refrain from giving the rules. Bisimulation on DTTS'^(A) is defined as on RTTS'^(A). As in the real time cases, we obtain a model for BPA^'^ by identifying bisimilar processes. Algebra of communicating processes. Like in ACP^^^ we do not have a discrete time counterpart of Vrei in ACP^*^. We can use u/g, instead. SIGNATURE OF ACP"^^. The signature of ACP^"^ is the signature of BPA'*'^ extended with the parallel composition operator ||: P*^ x P"^ ^ P^ the left merge operator [[: P"^ x P*^ -> P^ the communication merge operator |: P"^ x P"^ -> P^ and the encapsulation operators dn 'P'^P'^(foreach//CA).
Table 24 Additional axioms for ACP^'^ (a,b e As, c G A) g\k = g i f K ( a » = c g\k = i if K(a,^) undefined
CFIDR CF2DR
jc||>^ = (x lLv + vlLx)+jc| y Six = 8 JclL<5 = ^ gl(x+§)=g-(x-{-§)
CMl CMIDl CMID2 CM2DRID
a-xW_(y + §) = g-(x\\(y
CMSDRID
+ §))
<;^' (x) IL (^r'et' (V) + ^"eV(z)) = < + ' (x IL z) DRCM2 ix + y)lz = xlz-\-ylz CM4 8\x = 8 CMID3 x\8 = 8 CMID4 g'x\b
= ig\b)x
g\bx
= (g\b)x
g'x\k-y
= ig\^-ix\\y)
CM5DR CM6DR CM7DR
(vle\ (^) + i) I < / " ^ (V) = i <;+ \x)\ (u/3, (y) + 5) = I
DRCM3ID DRCM4ID
<et' (^) I < / " ' Cv) = < / " ' (^ I V) (x-hy)\z = x\z-\-y\z
DRCM5 CM8
x|(>; + z) = x | y + jcU
CM9
dHi8) = 8
DO
9 / / ( ^ = ^ if«^H ^Hig)=i \\aeH 9//Ke,U)) = or;;,0//(x))
DIDR D2DR DRD
^Hix + y) = dH{x)^dH{y)
D3
a//(jcy) = a//U)a,/(y)
D4
Process algebra with timing: real time and discrete time
669
AXIOMS OF ACP^'^. The axiom system of ACP'*'^ consists of the axioms of BPA'^'^ and the equations given in Table 24.
The additional axioms of ACP^^ are just simple reformulations of the additional axioms of ^(^pdat r^Yi2X is, constants a (a G A5) have been replaced by constants a_, and the operators (jg^g and Ug|35 have been replaced by a^g, and u^g,, respectively. As in the case of ACP^^\ we can prove that the operators ||, [[, | and 9// can be eliminated in closed terms of ACP^'^. SEMANTICS OF ACP^'^. Like for the rules for the operational semantics of BPA^'^, the additional rules for ACP^*^ differ from the corresponding rules for the real time case only in that all numbers involved are restricted to N. Therefore, we refrain again from giving the rules.
Again, we obtain a model for ACP^^ by identifying bisimilar processes.
5.3. Embedding ACP^^V in ACP'^'W In this subsection, we will show that ACP^^V can be embedded in ACP^'^^IV. We will do so in the way outlined in Section 4.3. The explicit definitions needed are given in Table 25. Notice that the operators a^^^, v^^^ and v^^^ of ACP^^^ s/ are simply defined as the operators ^abs' ^abs ^^^ ^abs ^^ ACP^^4V restricted in their first argument to N. We will estabUsh the existence of an embedding by proving that for closed terms the axioms of ACP^^V are derivable from the axioms of ACP^^^W and the explicit definitions given in Table 25. However, we first take another look at the connection between ACP^^^V and ACP^^V by introducing the notions of a discretized real time process and a discretely initialized real time process. In Section 3.2, we have introduced the model M;^ of ACP'^^V. The model of ACP^^V outUned in Section 5.1 is isomorphic to the subalgebra of M^ generated by the embedded constants and operators of ACP^^V. The domain of this subalgebra consists of those real time processes, i.e. elements of the domain of M^, that are discretized. We define the notion of a discretized real time process in terms of the auxiliary discretization operator P : P* -> P* of which the defining axioms are given in Table 26. A real time process x is a discretized Table 25 Definitions of discrete time operators (a €^s)
2 = /.e|0.l)^abs<") ^abs<^) = ''abs(^) "abs(^) =^^abs<^) ^abs(^) == ^abs<^)
V d ' - f = Vsi'-^bJ/']
670
J.C.M. Baeten, CA.
Middelburg
Table 26 Definition of discretization
V(8) = 8 V{a) = a V(x-\-y) = V(x) + V{y) V{x • v) = V{x) • V{y)
Table 27 Properties of discretized processes (a e A^) 8,a£D\S ^^0\S^ a^^^ix), v'^^ix), v'^^(x), dnix) € DIS X, V e DIS =» jc + y, JC • y, A- || y, JC (L y, Jc I y G DIS (VMGN.F[n//]€DIS) => v i / . F € D I S (Vp G V • F[p/v]
e DIS) =» /,,^^, F e DIS
jc G DIS =^ V{x) G DIS
real time process, written JC e DIS, if jc = T>(x). The properties given in Table 27 express that the set of all discretized real time processes is closed under the operators of ACP^^V, integration and discretization. For elements / of RTTS*(A), the discretization of / , P ( / ) , is obtained as follows (t e ^ ^ 0 , q = p-\-r mdq' = p + /): (1) for each r, if {s, p) A (^^ p) in / ( r ) , then (5, p) A {s\ p') in V{f){t) for each / € [ L / ^ J , L P + IJ);
(2) for each r, if (5, /?) A (y, p) in / ( r ) , then (5, /?') A (y, p') in P ( / ) ( 0 for each
p'eivpiip^^y. (3) for each r, if (5, p) A {5,^) in / ( r ) , then (5, p) A {^,^0 in V{f){t) for each ^'G[^,L^ + 1J); (4) for each r, if ID(^, p) in / ( r ) , then ID(5, p) in V{f){t)\ (5) for each r, if neither ID(5, p) in / ( r ) nor either {5, /?) A {5', /?) in / ( r ) for some ^ , 5 ' or {s,p) A {5,(7) in / ( / ) for some r, then {s,p) HA {^,^') in V{f)(t) for each^g^'eCp, Lp+ IJ). Hence, for real time processes corresponding to discrete time processes, the following holds: if an action can be performed at some time p such that n ^ /? < « + 1, it can also be performed at any other time p' such that n ^ p
Process algebra with timing: real time and discrete time
671
A real time process jc is a discretely initialized real time process, written x e DIP, if X = ^ / . t^abs^-^)- ^^ follows immediately that x € DIP ^ x = y/^v . t^abs^-^)- ^^ ^^ ^^^y ^^ show by induction on the term structure that all discretized processes are discretely initialized, i.e. X € DIS => JC G DIP. Not all discretely initialized processes are discretized, e.g., Vs ^ ' ^abs^^^ (^) ^ l^'P ^^^ \ 4 ^ • ^abs^^^ (^) ^ '-^'^- ^^^^ means that for real time processes corresponding to discrete time processes, the initialization time can always be taken to be a discrete point in time; and that there are real time processes not corresponding to discrete time processes for which the initialization time can always be taken to be a discrete point in time. L E M M A 7. For each closed term t of ACP^^^V generated by the embedded constants and operators of ACP^^V, t = ^^v . v^^^^it). P R O O F . From the properties given in Table 27, we know that each process x generated by the embedded constants and operators of ACP^^V is discretized, i.e. x G DIS. Because X G DIS ^ X e DIP and x G DIP ^ x = J^v . v^^^{x), the result immediately follows. D The following lemmas present other useful properties of discrete time processes. L E M M A 8. For each closed term t of ACP^^^V generated by the embedded constants and operators of ACP^^V, there exists a term t' containing no other free variable than V such that for each p e R^Q: u^^g^^) = ^abs^^'^P/^^)^ t'lp/v] = '^abs^^'lP/^M ^nd if p G [0, 1) andt^ 8, t'[p/v] - t'[p/v] + crl'/iS) andv^^^^(t + 8) = cr^^^(t'[p/v] + 8). In subsequent proofs, we write t[v] for a fixed but arbitrary term t' that fulfills these conditions, PROOF. Observe that, if /? G [0,1) and t i^ 5, vl^^{t -h 5) = ol^^{t\plv\ + I) follows direcdy from vl^^it) = ol^^{t\plv\) and t\plv\ = t^p/v] + ol~^\8)- Observe further that, if t' is a term that fulfills all above-mentioned conditions but t'[p/v] — "^^^i^'Vph\)-> ^abs^^'^ ^^ ^ ^^^™ that fulfills all conditions. Consequently, it suffices to prove that there exists a t' such that t^abg^^^ ~ ol^^{t'{plv\) and, if p G [0, 1) and t ^ 5, t\plv\ = t'\plv\ + <^\^i\h. It is straightforward to prove this by induction on the structure of r. We present only the case that / is of the form ^. The other cases are simpler or similar to corresponding cases in the proof of Lemma 3. —p
, .
_p
. c
,,,
, ^ - . SAI6 c
_/;
,
,.,
, ~ - . 1NT4
"abs(«) = "absUu,6lO,l)°^abs('')) = /u^elO.l) •^absKbs<«» n
_n
,
y,
,»..
,
^
_n
^
,,,
=
. ^ ^ , SAI1.2.3.SAI.V
i«.€[0,p) ^ a b s K b s ( « » + /«.€lp. 1) "abs(
i
P
(^\
X
P
t
U)-/7 . - . . . SAT3 c
/u.6[p.l)Kbs<^) + ' ^ i b s K b s i«.€[p.D'^absKbs
(«))
=
<"»)
=
P
/o ,
« ' - / ? . - . . A6{D
/».6|,^l)
=
'^abs«.6|p.l)'^abs <''»=<^abs
'^abs^(fwelOA-v) '^abs^amp/v]) and
672
/ C M Baeten, CA. Middelburg
r
W /~x A6SAa n
fwe[OA-p)^aU(^)
„,
,^
. ~. SAT3 r
+ Le[OA-p)^abs(^^)'='
/
?/' / ~ \
.
W / c w ''^^"
Le[OA-p^
D
LEMMA 9. For each p e M^o ^^d closed term t of ACP^^^V generated by the embedded constants and operators of ACP^^V, there exists a closed term t' such that v^^^(t) =
^L(t')^ ^i = ^abs(^')' ««^ ifpe[OA) and t ^ 8, t'= t'^ CTI;/(8) and v[^^(t + 5) = ^^bs^^' + 8). In subsequent proofs, we write t[p] for a fixed but arbitrary closed term t' that fulfills these conditions - like in case of applications of Lemma 3. This follows immediately from Lemma 8.
PROOF.
D
LEMMA 10. For each closed term t of ACF'^^^IV generated by the embedded constants and operators of ACP'^^V, there exists a closed term t' such that vl^^{t + 5) = lve[0 1) ^a^bs(^abs(^0 + 8). In subsequent proofs we write t"" for a fixed but arbitrary closed term t' that fulfills this condition. PROOF, it is straightforward to prove this by induction on the structure of r. We present only the case that t is of the form q^t". The other cases are simpler.
v^ia
. r" + 5) = ui,3((/,,[o.,, o^^,Ca)) • t" + /„,,o.,, a^^^d)) ^^"^^ '
^ibs(/ue(0.1) '^a^sf^)) • ' " + "ibs(/.elO. 1, <,/^))
' ' ' = "
(/ue[0,1)
1 ) K b s ( « ) • ^^bs('")) + Uo.
/ . e [ 0 , 1 ) ^ ^ ( 5 ) • < b s ( ' M ) ) + hm.
='
1, -a^s^^) ' • " ' = " ' " ' " 1) '^absf^) ' = '
/.e[0,1) < b s ( « • '^abs('M)) + /.elO. I)
°
Lemmas 7-10 are used to shorten the calculations in the proof of Theorem 12. The following lenrnia is also used in the proof of that theorem. LEMMA 11. For p e [0, 1), the equation v^t>s^S) — crj^s^^^ " derivable from the axioms of ACP^^'IV and the explicit definition of the constants and operators in Table 25. PROOF. ^ f b s ^ ^ = < b s ( / . e [ O . I ) < b s ( ^ ) ) '=Vi,e|0,l)^a''bsKbs(^)' ' = ' /i.6[0.p) i^fbs^^bs*^)) + fvGlp. I) ^abs(
y
.— p — v.—O
/oxxv
,
r
V
/Px SAI1.SAI2
^€[0,p)<^abs('^abs (»^abs(^))) + /uelp,l)'^abs<^'
=
iu€[0,/7)^absKbs (^)) + A.€[p.l)^abs(^) = irGlO,/.)^abs^^) + A.€(/7.1)^abs(^) P
/c\
.
1
.^x SAT2.3.A6ID
1
.;:.
= r-.
Process algebra with timing: real time and discrete time
673
The existence of an embedding of ACP'^^V in ACP^^^V is now established by proving the following theorem. THEOREM 12 (Embedding ACP'^^V in ACP'^'^v/). For closed terms, the axioms of ACP^^V are derivable from the axioms of ACP^^^Iv/ and the explicit definitions of the constants and operators a, a^^^, v^^^, v^^^ and Vd i^ Table 25. PROOF. The proof of this theorem is given in Appendix A2. The proof is a matter of straightforward calculations. Lemmas 1 and 3 (pages 635-636) and Lemmas 7-11 (pages 671-672) are very useful in the proof. n
6. Concluding remarks We presented real time and discrete time versions of ACP with both absolute timing and relative timing, starting with a new real time version of ACP with absolute timing called ACP^^^ We demonstrated that ACP^^^ extended with integration and initial abstraction generalizes the presented real time version with relative timing and the presented discrete time version with absolute timing. We focussed on versions of ACP with timing where execution of actions and passage of time are separated, but explained how they can be combined in these versions. The material resulted from a systematic study of some of the most important issues relevant to dealing with time-dependent behaviour of processes - viz. absolute vs relative timing, continuous vs discrete time scale, and separation vs combination of execution of actions and passage of time - in the setting of ACP. All real time and discrete time versions of ACP presented in this chapter include the immediate deadlock constant h. This constant enables us to distinguish timing inconsistencies from incapabilities of performing actions as well as idling. This is certainly relevant to versions with absolute timing because timing inconsistencies readily arise. The usefulness of the immediate deadlock constant in practice is not yet clear for versions with relative timing. Minor adaptations of the versions of ACP with relative timing presented in this chapter are needed to obtain versions without the immediate deadlock constant. The discrete time versions of ACP presented in this chapter are conservative extensions of the discrete time versions of [7]. The real time versions presented in this chapter, unlike the real time versions of [2] and [4], do not exclude the possibility of two or more actions to be performed consecutively at the same point in time. This feature seems to be essential to obtain simple and natural embeddings of discrete time versions as well as useful in practice when describing and analyzing distributed systems where entirely independent actions happen at different locations. We did not extend the different versions of ACP with timing presented in this chapter with recursion, abstraction, and other features that are important to make these versions suitable for being applied. This has been done for the earlier versions of ACP with timing referred to in this chapter. Some of those versions have been successfully used for describing and analyzing systems and protocols of various kinds, see, e.g., [16,27,31,32,40,41,
674
IC.M. Baeten, CA. Middelburg
45], as well as for defining semantics of programming and specification languages, see, e.g., [12,14,17]. We did not give explicit consideration to other algebraic concurrency theories that deal with time-dependent behaviour. In general, they have urgent actions and relative timing. This is, for example, the case with ATP [37], the different versions of CCS with timing [19,35,44] and TIC [39] - TIC is rooted in LOTOS [46]. We claim, on the basis of the connections described in [6], that there are indeed close connections between these theories and the versions of ACP with relative timing presented in this chapter, i.e. ACP^'^ and ACP^^. We also claim that there is a close connection between TPL [26] and ACP^*^, only TPL is based on testing equivalence instead of bisimulation equivalence. Timed CSP [21], which is based on timed traces and timed failures, has urgent actions and relative timing as well. In [20], the CCS-like process algebras with timing of [26,35,36,44] are compared. For comprehensive overviews of existing algebraic concurrency theories that deal with time-dependent behaviour, having their roots in ACP, CCS, CSP, LOTOS or others, the reader is referred to Chapter 12 of [30] and Chapter 8 of [42]. These overviews include discussions of interesting connections with the versions of ACP with timing presented in earlier chapters of [30] and [42], respectively.
A, Proofs of theorems Al. Theorem 6 THEOREM 6 (Embedding ACP''^ in ACP'^V). For closed terms, the axioms of ACP'"^ are derivable from the axioms of ACP^'^W and the explicit definitions of the constants and operators a, a^g,, u^^,, U^g,, and Vrei in Table 19. PROOF.
TO begin with, we show that the axioms of BPA^'^ are derivable for closed terms. Throughout this proof we do not expound the trivial cases. SRTl: aO,(/) = ^,v. v^^^U) '='
^s^.t''^\
SRT2 : < , K t , ( ' ) ) = v4 - K:/WS
- . vZ'O)
SRT3 : aP,(t) + a,^,(,') ^(^v.
'= Vs v . v^'(-Z'^'^n)
I7^'+/(r)) + (^3 w . v^^/a'))
'^
"^'
Vs ^ • (^ab?(') + <:/('')) ' = Vs - • <:/(' +'') =
• t') =
A6SRa: 5 + S = (Vs u - ol^{a)) + ( ^ ^ . o^^^Ch)) ' = ' Vs V . {al^^ia) + I7^',3(V3 w . o^^^Cm '=- 4 ^ • ('^lbs<«) + ^abs(<^abs(^))) ' = ' Vs V . Kbs(«) +
Process algebra with timing: real time and discrete time
675
A6SRb : o;;^,(t) + I = (^3 . . vl+^(t)) + Ws «' • ^abs<«)) ' = "
^4 "^ • K b s K b s ( ' ) ) + ^^bs(^)) ' = " Vs t'.
I . r = (V3 V . a^^^d)) •' ' = V s i' • (^^bs*^)' '> ' = ' Vs«' • K b s * ^ ) ' ^abs^')) '™="' Vs ^ • Kbs(^) •
SRTOO: u,^,(6) = Vs . . ^ : b ? ( ^ k ( ^ ) ) ' = " Vs " • -Ib^e^^bs*^)) " = ' Vs V .
- • ^rbT'^))) = '
Vs V. Cs''^''(^^bs(^r ('))) ^=i^ Vs -
C a s e ^ = 0 : = Vs i^ • a^bs W = Vs ^ • ^abs (^) = < | ( ^ )
= ^rel^^rel^^^^
Case ^ > 0 : = V3 u . u^^^g' ^u^^s ^^abs ^^^^^ = ,
_ i ; + / 7 . u+/7+t7 . _ i J + / ; . . , . SIA2
SRT04: t;,^,(/ + r') = V3 . . v^'iv^.^i,
/
_i'+/7
/
w'4-^
+ ,')) '^' ^ v . v^^/(v^,,(0
y,
..
+ V^^^)) ^^i~
Vs V . (i^ate''(^abs<')) + C ' ( ^ a b s < ' ' ) ) ) = Case p = 0: '''^'' ^ v . a^^^(S) ^-'"•^L^'•'^•^^ s'ds + S'"1°' vl'^,(t) + u,^,(/') Case p>0:'^4v.
(vl^f (v^^^U)) +
Vs V . (vZ'^v^.^.iO)
+ ITibs(^:b7(^^bs('')))) ' = '
Vs V . (t':b?(^abs(')) + KbM
^ • C ( ^ a " b s ( ' ' ) ) ) ) '=
U ^ • Cs^^^abs^'))) + (Vs "> • ^a"bt''(I^a"bs<''')) = ^rel<') + •^rel<'') SRT05 : ./;,(r • /') = ^3 v . u:+3''(I7^,3(/ • r')) '^' ^ v . v^'iv^^^O) 4 V . ivZ'ivlbsC^)
•,')
''l^'
•'') ' = '
SRIO:
i;,^3,(5) = Vs V . u^+'d^^bs*^)) ' = ' Vs i' • ^s'^^abs^^abs*^))) =
SRIl :
IJO,(/) = Vs V • I^i.bs(^abs<')) = 4 i' • ^^bsO ' = ' Vs ^ • ' ' = ' '
SRI2:
I7;-3,(a) = V3 . . I7^bt''(^abs(Vs «- • a-^,(a))) '':^' 4 v . v^'^KbsKbs^^^^^
'= '
Vs '^ • ^ab"s''('^abs(5)) '= Vs i' • ^bs^^^bs^^abs*"))) = ' Vs i' • ^bs^^abs^")) ' =
676
J.C.M, Baeten, CA. Middelburg
SRI3 :
v'::Ho,l,(t))
= V3 . . v'^r'(^kM
- -a"b:"('))) ^!^^
SRI4:
I7/;,(r + /') = Vs v . I 7 : b 7 ( ^ k ( ' + ' ' » = ' Vs « • (
+ v^^^U
^ • ^a"bt''(^a"bs<'')))) ' = '
U ^ • ^ab7(^abs('))) + (Vs u' • ^abt''(^a"bs<''))) = < ! < ' ) + ^re|('') SRI5 :
u;;,(/ • r') = v/s . . u:b7(^abs('' '')> ' = Vs v • (v^'^^ksC))'
''> ' =
(Vs''-^I^s''(^abs(')))-''=^rel<')''
Next, we show that the additional axioms for ACP^"^ are derivable for closed terms. CFISR :
a I 5 = (V3 V . <,3(5)) {^v.
a^^^Cb)) °'^™fe^-^^-^ y^ „ . ^^,,^(5 | h) " i ^ "
^4 ^ • o'abs^^) = c i f y ( a , 6 ) = c CF2SR:
The proof is similar to the proof of axiom CFl SR - axiom CF2SA is used instead of axiom CFISA.
CM2SRID : 5 i (f + S) = (Vs i;. a^bs<^» IL (? + (Vs i- •
/
U
/ - I. /* . oxxCM2SA
,
11
.~
n
.
"X
/
SATS
I, ,
,~
.,
i>
^-v
, J . . SAI1.SAT1.SIA6 n
^
"J^^^ SAT3.Lemma4
Vs •^ • cr^bs<" • ^absC + «)) = V s " • «^^bs<«)' ''absC + ^^^
=
Vs f • K b s ( ^ ) • (^abs(') + ^abs(^))) ' = ' ' Vs V . K b s ( « ) • (^abs*') + n b s K b s < ^ » » ' = ' Vs i' • K b s ( " ) • (^abs(') + ^abs< Vs «- • ^a"bs(^)))) '="*
Vs V . Kb3(5) • tJ^b3(/ + Vs w . ^3-3(5))) ' i ^ ' V s » ^ - K b s ( « ) < ' + Vs««-'Ta"bsW))'=' (Vs « • < b s ( " ) ) • (' + Vs w • '^a"bs(^') = « • ( ' + S)
CM3SRID : The proof is similar to the proof of axiom CM2SRID - axiom CM3SA is used instead of axiom CM2SA. SRCMIID : a4|(/) I (v,e\0') + h = (Vs V . vl+;U)) IL ((Vs V .
I (a>,3(.abs(/')) + a^,,C8))) ""'"'^•^^"
Vs V . K b f C ) ^ <^abs(-abs(/') + h) '^='' Vs i- • '^^bs(^) = ^
677
Process algebra with timing: real time and discrete time SRCM2ID : a,^|(/) I (v^^^(t') + a,^|(f")) =
Vs ^ • (^abs (^) l i (^abs (^abs^^ >> + ^abs ^^ )>)
=
Vs y ' K b s
=
(^) H- (^abs <^abs(^ )> + ^abs ^^ >))
Vsi'-'^abs C U - ' )
=
Vsi'-Vabs C U - ' )=<^rel<'lL' )
CM5SR:
Vs«' • ( « b . ( « ) • -^."bsC)) I < T i L ( ^ ) ) ' = ' Vs "^ • K b s ( « • ^ a V ( ' ) ) I < b s < ^ ) ) ' =""' Vs f • '^^bs(« • ^abs<') I *> SAT5
Vs ^ • < b s ( ( « i ^ ) • ^abs<')) ''= /
/
11 / - 1 Tx
^ SIA9 ,
/
.
,,
.- , r.
1.
Vs i^ • K b s < « I * ) • < b s ( ' ) ) "
,
,,
, - , r.>
=
/.vx Lemma4.SIA6
=
SACM5.DISTRI
((Vs " • '^abs(«)) I (Vs " • < b s ( * ) ) ) • ' = ( « I ^ ) • '
CM6SR and CM7SR: The proofs are similar to the proof of axiom CM5SR - axioms CM6S A and CM7SA are used instead of axiom CM5SA. SRCM3ID : (vrel(0 + h I <e|('') = ((Vs V . a^^bsCvabsC/))) + (Vs " • < b s ( ^ ) ) ) I (Vs f • ^ a b f O ) • " = " /
yy
1)
y
y ^^
11
,ovx I
i}4-r
y ^x SAT3.Lemma4
Vs V . ( ( ^ b s C v a b s O ) + a ^ b s ( ^ ) ' I ^abs ( ' »
=
Vs V . ( < b 3 ( V a b s ( 0 + S) I < b f ( ' ) ) ' ' ' = ' ' ' ' Vs V • < b s ( ^ ) = ^
SRCM4ID : The proof is similar to the proof of axiom SRCM3ID - axiom S ACM4' is used instead of axiom SACM3'. SRCM5 :
af^.t) | a'i.it') = Uv.
K^J'O)
K Vs - t r l . t ^ r ' ) ) ° ' " ^ " "
Vsi'-i^:b?('i'')=
o
/=\
o
/
/
V
.~vx SIA15.SAD
9//(«) = 9//(Vs^-^abs(^^)
=
/
y
.^
^
Vs^-^abs^^//^^^)
DISA
=
D2SR :
The proof is similar to the proof of axiom D I S R - axiom D2S A is used instead of axioms DISA.
SRD :
a f / ( < | ( 0 ) = a//(x/s V .
SRUO :
yrel(5) = Vs ^ • ^a'bs(^abs(5)) ' ^ ' = " ' " ^
SRUl :
yrel(S) = Vs ^ • ^abs(^abs(Vs ^ • ^abs^^))) ' = '
v^^^it))
SlA15.Lemma4.SAD
77^' + /^ (^H(t)) VsV-K^s
^ • ^abs^^) ''^=^'
=
^
SATl.SAIl
Vs ^ • ^abs^Vs ^ • Vabs(cr^^s^a)))
^=
Vg ^ • ^ a b s ^ ^ a b s K ^ b s ^ ^ ^ ) ^^' =
Vs ^ • < b s ( ^ a b s ( « ) ) ^ = ' Vs V • < b s ( ^ ) = ^
678
J.C.M. Baeten, C.A. Middelburg
SRU2:
v r e i ( < 3 | ( 0 ) = Vs '' • <^abs(^abs( Vs ^ • ^ a b t ' ^ ' ) ) ) " = " Vs V . ^bsCVs ^ • ^s.^(K^,'(')))
'=
Vs i- • < b s ( ^ a b s ( u ; b s ( ' ) ) ) ' ' = "'
Vs " . a3^bs(^absKbs('))) ' = ' Vs i' • ^ b s * ^ ) = ^ SRU3 :
i^reia + ?') = v i "^ • -^^bs'^absC + f ' ) ) ' " ' = ^ " Vs f • ( < b s ( ^ a b s ( 0 ) + ^T^bs^^'absC'))) ' = ' Vs V . ( < b 3 ( v a b s ( 0 ) + u;'b3(a^bs<^abs('')))) ' = ' Vs V . K b s ( ' ' a b s ( 0 ) + u!,bs
SRU4 :
v,el(? • ' ' ) = Vs '^ • ^bs^^absC • t')) '^'^ Vs '^ • < b s < ^ ' a b s ( ' ) ' ' ' ) • " = " " ' v4 i' • (o^absf'^absO) • / ' ) ' = ' (Vs i' • <^a'bs
A2. Theorem 12 T H E O R E M 12 (Embedding A C P ' ^ V in ACP'^'Iv/). For dosed terms, the axioms of ACP'^^V are derivable from the axioms of ACP^^'IV and the explicit definitions of the constants and operators a, cTg^jg, v^^^, Ugjjj and vd in Table 25. PROOF.
To begin with, we show that the axioms of BPA'*'" are derivable for closed terms. Throughout this proof we do not expound the trivial cases. DAT7:
A 6 D A a -.a+
8 = f^^^^ , , a^^^(a) + /^,,,o , , a^^^C&)' = ' ' /.,e|o. i , ( < b s < « ) + ^abs<^)) ' = '
/..€[0.1) '^abs^^ + ^) ^=''' /i.€|0,1) '^abs<^> = S DAT02 : < + ' (a) = . ^ + ' ( / , , „ ,, o^^^Ca)) '''l^ /.,„o,,, v'^^J ia^,,m i>6[0,l)'^abs(^abs DAIl :
(«»
=
^^i"'
/.•€l0.1)'^abs<'')=«
U^VCa) = ^ a V ( / . e [ 0 . 1 ) <^abs(^)) = ' Uo.
1,^abs'^bs^^)) ' = '
/.elO,l)
173"+' (a) = U^'+J (/„„o.,, <^a^bs(«)) = ' / . . l O . , , -'Z' (-^bs*^)) = ' /..[0..,
A;e[0,l)^absKbs
^^)) = ii'GlO.D^abs ^'^^ = ^abs ^^^
Next, we show that the additional axioms for ACP^^^ are derivable for closed terms. C F l D A : « | * = (/„,[o,i)'^^bs(«))l(/.elO,l)<^abs<^))' .r^v
INT3.4.11
/u€[0.1) fwe[0.1 )<^abs(") I <^a"bs(^" ' / t , € | O . I ) L 6 l O , . ) K b s ( « ) I '^a"bs(^» + / . . e l 0 . 1 ) K b s < " ) I < b s ( ^ ) ) + / . 6 [ 0 , l ) / « , € ( i . . l ) K b s < « ) I '^a"bs<*)) " " = " "
Process algebra with timing: real time and discrete time /.€[0.1) < b s ( ^ ) + /u€lO. I) '^abS<« I ^) + /,.€10.1)
V
^i
i ~ I t
I ox A6ID.A6SAa r
r
/ ~ i L\ ^^'^^'^
I. Suppose /7 € [0, 1), q e[0, p). Then<,3(5) | a^^,^Cb) ''""^'''-^a^,,ia)
| o^^,^(v,,,(h) + h ' ^ ' a^^,,CS).
By INT6, 4eio,p)(<^i;s(«) I '^abs(*)) = Le^O.p)
'='^bs*^)-
By INT6, / , , ( o . , , /u,el0.t.)<
^fbs(
\L<,3(' + SJ " = " < b s < < ' b s ( « ) ) ^
-a^bs(5) I -L(Hr^
+ ^) " " • = " "
-a''bs(
/ q-P,-
,,.
, 5.
+ -aVs''^^))) " " = ' "
, J , , , SATI.SAII.SIA6
<^absKbs (« • (ClP) + ^\
+ ^))) ' " ^ "
< b s ( < b s ' ' ( 5 ) • (^abs^fClp] + 5 ) l , - p | ) + '^a'bs"(^)» = - r b s K V s ' ' ( « ) • ( ^ a V s ^ ' l . ] + ^) + <^a;7'(^))) " = " '^a'LsKVs''^^) • (hp\ + «)) ' = ' °^a'bs('^aVs"(«))' '^ibs^'lH + ^) = /?
.
Q — Pf\\
"^abs^^bs
—P
/.
, ox SIA6.SAT2.SAI3'_w
(«)> • ^abs(' + ^ '
=
,
^
.~v.
.^ ,
o.
^abs(
679
680
J.C.M. Baeten, CA. Middelburg II. Suppose p e [0, q], ^ e [0,1), t = 8. T-u 9
—P
/
^
, - - \ II
1
/ ~ \ \ II ~P
, S^ S A T 2 , S A C M :
/~\
1
/
=
/?x INT8.A6ID
=
I o\ SAI3'.A61D a
,- „
a
. - . .. _ / 7
l-o,J,,CM2SA
,-.
,
=
, „. SA13'_/7
<^abs<«)<'+^)
=
„ Lemma 11
(/
,-
1-^
J
SAI.1'.SAT2.S
q
.-..
.,
=
, o.
i^absKbs(«)'<'+^)
III. Suppose p € (9, 00), q € [0, 1). Thenl^:,3(a3^bs(5)) ll^a'bs('+^)'" = "'
+ i ) I < b t ' C ) " =^'" (/.elO, I,
""='•"
/uelO, DC^a^bsC^absC") + 5) I < b t ' ( ' ' » ' ' = ' ' / . € | 0 , 1 , '^abs(^) = ^
DACM4 : The proof is similar to the proof of axiom DACM3 - axioms INT 15 and SACM4' are used instead of axioms INT14 and SACM3'. DIDA :
3Hia) = a//(/,,^o.l)
D2DA :
The proof is similar to the proof of axiom DIDA - axiom D2SA is used instead of axioms DISA. Finally, we show that the additional axioms for discrete initial abstraction are derivable for closed terms. DIAl : ^^j.G
= 4w.
G[lwi/j]
Vsy'G[i/j][lvi/i]
=
'=' V3 v . G[lwi/j][v/w]
= ^^v . G[lv]/j]
=
^^i.G[i/j]
DIA2 : iJ;^bs(Vd^'. ^) =^abs(Vs ^ • nivi/i])
'':^'v^^^,(F[lvi/i][n/v]) = v'^^^iF[n/i])
DIA3 : Vd' • (Vd 7 . F) = Vs ^ . (Vs ^ • niwi/j])[lvi/i] Vs i^. (Vs ^ • niwi/j][lvi/i])
=
' = ' V3 i;. F[lwi/j][lvi/i][v/w]
=
Vs y • nivi/j][ivi/i] = Vs ^ • ni/j][iv\/i] = Vd' • n//y] DIA4 : G ^=Vs ^ • G^ = Vs ^ • <^[bJ/^] = Vd' • ^ DIA5 : Suppose p e R^o and Vn e N • i^^bs^^^ = ^abs^^'^Thenu^bs(^)
=
^abs^Vs^ • ^abs^^)) = ^abs^^abs^^)) = ^abs^^abs^^ )) =
^absWs ^ • ^abs^^ ^^ BySIA5, F = F'.
"
^abs^^ >•
Process algebra with timing: real time and discrete time FM A/:
DIA6:
«
/
\
r--
n
/C
V
/~xx
„ JNTIO. 12.SAT2 r
^ a b s ( ^ - ^ =
=
/
n+V/-^
681 r-x Lemma7.SIA6
/.elO.oKbs («)' ^ )
=
/..[0,.)Kbt^(^) -;'bs(^)) ""'-'""-a'bs(/.eia.)-^bs(^)) -abs(^) =
a,"bs(Vd^- • ^ ) = < b s ( V s ^ • ^ [ b J / / ] ) ' ^ ' ^ b s ^ ^ l H / ' M O / t ; ] ) = < b s ( ^ [ 0 / / ] )
DIA8:
(Vd''-n + G = (Vs^.^[W//]) + G ' ' = " '
Vs^ • ( ^ + i^ibs(^))[Li^J/n = Vd'• ( ^ + ^ibs(<^)) DIA9 :
(^^i.F)-G 4v.{F'G)[lvi/i]
= (^ v . F[lv]/i]) =
• G ' = V s ^ • (niv}/n
' G) =
^^i.iF-G)
DIAIO : i;2b3(Vd / • F ) = u;'^,3(Vs 1^. F [ b J / / ] ) ' = V s ^ • i ^ ; W ^ ^ D I M 1, DIA12, DIA13 and DIA14 : The proofs are similar to the proof of axiom DI AS - axioms SI A11, SIA12, SIA13 and SIA14 are used instead of axioms SIA8. DIA15 : The proof is similar to the proof of axiom DIAIO - axiom SIA15 is used instead of axioms SIAIO. D
References [1] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [2] J.C.M. Baeten and J.A. Bergstra, Real time process algebra. Formal Aspects of Computing 3 (2) (1991), 142-188. [3] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra (extended abstract), CONCUR'92, Lecture Notes in Comput Sci. 630, W.R. Cleaveland, ed., Springer-Verlag (1992), 401-420. Full version: Report P9208b, Programming Research Group, University of Amsterdam. [4] J.C.M. Baeten and J.A. Bergstra, Real space process algebra. Formal Aspects of Computing 5 (6) (1993), 481-529. [5] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra with abstraction. Fundamentals of Computation Theory, Lecture Notes in Comput Sci. 965, H. Reichel, ed., Springer-Verlag (1995), 1-15. [6] J.C.M. Baeten and J.A. Bergstra, Real time process algebra with infinitesimals. Algebra of Communicating Processes 1994, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Workshop in Computing Series, Springer-Verlag (1995), 148-187. [7] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra. Formal Aspects of Computing 8 (2) (1996), 188-208. [8] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra: Absolute time, relative time and parametric time. Fund. Inform. 29 (1/2) (1997), 51-76. [9] J.C.M. Baeten and C. Verhoef, A congruence theorem for structured operational semantics with predicates, CONCUR'93, Lecture Notes in Comput Sci. 715, E. Best, ed., Springer-Verlag (1993), 477-492. [10] J.C.M. Baeten and C. Verhoef, Concrete process algebra. Handbook of Logic in Computer Science, Vol. IV, S. Abramsky, D. Gabbay and T.S.E. Maibaum, eds, Oxford University Press (1995), 149-268.
682
IC.M. Baeten, CA.
Middelburg
[11] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts in Theoretical Computer Science 18, Cambridge University Press (1990). [12] J.A. Bergstra and P. Klint, The discrete time TOOLBUS -y4 softM'are coordination architecture, Sci. Comput. Programming 31 (1998), 205-229. [13] J.A. Bergstra and J.W. Klop, The algebra of recursively defined processes and the algebra of regular processes, Proc. 11th ICALP, Lecture Notes in Comput Sci. 172, Springer-Veriag (1984), 82-95. [14] J.A. Bergstra, C.A. Middelburg and Y.S. Usenko, Discrete time process algebra and the semantics of SDL, Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 1209-1268. [15] R.N. Bol and J.F. Groote, The meaning of negative premises in transition system specifications, J. ACM 43 (1996), 863-914. [16] S.H.J. Bos and M.A. Reniers, The fiC-bus in discrete-time process algebra, Sci. Comput. Programming 29 (1997), 235-258. [17] J. van den Brink and W.O.D. Griffioen, Formal semantics of discrete absolute timed interworkings. Algebra of Communicating Processes 1994, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Workshop in Computing Series, Springer-Veriag (1995), 106-123. [18] S.D. Brookes, C.A.R. Hoare and A.W. Roscoe, A theory of communicating sequential processes, J. ACM 31 (1984), 560-599. [19] L. Chen, An interleaving model for real-time systems. Symposium on Logical Foundations of Computer Science, Lecture Notes in Comput Sci. 620, A. Nerode and M. Taitslin, eds. Springer-Veriag (1992), 81-92. [20] F. Corradini, D. D'Ortenzio and P. Inverardi, On the relationships among four timed process algebras. Fund. Inform. 38 (4) (1999), 377-395. [21] J. Davies et al.. Timed CSP: Theory and practice. Real Time: Theory and Practice, Lecture Notes in Comput Sci. 600, J.W. de Bakker, C. Huizing, W.P de Roever, G. Rozenberg, eds. Springer-Veriag (1992), 640-675. [22] W.J. Fokkink, An elimination theorem for regular behaviours with integration, CONCUR'93, Lecture Notes in Comput Sci. 715, E. Best, ed.. Springer-Veriag (1993), 432^446. [23] W.J. Fokkink and A.S. Klusener, An effective axiomatization for real time ACP, Inform. Comput. 122 (1995), 286-299. [24] W.J. Fokkink and C. Verhoef, A conservative look at operational semantics with variable binding. Inform. Comput. 146 (1998), 24-54. [25] J.F. Groote, Transition system specifications with negative premises, Theoret. Comput. Sci. 118 (1993), 263-299. [26] M. Hennessy and T. Regan, A process algebra for timed systems. Inform. Comput. 117 (1995), 221-239. [27] J.A. Hillebrand, The ABP and CABP — a comparison of performances in real time process algebra. Algebra of Communicating Processes 1994, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Workshop in Computing Series, Springer-Veriag (1995), 124-147. [28] C.A.R. Hoare, Communicating Sequential Processes, Prentice-Hall (1985). [29] A.S. Klusener, Completeness in real-time process algebra, CONCUR'91, Lecture Notes in Comput Sci. 527, J.C.M. Baeten and J.F. Groote, eds. Springer-Veriag (1991), 376-392. [30] A.S. Klusener, Models and axioms for a fragment of real time process algebra, Ph.D. thesis, Eindhoven University of Technology, Department of Computing Science (1993). [31] M.J. Koens and L.H. Oei, A real time p.CRL specification of a system for traffic regulation at signalized intersections. Algebra of Communicating Processes 1994, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Workshop in Computing Series, Springer-Veriag (1995), 252-279. [32] J.M.S. van den Meerendonk, Specification and verification of a circuit in ACP^x\-JD, M.Sc. thesis, Eindhoven University of Technology, Department of Mathematics and Computing Science (1996). [33] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput Sci. 92, Springer-Veriag (1980). [34] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [35] F. MoUer and C. Tofts, A temporal calculus of communicating systems, CONCUR'90, Lecture Notes in Comput Sci. 458, J.C.M. Baeten and J.W. Klop, eds. Springer-Veriag (1990), 401-415. [36] F. Moller and C. Tofts, Relating processes with respect to speed, CONCUR'91, Lecture Notes in Comput Sci. 527, J.C.M. Baeten and J.F. Groote, eds. Springer-Veriag (1991), 424-438.
Process algebra with timing: real time and discrete time
683
[37] X. Nicollin and J. Sifakis, The algebra of timed processes ATP: Theory and application. Inform. Comput. 114(1994), 131-178. [38] G.D. Plotkin, A structural approach to operational semantics. Technical Report DAIMI FN-19, University of Aarhus, Department of Computer Science (1981). [39] J. Quemada, D. de Frutos and A. Azcorra, TIC: A timed calculus. Formal Aspects of Computing 5 (3) (1993), 224-252. [40] A. Stins and A. Schoneveld, Specification of a bank account with process algebra. Report P9307, University of Amsterdam, Programming Research Group (1993). [41] J.J. Vereijken, Fischer's protocol in timed process algebra. Algebra of Communicating Processes 1995, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds, Report 95-14, Eindhoven University of Technology, Department of Computing Science (1995), 245-284. [42] J.J. Vereijken, Discrete time process algebra, Ph.D. thesis, Eindhoven University of Technology, Department of Computing Science (1997). [43] C. Verhoef, A congruence theorem for structured operational semantics with predicates and negative premises, Nordic J. Comput. 2 (1995), 274-302. [44] Wang Yi, Real-time behaviour of asynchronous agents, CONCUR'90, Lecture Notes in Comput Sci. 458, J.C.M. Baeten and J.W. Klop, eds. Springer-Verlag (1990), 502-520. [45] A. van Waveren, Specification of remote sensing mechanisms in real space process algebra. Report P9220, University of Amsterdam, Programming Research Group (1992). [46] LOTOS — a formal description technique based on the temporal ordering of observational behaviour. International Standard ISO 8807 (1989).
Subject index absolute timing, 631, 661 ACP^^^663 ACP'*^V,664 ACP^'^, 668 ACP'^^ 640 ACP^^^I, 646 ACP^^^y, 649 ACP''^, 656 action, 631 -undelayable, 661, 666 - urgent, 632, 652 action step relation, 637, 654 action termination relation, 637, 654 alternative composition, 632, 652, 661, 666 axiom system -ofACP^^\663 -ofACP^'^,669 -ofACP^^^641 -ofACP''^,656 -ofBPA^^^661 -ofBPA^'^,666 -ofBPA'^^633 -ofBPA^'^,653 basic term, 635, 647, 653, 662, 667 bisimilar, 640, 651,666 bisimulation -onDTTS(A),663 -onDTTS*(A),666
-onDTTS'(A),668 -onRTTS(A),640 -onRTTS*(A),651 -onRTTS'(A),656 BPA'^^^661 BPA^'^,666 BPA^^^632 BPA''^^652 communication function, 631 communication merge, 641, 656, 663, 668 congruence theorem, 640 deadlock - immediate, 632, 652, 661, 666 - undelayable, 661, 666 - urgent, 632, 652 delay -absolute, 632, 661 - relative, 652, 666 discrete time process algebra - with absolute timing, 661 - - extensions of, 664 - with relative timing, 666 discrete time transition system, 662 - with parametric timing, 666 - with relative timing, 667 discretely initialized real time process, 671 discretization, 669
684
J.C.M. Baeten, C.A. Middelburg
discretized real time process, 670 DTTS(A), 663 DTTS*(A),666 DTTS^(A), 667 elimination result, 635, 643, 647, 650, 653, 656, 662, 663 embedding, 657 - of ACP'^^^ in ACP^^^iy, 669-673 - of ACP^'^ in ACP^^^ v/, 657-660 encapsulation, 641, 656, 663, 668 explicit definition, 658 immediate deadlock, 632, 652, 661, 666, 673 immediate deadlock relation, 637, 654 initial abstraction - discrete, 664-666 -standard, 648-651 initialization -absolute, 632,661 - relative, 652, 666 - urgent - absolute, 641 - relative, 656 integration, 646-648 - prefix, 647 left merge, 641, 656, 663, 668 panth format, 640 parallel composition, 641, 656, 663, 668 parametric timing, 651, 666 process - absolute time, 632 - parametric time, 649 - relative time, 652 process algebra - discrete time - - with absolute timing, 661-664 - with relative timing, 666-669 - real time - - with absolute timing, 631-645 - with relative timing, 652-656 real time process algebra - with absolute timing, 631 - extensions of, 645 - with relative timing, 652 real time transition system, 637 - with parametric timing, 651 - with relative timing, 654 relative timing, 652, 666 root state, 637, 654, 662, 667 RTTS(A),637 RTTS*(A),651
RTTS'(A), 654 semantics -ofACP^^^664 - o f ACP^'^,669 - o f ACP'^^643 -ofACP'^'^,656 -ofBPA^^',662 -ofBPA^'^,667 -ofBPA'^^637 -ofBPA''^,654 sequential composition, 632, 652, 661, 666 signature -ofACP^^^663 -ofACP^'^,668 - o f ACP'^^641 - o f ACP''^,656 -ofBPA^^^661 -ofBPA^'^,666 -ofBPA^^^632 -ofBPA'^^,652 standard initialization axioms, 652 state, 637, 654, 662, 667 stratifiable, 638 - strictly, 638 structural operational semantics, 637 term deduction system, 638 time factorization, 633 time slice, 661 time step relation, 637, 654 time variable, 646 time-out -absolute, 632, 661 - relative, 652, 666 time-stamped actions, 643 time-stamping scheme, 629 transition system - discrete time, 662 - - with parametric timing, 666 - with relative timing, 667 - real time, 637 - - with parametric timing, 651 - - with relative timing, 654 two-phase scheme, 629 undelayable action, 661, 666 undelayable deadlock, 661, 666 urgent action, 632, 652 urgent deadlock, 632, 652 urgent initialization -absolute, 641 - relative, 656 variable binding operator, 645
CHAPTER 11
Probabilistic Extensions of Process Algebras^ Bengt Jonsson^ Wang Yi^ Kim G. Larsen^ Department of Computer Systems, Uppsala University, Sweden, E-mails: [email protected], [email protected] - Department of Computer Science, Aalborg University, Denmark, E-mail: [email protected]
Contents 1. Introduction 2. Preliminaries 3. Probabilistic models 3.1. Probabilistic transition systems 3.2. Variants of probabilistic transition systems 4. Operators of probabilistic process algebras 5. Probabilistic bisimulation and simulation 5.1. Probabilistic bisimulation 5.2. Probabilistic simulation 5.3. Congruence properties 6. Testing preorders 6.1. Related work 6.2. Tests, testing systems and preorders 6.3. Characterization of testing preorders 7. Probabilistic logics 7.1. Characterizing preorders 7.2. Model checking probabilistic temporal logics 8. Conclusion and trends References Subject index
687 688 690 690 691 692 695 695 697 698 699 700 700 702 704 704 706 706 707 710
*This chapter is dedicated to the fond memory of Linda Christoff. HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
685
686
B. Jonsson et ai
Abstract In this chapter, we adopt ProbabiHstic Transition Systems as a basic model for probabiHstic processes, in which probabihstic and nondeterministic choices are independent concepts. The model is essentially a nondeterministic version of Markov decision processes or probabilistic automata of Rabin. We develop a general framework to define probabilistic process languages to describe probabilistic transition systems. In particular, we show how operators for nonprobabilistic process algebras can be lifted to probabilistic process algebras in a uniform way similar to de Simone format. To establish a notion of refinement, we present a family of preorders including probabilistic bisimulation and simulation, and probabilistic testing preorders as well as their logical or denotational characterization. These preorders are shown to be precongruences with respect to the algebraic operators that can be defined in our general framework. Finally, we give a short account of the important work on extending the successful field of model checking to probabilistic settings and a brief discussion on current research in the area.
Probabilistic extensions of process algebras
687
1. Introduction Classic process, algebras such as CCS, CSP and ACP, are well-established techniques for modelling and reasoning about functional aspects of concurrent processes. The motivation for studying probabilistic extensions of process algebras is to develop techniques dealing with non-functional aspects of process behavior, such as performance and reliability. We may want to investigate, e.g., the average response time of a system, or the probability that a certain failure occurs. An analysis of these and similar properties requires that some form of information about the stochastic distribution over the occurrence of relevant events is put into the model. For instance, performance evaluation is often based on modeling a system as a continuous-time Markov process, in which distributions over delays between actions and over the choice between different actions are specified. Similarly, reliability can be analyzed quantitatively only if we know some probability of the occurrence of events related to a failure. Performance evaluation and reliability analysis are well-established topics, and it is not the aim to contribute in these areas. Rather, we should try to see what the process algebraic approach can offer to these fields. Process algebras has contributed to our understanding of - how to describe (model) communicating systems compositionally, - how to formulate correctness properties of systems, - how properties of a system relate to properties of its components, and - what it means for a description of a system component to be a correct implementation of another component description. A solution to these problems would be very useful, e.g., in a stepwise development process. An abstract model can be analyzed by proving properties in some logic (for the nonprobabilistic case, see e.g., [11], Chapter 4 in this Handbook). The abstract model can then be refined in a sequence of steps, where correctness is preserved in each step by establishing a preorder relation between the refined system and the refining one (techniques for the nonprobabilistic case are described in [18], Chapter 6 of this Handbook). In this chapter, we will study the above issues in the context of a simple yet general model of probabilistic processes. In the nonprobabilistic setting, labeled transition systems are well-established as a basic semantic model for concurrent and distributed systems (e.g., [47,50]). In the literature, the model of transition systems has been extended to the probabilistic case by adding a mechanism for representing probabilistic choice (e.g., [33,32, 35,45,48,51,52,54]). We will adopt a model of probabilistic transition systems, in which probabilistic and nondeterministic choice are independent concepts. Nondeterminism can be used to represent underspecification, which can then be partly removed in refinement steps. For example, nondeterminism can be used to specify the allowed probabilities of failure of a medium, and a refinement can decrease the set of allowed failure rates [41]. Nondeterminism can also represent incomplete information on the parameters of system behavior, such as Milner's "weather conditions" [47]. Our model is essentially a nondeterministic version of Markov decision processes [27] or the probabilistic automata of Rabin [54]. In the area of process algebra, the model has been put forward by Vardi under the term concurrent Markov chain [58], by Wang and Larsen [60] and by Hansson and Jonsson as the alternating model [35], and by Segala and Lynch [56,55]. A deterministic version has been proposed as the reactive model by Larsen
688
B. Jonsson et ah
and Skou [45]. There are several other models of probabilistic transition systems proposed in the literature. A short summary will be provided in Section 3.2. The rest of the chapter will be organized as follows: Section 2 introduces notation and basic concepts from probability theory. Section 3 presents Probabilistic Transition Systems (PTS) as a basic model for probabilistic processes and summarizes variants of PTS proposed in the literature. Section 4 will consider how operators can be defined on probabilistic processes. We will, in particular, see how operators for nonprobabilistic process algebras can be lifted to the probabilistic case in a uniform way similar based on de Simone format. Probabilities are added only by means of a probabilistic choice construct. We will thereafter, in the following sections, consider different preorders between probabilistic processes, and how these preorders interact with the operators for constructing processes, i.e., (pre)congruence results. Section 5 is devoted to the development of probabilistic versions of bisimulation and simulation. These are preorders based on relating states or distributions to each other, i.e., relations on branching (or tree) structures. Section 6 presents testing preorders, another family of preorders that are defined in terms of an operational notion of testing, and characterize them in terms of simulations. Section 7 presents a basic probabilistic modal logic and show how it relates to and characterizes the various behavioural preorders. Also, we give a short account of the important work on extending the successful field of model checking to probabilistic settings. Section 8 concludes the chapter with a brief discussion on current research in the area.
2. Preliminaries In this section, we introduce some notation and definitions from probability theory. A probability distribution on a countable set 5 is a function n: S ^^ [0, 1] such that YlseS ^('^) — 1- More generally, a weighting on a set 5 is a function TT : S -^ IZ^o from S to nonnegative real numbers. Note that a probability distribution on a finite set 5 is a weighting TT on 5 such that 7t{S) = \. The support of a distribution or weighting n on 5, denoted support(7r) is the set of elements s such that 7T{S) > 0. For a subset 5' c S, we define 7T(S^) = 5Z^e5'7r(5). Let Dist{S) denote the set of probabiHty distributions on S. If TT is a probability distribution on S and p is a probability distribution on 7, then their product a =n x p is a probability distribution on ^ x r,definedby or((5,r)) =7T{s)^p{t). For simplicity, we shall write a{s, T) for or({^} x T) and a ( 5 , t) for G{S X [t]). We will next define a general way, proposed by Jonsson and Larsen [41 ], to lift a relation between two countable sets to a relation between distributions on these sets. DEFINITION 1 {Lifting). Let ^ c 5 x r be a relation between the sets 5 and T, :7r be a probability distribution on S and p be a probability distribution on 7. We define n ^"^ p iff there is a distribution a e Dist(S x T) on S x T such that - a(s, T) = nis) for each s e S, - a ( 5 , r) = pit) for each t e 7, and - a{s,t) =Oifs^t.
We shall write jt^p
whenever n ^*p and it is understood from the context.
Probabilistic extensions of process algebras
689
Intuitively, TT ^*p means that there is a distribution on S x T whose projection onto S is n, whose projection onto T is p, and whose support is in ^ . The relation n^*p thus holds if for each 5 G 5", it is possible to distribute the probability n(s) over elements of T that are ^-related to ^, in such a way that the sum of these distributed probabiUties, weighted by TT, is the distribution p. There is a simpler way of lifting equivalence relations on countable sets to the distributions on these sets. 1. Let ^ be an equivalence relation over the set S. Then n ^*p iff7T([s]) = P([s])forall equivalence classes [s] C S of relation ^ . THEOREM
PROOF. If: Assume that 7r([^]) = p{[s]) for all s e S. Let a{s, t) = 7T(S) * p(t)/n(ls]) if s ^ t and ;r(^) > 0, and 0 otherwise. Then a(s, S) = nis) * p([s])/n([s]) = 7t(s) as ^(['^1) = p([s]). Similarly, a(S, t) = p(t). The third condition holds immediately from the definition of a. Only If: Assume that 7r^*p and further assume that a is as in Definition 1. Then 7r([^]) = E5€[s]«('^' ^) = «(['^]' S) = (^([^l ['^D since a(s, r) = 0 for / ^ [s]. Symmetrically, p([s]) = a{[s], [s]). Thus n([s]) = p([s]). D
The lifting operation on relations preserves the characteristic properties of preorders and equivalences. THEOREM 2. Let ^ be a relation on the set S. Then ^ is a preorder implies that ^* is a preorderon Dist(S). PROOF. We only show the transitivity of ~*. Assume that n ^ p and p^ Q. Then there are distributions ot and p on S x S satisfying the three conditions given in Definition 1. Now let y(s, t) — Y^^'^^oiis, s')l p{s') *P(s\ t). We check the three conditions in Definition 1. First
s'eS
S'GS
=
2^0t(s,s')
=7T(S).
s'eS
Second, s'eS
=
s'eS
^fi(s\t)=Q(t). s'eS
For the third condition, note that if y(s, t) > 0 then there must be s' such that ot(s, s') * P(s\ t) > 0. This implies that s ^ s' and s' ^ t. By the transitivity of ^ , 5 ^ r. D The above result can be extended to equivalence relations.
690
B. Jonsson et ai
3. Let ^ be a relation on the set S. Then ^ is an equivalence implies that ^ * is an equivalence on Dist{S).
THEOREM
PROOF.
Immediate from Theorem 1.
D
Equivalences and preorders will be of particular interest in the rest of this chapter. We extend a relation ^ on the set S to the Cartesian product S x S in the usual way. That is, (s, t) ^ {s\ f) whenever s ^ s' and t ^ t'. Then ^* is preserved by the product operation on probability distributions. THEOREM 4. Let ^ be a preorder {or an equivalence relation) and n, p,7i' and p' be probabilistic distributions on S. Then n ^*p and n' ^*p' imply that n x jt'^* p x p\ PROOF.
By the transitivity of ^*, we only need to establish that n ^ p implies n x
Q^*PXQ.
Following Definition 1, we construct a distribution fi over (S x S) x (S x S). First note that 7r^*p. Thus, there exists a distribution a on S x S such that a(s, S) = 7T(S), Qf(5, s') = Q(t) and a(s, s') =OfoYs^ s\ Now let P({s, r), (s\ t')) = a(s, s') * git) whenever t = t' and 0 otherwise. Then P{(s,t),SxS)
= J2 {oi(s.s')*Q{t))==p(t)^ s'.t'eS
Yl
^(•^'^')
s'.t'eS
p(t) * y ^ a ( 5 , 5 ' ) = pit)
*n{s).
s'eS
Thus p holds for the first condition in Definition 1. Similarly, we can establish the second condition for p. That is PiS x 5, (s\ t')) = p{s') * Q{t'). The third condition is obvious. If {(s, t), (s\ t')) 76 then s 76 s'. Thus a(s, t)=0 and therefore p(is, /), (s\ t')) = a(s, s') *
^(/0=0.
D
3. Probabilistic models We consider a model of probabilistic transition systems, containing probabilistic and nondeterministic choices as independent concepts.
3.1. Probabilistic transition systems We assume a set Act of actions, ranged over by a and b. 2. A Probabilistic Transition System (PTS) is a tuple (5, -^^TTQ), where - 5 is a non-empty finite set of states, > C.S X Act X Dist(S) is a finite transition relation, and - TTo € Dist(S) is an initial distribution on S. DEFINITION
Probabilistic extensions of process algebras
691
We shall use s - ^ n to denote that {5,«, TT) G ^•. We use s —^ to denote that there is a 7T such that s - ^ n, and 5 - ^ to denote that there is no TT such that s -^ n. We say that a state s is terminal (written s -^^ )'\i s - ^ for all a G ^cr. This definition occurs with minor variations in [58,60,35,42,56,55,45]. In each state, a probabilistic transition system can perform a number of possible actions. Each action leads to a distribution over successor states. In many cases when it is understood from the context, we will identify a state s with the distribution that assigns probability 1 to the states. An initial state of a process P = (5, ^^, TTQ) is a state s ^S such that nois) > 0. A state s is reachable in V if there is a sequence ^o^i ... s,i where ^0 is initial, s = Sn, and for each 0 ^ / < n there is a distribution ;r/+i such that 5, -%• 7r/+i and TT/^I (5,4-1) > 0. A distribution 7T G Dist(S) is reachable in V if it is either the initial distribution or if s - ^ n for some a and state s which is reachable in V. We use s -^-^ s' to denote that there is a TT such that s - ^ TT and 7T{S') > 0, and 5-> ^ ^' to denote that there is an a such that s - ^ - - > s'. A finite process is a process (5, ^•, TTo) with a finite number of states, in which the relation ->--> is acyclic. A scheduler will decide which action should be taken in each state and then makes a probabilistic choice. Thus each scheduler corresponds to a probabilistic execution of a process. In the following sections, we shall study how to compare processes in terms of such executions.
3.2. Variants of probabilistic transition systems The reactive model. In [44,45,33] a simple class of probabilistic transition systems is identified as the reactive models. It is the class of probabilistic transition systems where all states s are deterministic in the sense that for each action a, whenever s —% 7T\ and s - % 7T2, then TTi =7T2. Systcms in the reactive models have the same structure as Markov Decision Processes [27]. The generative model. A definition of a generative probabilistic transition system differs from the one given above in that each transition is an element in 5 x Dist{Act x 5), i.e., the probabihty distribution also includes a distribution over the possible actions. If all actions in a distribution are identical, we get the above definition of a probabilistic transition system. ^ Several researchers (e.g., [34,20] have noticed that it is not trivial to define a symmetric parallel composition operator in the generative model. One source of difficulty is that in a generative model, a probabilistic transition system defines in each of its states a probability distribution over a set of enabled actions. This view makes sense if the set of enabled actions is offered by, e.g., the environment. If two probabilistic transition systems are composed in parallel, then each of them defines a separate probability distribution over a set of Note that the above notion of generative model still allows some nondeterminism in the sense that a state may have transitions to several distributions. In 133], states are allowed at most one transition.
692
B. Jonsson et al.
enabled actions. It is not clear how the set of "enabled actions'' is to be defined, nor how the two probability distributions should be composed. Approaches to this problem can be foundin, e.g., [20,17]. Another interpretation of a distribution over different actions in the generative model is that the choice is under control of the process itself. This could be the case if the actions are "output" actions, which communicate with corresponding "input actions" in a process that does not constrain the choice of the "outputting" process. A natural resulting model is then a probabilistic version of I/O automata, defined as Probabilistic I/O automata [59]. Probabilistic I/O automata use continuous time and rates to define transition probabilities. An model in a discrete-time framework that captures an analogous distinction between input and could, but not the time-dependent behavior modeled by the rates of Probabilistic I/0-automata, can be obtained from the model in Definition 2, as follows. For each input action, there is an enabled transition from each state. In each state, at most one output action may be enabled. The choice between different output actions must have been made in the previous transitions.
4. Operators of probabilistic process algebras In this section, we consider how operators can be defined in probabilistic process algebras. We will present a general framework that allows essentially any nonprobabilistic process algebra to be extended to a probabilistic process algebra by introduction of a probabilistic (internal) choice operator. The operators of the given nonprobabilistic process algebra may be lifted to operators in the probabilistic process algebra in a completely uniform way, under certain assumptions. Later we will instantiate the framework to particular process algebras. Terms in the resulting probabilistic algebra will denote probabilistic processes. A set of terms can be used to form a probabilistic transition systems as in Definition 2. Some of the terms will correspond to states, and the others will correspond to distributions over states. Terms of the nonprobabilistic process algebra are assumed to be formed in the usual way by the constant NIL, and a number of operators, each with a certain arity. NIL denotes a state which has no outgoing transitions. Also, the meaning of an «-ary operator op of the nonprobabilistic process algebra, is assumed to be defined by a finite set of rules in the so-called de Simone format [26] (see also Aceto, Fokkink and Verhoef, [2], Chapter 3 in this Handbook): A l ^ ^ ' ^/,
•••
Pi, -^"'
qi,
(j^
op{p\,...,p„)^''t where p\,...,pn and qi^,...,qi}, are all distinct process expression variables, a and a\, ...,ak are actions, {/?/,,..., /7^} is a subset of [p\ , A;}, and t is a linear term" over the process expression variables { p i , . . . , P/;}\{/?/,,..., p^} U {<7/,,..., ^ ^ } . In a linear term each variable occurs at most once.
Probabilistic extensions of process algebras
693
In the above rule (1), we say that the /th argument is initially active if / is among i\, ...Jk- For an n-ary operator op, the /th argument is said to be initially active if it is initially active in any of the defining rules for op. The probabilistic extension of the process algebra is obtained by an extension of the syntax allowing for distributions to be expressed. We introduce a single additional binary operator, internal probabilistic choice ^p, parameterized by a real number 0 ^ /? ^ 1. The term E ^p F denotes a distribution which assigns the probability p - E{s) -\- {\ - p) F(s) to each state s (note that we regard E and F as distributions and E(s) and F(s) are probabilities assigned by E and F on state s respectively). The choice is internal in the sense that the term denotes a probability distribution over states. Now, terms of the extended process algebra are build using the original operators op together with the new additional operator 0 ^ . Our guiding principle for separating these terms into those denoting states and those denoting distributions over states is, that all probabilistic choices should be resolved before any nondeterministic transition is taken. Thus, terms denoting distributions may be inductively defined as either terms of the form E 0 p F, or terms of the form op(t\,..., r„), where for some initially active position / the r, denotes a distribution. Formally this becomes: 3. The set of process expressions that denote states is defined as the smallest set that satisfies: - op(t\ ,"• Jn) denotes a state if all terms //,,..., //^ in initially active positions denote states. An arbitrary process expression op{t\, -•• ,tn), in which / i , . . . , /^ are the initially active positions, and where each f/^ denotes a distribution [r/J over states, denotes a distribution, which assigns the probability [[//,I(i^/,) * ••• * [^/JC^yu) to the state 0/7(^1,..., 5 / , , . . . , 5/^,. ..,/„), where op{t\, . . . , 5,,,.. .,5/^,.. .,/„) is obtained from op(t\,'-- Jn) by replacing the terms ti^,...,ti,. in initially active positions by states DEFINITION
To understand our general framework it may be instructive to consider the following examples: - NIL is a process expression, which denotes a state without outgoing transitions. - The prefixing operator is defined by the rule a.p-^^
p
Thus the term a.E has no initially active positions, and hence it denotes a state. The nondeterministic choice operator is defined by the rules >'P' p-^-q-^'^p'
q p+
q^'^p'
Thus, both positions are initially active. Figure 1 illustrates the behaviour of the term {a ®o.3 b) + (c 00.4 d). Note that this term (due to the presence of 0 in active positions) denotes a distribution. In the figure, we use dotted lines to indicate probabilistic choices
694
B. Jonsson et al (a 00.3 h) + (c eo.4 d) 0.12 a^ c a /
0.18 ^ a+ d
X^-^^ h+ c
^-*. b-^d
\c
Fig. 1. Behaviour of {a ®o.3 ^) + (<^ ®0.4 ^)-
(aeo.3fe)||(a + ^) 0.3.
a||(a + 6)
.0.'
6||(a + 6)
Fig. 2. Behaviour of (a ®o.3 b)\\{a + /?).
from distributions, and filled lines to indicate action transitions from states. Also, we are omitting trailing occurrences of NIL, writing a for «.NIL. The operator for synchronous parallel composition a'la CSP may be defined by the following rule:^
p\\q^-p'\\p' Clearly, both positions are initially active. Figure 2 illustrates the behaviour of the parallel term (denoting a distribution) {a 0o.3 b)\\(a + h), def
As usual, process constants P may be introduced by recursive definitions, P = E, with transitions of P being inferred from its definition E. Along similar lines, we can present a probabilistic version of SCCS, which is similar to the calculus PCCS presented by Giacalone et al. [32]. As in SCCS, let {Act, x, 1,) be the Abelian group of atomic actions. Intuitively, actions of the form a x p represent the simultaneous, atomic occurrence of the actions a and p. We will often write afi instead of a X p. The action 1 is the "idle action", and a is the dual action of of. The action of x a represents a synchronized communication between complementary actions, and or x a = 1. The syntax of PCCS is given by E ::= nil IXI Q:.E|E Sp F | E x F | E\A | E[f] | recX. E ^ We have chosen to illustrate a synchronous parallel operator, as we will need it later for introducing testing preorders. However, asynchronous parallel composition as in CCS may be extended in a similar manner.
Probabilistic extensions of process algebras
695
Table 1 Inference rules for PCCS
a.P p-^p' P^Q^ P-^P'
Q ^Q' P'
xC irM
^
P\A-^P'\A
d
P-^P' p^f^J^p'[f}
where A is a subset of Act such that 1 € A and / : Act i-> Act is a group morphism. Note the absence of nondeterministic choice in the above definition. The operational semantics of PCCS for action transitions is given in Table 1. In [32], the presentation is slightly different in appearance. In the operational semantics, transitions are of the form P P' meaning that "P can perform the action a with probability p and become process P"\ In this representation, F is a distribution over states, which assigns probability p to the set of states that can perform a and become P'.
5. Probabilistic bisimulation and simulation In this section, we will present a series of bisimulation-preorders between probabilistic processes. These are intended to be generalizations of corresponding preorders on nonprobabilistic processes (see also Cleaveland and Sokolsky, [18], Chapter 6 in this Handbook).
5.1. Probabilistic bisimulation A bisimulation can be understood as an equivalence relation, where two processes are equivalent if each process can mimick whatever the other process can do. We will first consider probabilistic bisimulation defined as an equivalence over states, not over distributions. 4 {Bisimulation). An equivalence relation R over a set of states 5 is a bisimulation if sRt implies that whenever s -^ n for some action a and distribution n, then there is a distribution p such that t —% p and ixRp. DEFINITION
In Figure 3 is an example of two bisimilar processes. In the process to the left, the action in leads to a distribution over two states. From the left state, the process can perform the action out, meaning that the action in has been performed normally. From the right state, only the action err can be performed, meaning
696
B. Jonsson et al.
out
out 0.8
0.8.
0.2\
Vv^
V'
^-J
^-J
Fig. 3. Two bisimilar processes.
that the previous action in was not successful. In the left process, the probability of an unsuccessful in action is 0.2. In the right process, the intention is to model two ways, represented by the states to the right, for the action in to be unsuccessful. Each of the states is reached with probability 0.1. In this process, both of these states are bisimilar, since they can perform equivalent actions, leading to equivalent states. Therefore, also the two start states (from which the action in can be performed) are equivalent, since they both lead to the successful equivalence class with probability 0.8 and to the unsuccessful equivalence class with probability 0.2). The above definition of bisimulation was introduced by Larsen and Skou [45] for reactive systems and it is the most commonly used generalization of bisimulation to the probabilistic setting. For models that embody both probabilistic and nondeterministic choice, in the way defined in this chapter, it can be argued that the above definition of probabilistic bisimulation is too restrictive. Namely, recall that we could let nondeterministic choices be resolved by schedulers, and that schedulers can be probabilistic. But the above definition of bisimulation considers only deterministic choices by schedulers. Consider for example the two processes of Figure 4. Note that ignoring the middle m-transition of the right process, these two processes are identical and the middle m-transition is a convex combination of the other two (see Definition 5). Assuming that schedulers can be probabilistic, the extra transition can be generated as a probabilistic choice over the two other transitions. It therefore does not add anything to the process, meaning that the two processes ought to be equivalent. The definition of probabilistic bisimulation can thus be weakened by including combined transitions as follows:
out
out
M^" Fig. 4. Two probabilistic bisimilar processes.
Probabilistic extensions of process algebras
697
5 (Combined transition). Let t be a state of a probabilistic transition system and let a be an action. We say that t -^ p is a combined transition of r if p is a convex combination of the set 77 = {p, 11 - % /?,} of distributions, that is, for each A , there is a nonnegativereal number A, such that J^i ^i — 1 ^"^ P — Hpien ^' * A • DEHNITION
DEFINITION 6 {Probabilistic bisimulation). An equivalence relation /? over 5 is a probabilistic bisimulation if ^/?r implies that whenever s —^ IT for some action (2 and distribution 7T, then there is a distribution p such that t - ^ p is a combined transition with
71 Rp.
We use 2::: to denote the largest probabilistic bisimulation i.e., the union of all probabiUstic bisimulations over S and Dist(S). Now we have a weaker equivalence relation than bisimulation. For example, consider the two processes shown in Figure 4. Note that the two processes are not bisimilar according to Definition 4. But they are bisimilar according to Definition 6 because the middle intransition is a combined transition of the other two. This definition was introduced by Segala and Lynch [56]. Following their terminology, we use the term bisimulation for the more restrictive definition, and the term probabilistic bisimulation for the definition which considers also combined transitions. With the definition of probabiUstic bisimulation, we can use a combination of two or more transitions to denote a range of allowed probabilities for the outcome of an action, namely those that are in the convex closure of the outcomes of the actions actually described. In this way, it is similar to the use of intervals by Jonsson and Larsen [41].
5.2. Probabilistic simulation A simulation can be understood as a relation, which captures the idea that one of the processes can mimick whatever the other process can perform. In contrast to bisimulation, a simulation need not be symmetric, since the mimicking capability is required only of one of the processes. 7 (Simulation). A preorder R over 5 is a simulation if sRt implies that whenever s - ^ TT for some action a and distribution n, then there is a distribution p such that t - % p and 7r/?*p. DEFINITION
As an example, consider again the two processes in Figure 4. The right process simulates the left one since it has more transitions. However, the left process does not simulate the right one . But as in the case of bisimulation, we can allow the matching transition t - ^ p to be a combined transition. We can then use simulation to let a range of possible outcomes of an action be simulated by an even wider range of possible outcomes. Figure 5 shows a simple example of this. According to previous definition, the left process is not simulated by the right process. For example, its first w-transitions is not simulated by any of the in transitions of the right process. However, the /^-transition is simulated by the convex
698
B. Jonsson et al
out
out 0.9!
Vj,Fig. 5. Probabilistic simulation.
combination of the two m-transitions of the right process, resulted by multiplying the two distributions by 3/4 and 1/4 respectively. It can thus be argued that a more appropriate definition of probabilistic simulation is the following: DEFINITION 8 {Probabilistic simulation). A preorder R over 5 is a probabilistic simulation ifsRt implies that whenever^ - % n for some action a and distribution it, then there is a distribution p such that t - ^ p is a combined transition with TtR*p. We use ^ to denote the largest simulation, i.e., the union of all probabihstic simulations over S and Dist(S).
For the nonprobabilistic case, we know that a bisimulation is a symmetric simulation and vice versa. This is also true in the probabilistic setting. THEOREM PROOF.
5. A probabilistic simulation is symmetric iff it is a probabilistic bisimulation.
The result follows from Theorem 1.
D
5.3. Congruence properties The bisimulation and simulation relations that have been introduced in this section, can all be checked on finite-state processes by a standard iterative procedure that repeatedly refines the universal relation until it satisfies the appropriate definition of (bi-)simulation. At each step, the condition for (bi-)simulation may in general involve checking for inclusion between convex polytopes, spanned by different possible outcomes of a nondeterministic choice. Decision procedures for checking probabilistic (bi-)simulation can be found in, e.g., [4,5]. These relations may be used to reason about probabilistic processes by means of algebraic operators in a compositional manner. A process expression may be generated by process constants, process variables and algebraic operators described in Section 4. We define a process context to be a process expression containing free process variables. We use C to denote the set of process contexts. Let C be a process context that contains free process variables t\... t,n. Let p\... Pm be process
Probabilistic extensions of process algebras
699
expressions that denote states or distributions. We write C[p\ /t\ ... Pm/tm] for the process expression C in which all tj are substituted with p,. As desired, the largest (bi-)simulation relations are all preserved by the algebraic operators described in Section 4. 6. Let C be a process context containing free process variables t\ .. .tm- Let p\ .. .pm <^nd q\ .. .qm be process expressions that may denote states or distributions. - Pi - Qi for all i implies that C[p\/ti • • • Pm/tm] - C[q\/ti • • • qm/tm]\ - Pi ^ qi for all i implies that C[p\/ti • • • p,n/tm] ~ C[q\/ti • • • qm/tml THEOREM
PROOF. By the transitivity of ^ and :^, the case when m > 1 can be transformed to the case of m = 1. For example, if p[p\/t\, p2/12] ^ p[q\/t\, pi/ti] and p[q\/t\, pi/ti] ^ p{q\lt\.q2/t2\. we have p[p\lt\, p2/t2] ^ p[q\/t\,q2/t2]' Thus, we consider only process contexts C with a single variable t. Let R = {{C[p/t], C[q/t]) \ p2:^q].We will show that /? is a probabilistic bisimulation. First we observe that, whenever;! ~ p, then C[7T/t]RC[p/t]. Now C will be of the form op(7ti, ...,7Tn,t, pi,.... p/() for some derived operator op, with jti, ...,JTn, and possibly r, denoting the initially active arguments. Assuming t is initially active in C, C[n/t] denotes the distribution, which assigns the probability TT (^) * TT 1 (^ 1 ) * • • • * 7r„ (qn) to the state op{q\, ...,qn,q,p\,...,pk). Similarly, C[p/t] assigns the probability yo(^) * 7ri(<3'i) * • • • * TT^i (^n) to the same state. As TT :^ p it follows that C[7t/t] and C[p/t] assign the same probabilities to equivalence classes of /?, which are sets of the form {D[p/t] \ p2^ po) for some state po. Thus, as claimed, C[7t/t] R C[p/t]. Now let (C[p/t], C[q/t]) e R and assume that C[p/t] - ^ n. We must find a matching, combined transition for C[q/t]. The transition of C[p/t] will be of one of the two following forms:
(i) (ii)
7t==C[p/t]; 71 = C[7T'/t] where t is active in C and p -^
TT' for some a.
In case (i), the "de Simone"-format allows us to infer that C[q/t] —> C'[q/t]. Since p'^q (both as states and singleton distributions), it follows from our first observation that C'[p/t]RC[q/tl In case (ii), it follows that n' 21 p' for some distribution p , where q - ^ p' is a combined transition (as p — q). Now, due to the "de Simone^-format, it may be argued that also C[q/t] —> C'[p^/t] is a combined transition. From our first observation, it follows ihdii C[7T'It]RC'[p'/tl As R is symmetric, this suffices to demonstrate that /? is a probabilistic bisimulation. The case of simulation can be established by similar argument using Theorem 4. D
6. Testing preorders In the previous section, we have defined preorders which are based on relating states or distributions to each other. For nonprobabilistic systems, there is another rich family of
700
B. Jonsson et al.
preorders, which are based on the comparison between execution sequences. These preorders can be based on traces, refusals, ready-sets, behaviors, etc. In this section, we are going to give a partial answer to the question how these preorders generalize to a setting with probabilistic processes. However, we are not going to define first some analogue of, e.g., traces. The reason is that such an analogue would not lead to a compositional preorder, as shown, e.g., by Segala [55]. Instead, we will use another method for arriving at a weaker compositional preorder. We will use the framework of testing, as defined by de Nicola and Hennessy [25]. The idea of this framework is that processes are compared by their ability to pass a specified set of "tests". We will generalize the framework of may-testing to probabilistic processes, and then characterize the resulting preorder. It will turn out that the resulting preorder will be rather different from the nonprobabilistic trace inclusion. In fact, it will be closer to the nonprobabilistic simulation preorder (in fact, it reduces to simulation in the nonprobabilistic case), for the reason that in the framework we will define, the probabilistic choices will induce an effect which is similar to "copying" of a process state. In this section, we give a simplified presentation by limiting tests to be finite processes.
6.1. Related work Testing-based preorders of probabilistic processes have also been studied by Christoff [12] and by Cleaveland, Smolka, and Zwarico [17] and by Yuen et al. [53,53,59]. These works consider a pure probabilistic model [33], and therefore their preorders do not capture the notion of refinement in the sense of being "less nondeterministic". On the other hand, they can be efficiently checked in the finite-state case, as demonstrated by Christoff and Christoff [13], using the polynomial-time algorithm for checking equivalence between probabilistic automata by Tzeng [57]. The work which is closest to the current one is by Segala [55], who define essentially the same testing preorders as in this work. However, Segala does not develop an explicit characterization of the testing preorder.
6.2. Tests, testing systems and preorders Following Wang and Larsen [60], we define tests as finite trees with a certain subset of the terminal states being "accepting states". DEFINITION 9. A (probabilistic) test is a tuple {T,^,po,T), where ((7, ^ > , po> is a finite tree, and ^ c r is a set of success-states, each of which is terminal.
A test T is applied to a process V by putting the process V in parallel with the test T and observing whether the test reaches a success state. We define a testing system as the parallel composition of a process and a test. DEHNITION 10. Let V = (5, -^^TTQ) be a process and T = {T, ^ , po, ^) be a test. The composition of P and T, denoted P | | T is a so-called testing system, defined as the process (5, ->, 7ro>||((r, ^ • ) , po) with success states S x T.
Probabilistic extensions ofprocess algebras
701
Our intention is that a testing system defines a probability of reaching a success-state. However, since from each state there may be several outgoing transitions, such a probability is not uniquely defined. We will be interested in the maximal probabilities of success. These can be defined inductively on the structure of the testing system. 11. Let P | | T be a testing system, composed of the process V = {S,^, TTQ) and the test T = (7, -^, po, ^)- For each state s\\t of V\\T we define its maximal probability of success, denoted t {si and its minimal probability of success, denoted t [5 J, inductively by - If 5IIr is terminal, then tfs] =t [s] = 1 if Ms a success-state, else r r-^l = ^ L^^J = 0- If 5" II / is not terminal, then DEHNITION
rm =
niax
(j^iir
x
p)(s'\\t')^t'ls'^\
tlsi=
min
( ^ ( T T x/>)(^'||r')*rl5'jY
and
For a distribution TT on 5" and a distribution /> on 7, we define
s\\t
and Pl7T\=J2^n
xp){s\\t)^tls].
s\\t
We define T[V] =
TTQ [pol •
and TlVj =
TTQ LPOJ •
We note that, using the definition of /O [TT] , we can make a simpler definition of / {s^ as tfs] =
max S\\t
PT^I.
>7TXp
We now define preorders of testing, which abstract from the set of possible expected outcomes when testing a process P by a test T: may testing considers only maximal possible expected outcome of 7^||T and must testing considers only minimal possible outcome. 12. Given two processes V and Q, we define (1) V ^may Q if VT: T{V^ ^ T[Q]; (2) V ^must Q if VT: Tin ^ TIQ\.
DEFINITION
702
B. Jonsson et al. Process P
Process Q
o.
.o. 0.3.
.0.7
0.1
.0.8
Fig. 6. P Qnun Q.
The intention, for example, behind the definition of ^may is that intuitively, V ^may Q should means that V refines Q with respect to ''safety properties". We can regard the success-states of a test as states defining when the tester has observed some "bad" or "unacceptable" behavior. A process then refines another one if it has a smaller potential for "bad behavior" with respect to any test. In the definition of V ^^ay Q. this means that the maximal probability of observing bad behavior of V should not exceed the maximal probabiUty of observing bad behavior of Q. For example, consider process P and Q in Figure 6. The probability that P may pass a test is always less or equal to the probabiUty Q may pass the same test; therefore P ^may \l-
A useful property of ^may and ^must is that it is compositional in the sense that they are precongruences with respect to our parallel composition operator. PROPOSITION 1. For arbitrary processes P, Q, R, (1) P ^may Q implies
P\\R ^niay
Q\\R\
(2) P ^ntust Q implies P\\R ^^ust Q\\R-
6.3. Characterization of testing preorders In the following, we show that testing preorders defined in Definition 12 can be characterized by variants of probabilistic simulation. When restricted to nonprobabilistic processes, probabilistic may-testing preorder coincides with ordinary simulation; whereas probabilistic must-testing preorder with refusal simulation [40]. We shall only consider may-testing. It may seem a little surprising that a preorder defined in terms of testing, which is a "lineartime" activity, is characterized by a simulation relation, which is a "branching-time" relation. The explanation is that the probabilistic choices of tests have the effect of "copying" the process under test into a number of copies, and that the testing of each copy is performed independently [1]. Recall that a probabiUstic process is essentially a distribution over states. Such a distribution gives rise to a number of possibilities for choosing the next action and next distribution. We will capture these possibilities in a notion of step corresponding to a transition in the nonprobabilistic setting.
Probabilistic extensions of process algebras
703
13. Let (5, ->) be a probabilistic transition system. A step is a weighting on Act X Dist(S). We say that a step 0 is a step of distribution TT on 5 if there is a function h : (Act X Dist(S)) i-> S such that - s —^ whenever 5 is in the support of h({a, n')), and - (T.hi{a,7T'))=s ^((^^ ^'))) ^ ^('^) fc>r each seS. We say that a step 0 is an ^-^-r^/? ifa' = a for all («', TT') in the support of 0. DEFINITION
Intuitively, a step represents a combination of next transitions that can be made by a process. A step from a distribution TT is a weighting over possible outgoing transitions, which is consistent with TT in the sense that it can be obtained by choosing for each state in the support of TT a subdistribution over outgoing transitions. Note that for a given distribution, there may be infinitely many steps possible. A step is normal if the function h in Definition 13 can be chosen such that for each nonterminal s in the support of TT, there is a {a, Tt') e (t> such that h{{a, TT')) = s and TT(hi{a, TT'))) =
>((«, 7r'))*7r',
i.e., posticf)) is the weighting obtained by projecting a step onto the "next" distribution in its transitions. The notion of post weighting is analogous to the notions of next state in the nonprobabilistic setting. We can now define the notion of step-simulation between weightings. DEHNITION 14 (Probabilistic step-simulation). Let {5, ^ > and (7, ->> be two probabihstic transition systems. A relation < c (Weight(S) x Weight(T)) between weightings on S and weightings on T is a probabilistic step-simulation if TT < p implies that TT(S)^p(T),md - for each normal step 0 from TT there is a step \l/ from p and a function h : support(0) i-> Weight(Act X Dist(R)) from pairs {a,TT') in the support of 0 to steps from p such that • h maps each {a, TT') to an a-step from i/^, • /z(0) ^ T/T, i.e., the image of 0 under h is "covered" by i/^, and • for each pair {a,TT') in the support of
TT'< post[h({a,TT'))). For two probabiHstic processes V = (5, ~>, TTQ) and Q = (7, -^, po), we say that V is simulated by Q if there is a probabiHstic step-simulation < between (5, ^•) and (T, -^> such that 7ro
704
B. Jonsson et al. Process P
.o. 0.3.''
• .0.7
simulated by
A step of Q
A normal step of P
o 0.3.''
(.-. . ^ - \ 0 . 7
"-.O.?
covered by
^x
s
/ sC/' .h\ \^
o
h
*/ .' Fig. 7. A proof for P < ^ .
p in the sense that each "next transition" («, TT') in the support of 0 can be covered by an astep from p, such that the weighted sum (weighted with respect to 0) of all the weightings h({a,7T')) is covered by ij/, and such that n' is simulated by the next-state distribution obtained from h((a, n')). In Figure 7, we illustrate why process P is simulated by process Q. Note that P ^niay Q as shown in Figure 6. The following characterization theorem was stated and proven by Jonsson and Wang in [43]. THEOREM 7T
7. n ^may P if and only if there is a probabilistic step-simulation < such that
7. Probabilistic logics 7.1. Characterizing preorders For non-probabilistic transition systems, several behavioural preorders have been characterized by simple modal logics. That is, the particular preorder has been shown to be completely captured by inclusion between the sets of logical properties satisfied by states (see also Bradfield and Stirhng, [11], Chapter 4 in this Handbook). Bisimilarity between nonprobabilistic transition systems is characterized by the socalled Hennessy-Milner Logic [37]. In [44-46], this characterization has been extended to probabihstic bisimulation for reactive probabilistic systems by identification of a suitable probabiUstic extension of Hennessy-Milner Logic. In [10,28,29], a further general-
Probabilistic extensions of process algebras
705
ization to non-discrete probabilistic systems (Labelled Markov Processes) is given, and in particular it is shown that probabilistic bisimulation can be characterized by a very weak, negation-free modal logic. In addition, and in contrast to [44-46], the characterization offered by [10,28,29] requires no finite branching assumptions. Here, we adapt the probabilistic modal logic, PML, of [44-46] to the probabilistic model studied in this paper. As for states, the formulas of the logic come in two flavours: nondeterministic formulas (ranged over by F, F,,...) and probabilistic formulas (ranged over by cp, (pi,...), given by the following abstract syntax (where p e [0, 1]): F ::= tt\F\
AF2\--F\
{a)(p,
cp ::= tt\(pi A(p2 \--(p\OpF. The interpretation is relative to a probabilistic transition system, (5, -^.TTQ). More precisely, the semantics of a formula F (respectively (p) is a set of nondeterministic states [F] (respectively of probabilistic states |[<^]), defined inductively as follows: (i) (iii)
M =S h F l = 5\[Fl
(ii) (iv)
lF,AF2J = l{a)(pj =
lF,jnlF2J {s\3a,7Telcpls-^7t}
(iO (iiiO
ltt}=Dist(S) l^
(ii') (ivO
[^1 A^2l = I ^ i l n M lOrF} = {Jt\7T(lFj)^p}.
For F a nondeterministic property, we write j F j c to denote the set of nondeterministic states satisfying F, when we use the combined transition relation in (iv). For a state s we denote by Sat{s) and Satc(s) the set of properties satisfied by s with respect to [| and IJc- Bisimulation and probabilistic bisimulation as presented in Section 5 may now be characterized as follows: THEOREM 8. Let {S, ->, no) be an image-finite'^ probabilistic transition system. Then two states s, t are bisimilar respectively probabilistic bisimilar if and only if Satis) = Sat{t) respectively Satc(s) = Satc(t).
Let NSat(s) and NSatc(s) denote the set of negation-free properties satisfied by the state s with respect to [] and | ] c . Then simulation and probabilistic simulation as presented in Section 5 are characterized as follows: THEOREM 9. Let {S, ^ , TTQ) be an image-finite probabilistic transition system. Then two states s, t are in the simulation preorder respectively probabilistic simulation preorder if and only ifNSat(s) C NSat(t) respectively NSatc(s) C NSatcit). ^ A probabilistic transition system (5, ^',7r()) is said to be image-finite if for all reachable nondeterministic states 5, the set {n \ 3a, s.s - ^ n) is finite, and for all reachable probabilistic states n, the set {s \7t(s) > 0} is finite.
706
B. Jonsson et al.
As an example reconsider Figure 4. Here the two processes are probabilistic bisimilar but not bisimilar. The lack of bisimilarity may, according to Theorem 8, be 'explained' by a distinguishing property, e.g.: {in) (•o.7 {out) tt A Oo.3 {err) tt) which is satisfied by the right process but not by the left processes (with respect to []). The above property is clearly negation-free, thus according to Theorem 9, this also demonstrates that the right process is not even simulated by the left one. Reconsidering Figure 5, the property {in) <>o.9 {out) tt is satisfied by the right process but not by the left processes (with respect to [Jc)- Thus the right process is not probabilistically simulated by the left one.
7.2. Model checking probabilistic temporal logics Several probabilistic extensions of temporal logics such as CTL and CTL* [15,16] have been suggested for the formal specification of probabilistic properties of systems. In addition, associated model checking algorithms have in many cases been offered. The first probabilistic extension of branching-time logics for expressing properties of probabilistic system was proposed by Hansson and Jonsson [35,36]. Formulas of the resulting logic PCTL are obtained by adding subscripts and superscripts to CTL formulas, as in • > 0 6^' which expresses that the property (p will hold within 15 transition-steps with probability at least 0.6. The presented model-checking algorithms rely on results on Markov chains and dynamic programming. Later, the logic PCTL was extended to systems including nondeterminism by Hansson in [34] and Segala and Lynch in [56]. Christoff and Christoff [14] adapt a restricted form of the modal mu-calculus. A new probabilistic semantics for the mu-calculus has been developed by Narasimha et al. [49]. Aziz et al. [3] introduces pCTL* a probabilistic extension of CTL*. Here the model checking algorithm is based on early results due to Courcoubetis and Yannakakis [19]. The logic was later extended to systems with nondeterminism by Bianco and de Alfaro [9, 24]. Symbolic model-checking algorithms of these logics was presented by Baier et al. in [7]. For more detailed information on the interesting topic of model checking probabilistic systems, we refer the reader to the excellent works by Alfaro [23] and Baier [5].
8. Conclusion and trends In this chapter, we have dealt with a number of classical process algebraic issues in a rather general setting allowing both discrete probabilistic choice as well as nondeterminism. In particular, we have
Probabilistic extensions of process algebras
707
- shown how nonprobabihstic process algebraic operators, in a uniform manner, may be extended to this probabilistic setting; - offered a range of probabilistic extensions of well-known behavioural preorders such as simulation, bisimulation and testing; - established congruence properties for these preorders; - provided alternative characterizations of the probabilistic preorders, either in terms of "trace"- or "tree''-based denotational models, or in terms of probabilistic modal logics. Current research considers further extensions of the process algebraic framework to settings with continuous-time [39,38]. One goal is to combine the contributions of process algebra, viz. compositionality and the use of logics to specify and analyze properties, with the work on efficient algorithms for analyzing performance of stochastic processes [6,21]. Also, the basic notions of probabilistic bisimulation and probabilistic modal logics have been recast and analysed in settings with continuous-space probability distributions [10, 28,22,30,31]. From this work it may be inferred that the negation-free version of the logic in Section 7 suffices in order to characterize probabilistic bisimulation. In this chapter we have not considered the difficult problem of extending probabilistic bisimulation to allow for abstraction from internal computation (resulting in probabilistic versions of weak bisimulation). For the most promising suggestions in this direction we refer the reader to [8].
References [1] S. Abramsky, Observation equivalence as a testing equivalence, Theoret. Comput. Sci. 53 (2,3) (1987), 225-241. [2] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [3] A. Aziz, V. Singhal, F. Balarin, R.K. Brayton and A.L. Sangiovanni-Vincentelli, It usually works: The temporal logic of stochastic systems, Proc. CAV'95, Lecture Notes in Comput. Sci. 939, Springer-Verlag (1995). [4] C. Baier, Polynomial time algorithms for testing probabilistic bisimulation and simulation, Proc. 8th Internat. Conference on Computer Aided Verification, New Brunswick, USA, 1996, Lecture Notes in Comput. Sci. 1102, R. Alur and T. Henzinger, eds. Springer-Veriag (1996), 38-49. [5] C. Baier, On algorithmic verification methods for probabilistic systems, Habilitation, Thesis, University of Mannheim (1999). [6] C. Baier, J.-P. Katoen and H. Hermanns, Approximate symbolic model checking of continuous-time Markov chains, Proc. CONCUR'99, 9th Intemat. Conference on Concurrency Theory, Lecture Notes in Comput. Sci. 1664, Springer-Verlag (1999), 146-162. [7] C. Baier, M. Kwiatkowska, M. Ryan, E. Clarke and V. Hartonas Garmhausen, Symbolic model checking for probabilistic processes, Proc. ICALP'97, Lecture Notes in Comput. Sci. 1256, Springer-Veriag (1997). [8] C. Baier and H. Hermanns, Weak bisimulation for fully probabilistic processes. Lecture Notes in Comput. Sci. 1254, Springer-Veriag (1997). [9] A. Bianco and L. De Alfaro, Model checking of probabilistic and nondeterministic systems, Proc. FSTTCS, Lecture Notes of Comput. Sci. 1026, Springer-Veriag (1995). [10] R. Blute, J. Deshamais, A. Edalat and P. Panangaden, Bisimulation for labelled Markov processes, Proc. 12th IEEE Symposium on Logic in Computer Science (1997). [11] J.C. Bradfield and C. Stirling, Modal logics and mu-calculi: An introduction. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 293-330. [12] L Christoff, Testing equivalences and fully abstract models for probabilistic processes, Proc. CONCUR, Amsterdam, Lecture Notes in Comput. Sci. 458, Baeten, ed.. Springer-Veriag (1990), 126-140.
708
B. Jonsson et al.
[13] L. Christoff and I. Christoff, Efficient algorithms for verification of equivalences for probabilistic processes, Proc. Workshop on Computer Aided Verification, Lecture Notes in Comput. Sci. 575, Larsen and Skou, eds. Springer-Verlag (1991). [14] L. Christoff and I. Christoff, Reasoning about safety and liveness properties for probabilistic properties. Foundations of Software Technology and Theoretical Computer Science, Lecture Notes in Comput. Sci. 652, R.K. Shyamasundar, ed.. Springer-Veriag (1992), 342-355. [15] E.M. Clarke, E.A. Emerson and A.P. Sistla, Automatic verification of finite-state concurrent systems using temporal logics specification: A practical approach, Proc. 10th ACM Symp. on Principles of Programming Languages (1983), 117-126. [16] E.M. Clarke and E.A. Emerson, Design and synthesis of synchronization skeletons using branching time temporal logic, Proc. IBM Workshop on Logics of Programs, Lecture Notes in Comput. Sci. 131, D. Kozen, ed. (1982). Also as Aiken Computation Lab TR-12-81, Harvard University (1981). [17] R. Cleaveland, S. Smolka and A. Zwarico, Testing preorders for probabilistic processes, Proc. ICALP'92 (1992). [18] R. Cleaveland and O. Sokolsky, Equivalence and preorder checking for finite-state systems. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 391^24. [19] C. Courcoubetis and M. Yannakakis, The complexity of probabilistic verification, Proc. 29th Annual Symposium Foundations of Computer Science (1988), 338-345. [20] P.R. D'Argenio, H. Hermanns and J.-P. Katoen, On generative parallel composition, Proc. Workshop on ProbabiUstic Methods in Verification (1998). [21] P.R. D'Argenio, J.-P. Katoen and E. Brinksma, General purpose discrete-event simulation using SPADES, Proc. 6th Intemat. Workshop on Process Algebra and Performance Modelling (1998). [22] P.R. D'Argenio, J. Katoen and E. Brinksma, An algebraic approach to the specification of stochastic systems, PROCOMET'98, Chapmann and Hall (1998). [23] L. de Alfaro, Formal verification of probabilistic systems, Ph.D. Thesis, Dept. of Computer Sciences, Stanford University (1997). [24] L. de Alfaro, Temporal logics for the specification of performance and reliability, Proc. STACS'97, Lecture Notes in Comput. Sci. 1200 (1997). [25] R. de Nicola and M. Hennessy, Testing equivalences for processes, Theoret. Comput. Sci. 34 (1984), 8 3 133. [26] R. de Simone, Higher-level synchronising devices in MEIJE-SCCS, Theoret. Comput. Sci. 37 (3) (1985), 245-267. [27] C. Derman, Finite State Markovian Decision Processes, Academic Press (1970). [28] J. Deshamais, A. Edalat and P. Panangaden, A logical characterization of bisimulation for labeled Markov processes, Proc. 13th IEEE Symposium on Logic in Computer Science (1998). [29] J. Deshamais, A. Edalat and P. Panangaden, Bisimulation for labelled Markov processes, Proc. 12th IEEE Symposium on Logic in Computer Science (1997). To appear in: Inform, and Comput. (2000). [30] J. Deshamais, A. Edalat and P. Panangaden, A logical characterization of bisimulation for labeled Markov processes, Proc. 13th IEEE Symposium on Logic in Computer Science (1998). [31] J. Deshamais, V Gupta, R. Jagadeesan and P. Panangaden, Metrics for labeled Markov systems. Lecture Notes in Comput. Sci. 1664 (1999). [32] A. Giacalone, C. Jou and S.A. Smolka, Algebraic reasoning for probabilistic concurrent systems, Proc. IFIP TC2 Working Conference on Programming Concepts and Methods, Sea of Galilee (1990). [33] R. van Glabbeek, S.A. Smolka, B. Steffen and C. Tofts, Reactive, generative, and stratified models of probabilistic processes, Proc. 5th IEEE Intemat. Symposium on Logic in Computer Science (1990), 130-141. [34] H. Hansson, Time and probabilities informal design of distributed systems, Real-Time Safety Critical Systems, Elsevier (1994). [35] H. Hansson and B. Jonsson, A calculus for communicating systems with time and probabilities, Proc. 11th IEEE Real-Time Systems Symposium, Oriando, FL (1990). [36] H. Hansson and B. Jonsson, A logic for reasoning about time and reliability. Formal Aspects of Computing 6(1994), 512-535. [37] M. Hennessy and R. Milner, Algebraic laws for nondeterminism and concurrency, J. ACM 32 (1) (1985), 137-161. [38] H. Hermanns, Interactive Markov chains, Ph.D. Thesis, University of Erlangen-Niimberg (1998).
Probabilistic extensions of process algebras
709
[39] J. Hillston, A compositional approach to performance modelling, Ph.D. Thesis, University of Edinburgh (1994). Published in Cambridge University Press (1996). [40] B. Jonsson, Simulations between specifications of distributed systems, Proc. CONCUR'91, Theories of Concurrency: Unification and Extension, Amsterdam, Holland, Lecture Notes in Comput. Sci. 527, SpringerVerlag(1991). [41] B. Jonsson and K.G. Larsen, Specification and refinement of probabilistic processes, Proc. 6th IEEE Internat. Symposium on Logic in Computer Science, Amsterdam, Holland (1991). [42] B. Jonsson and W. Yi, Compositional testing preorders for probabilistic processes, Proc. 10th IEEE Intemat. Symposium on Logic in Computer Science (1995), 431^141. [43] B. Jonsson and W. Yi, Testing preorders for probabilistic processes can be characterized by simulations. Technical report, DoCS, Uppsala University (2000). Submitted. [44] K.G. Larsen and A. Skou, Bisimulation through probabilistic testing, Proc. 16th ACM Symposium on Principles of Programming Languages (1989). [45] K.G. Larsen and A. Skou, Bisimulation through probabilistic testing. Inform, and Control 94 (1) (1991), 1-28. [46] K.G. Larsen and A. Skou, Compositional verification of probabilistic processes, Proc. CONCUR'92, Theories of Concurrency: Unification and Extension, Lecmre Notes in Comput. Sci. 630, Cleaveland, ed.. Springer-Verlag (1992). [47] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [48] M.K. Molloy, Performance analysis using stochastic Petri nets, IEEE Trans. Comput. C-31 (9) (1982), 913-917. [49] M. Narasimha, R. Cleaveland and P. Iyer, Probabilistic temporal logics via the modal mu-calculus. Foundations of Software Science and Computation Structures, Lecture Notes in Comput. Sci. 1578, W. Thomas, ed., Springer-Veriag (1999). [50] G. Plotkin, A structural approach to operational semantics. Technical Report DAIMI FN-19, Computer Science Department, Aarhus University, Denmark (1981). [51] A. Pnueh and L. Zuck, Verification of multiprocess probabilistic protocols, Distrib. Comput. 1(1) (1986), 53-72. [52] S. Purushothaman and P. A. Subrahmanyam, Reasoning about probabilistic behavior in concurrent systems, IEEE Trans. Software Engineering SE-13 (6) (1989), 740-745. [53] S.A. Smolka, R. Cleaveland, Z. Dayar and S. Yuen, Testing preorders for probabilistic processes. Inform, and Comput. 2 (152) (1999), 93-148. [54] M.O. Rabin, Probabilistic automata. Inform, and Control 6 (1963), 230-245. [55] R. Segala, A compositional trace-based semantics for probabilistic automata, Proc. CONCUR'95, 6th Intemat. Conference on Concurrency Theory, Lecture Notes in Comput. Sci. 962, Springer-Verlag (1995), 234-248. [56] R. Segala and N.A. Lynch, Probabilistic simulations for probabilistic processes, Nordic J. Comput. 2 (2) (1995), 250-273. [57] W.-G. Tzeng, A polynomial-time algorithm for the equivalence ofprobabilistic automata, SIAM J. Comput. 21 (2) (1992), 216-227. [58] M.Y. Vardi, Automatic verification of probabilistic concurrent finite-state programs, Proc. 26th Annual Symposium Foundations of Computer Science (1985), 327-338. [59] S.-H. Wu, S.A. Smolka and E.W. Stark, Composition and behaviors of probabilistic I/O-automata, Theoret. Comput. Sci. 176 (1-2) (1997), 1-37. [60] W. Yi and K.G. Larsen, Testing probabilistic and nondeterministic processes. Protocol Specification, Testing, and Verification XII (1992).
710
B. Jonsson et al.
Subject index a-step, 703 accepting states, 700 ACP, 687 bisimulation, 695 Cartesian product, 690 CCS, 687 characterization theorem, 704 combined transition, 696, 697 congruence properties, 698 continuous-space, 707 CSP, 687 CTL, 706 CTL*,706 deterministic, 691 D/5r(5),688 finite process, 691 generative model, 691 Hennessy-Milner logic, 704 image-finite, 705 inference rules for PCCS, 695 initial distribution, 690 initially active, 693 internal probabilistic choice, 693 hfting, 688 lifting operation, 689 hnear term, 692 Markov chain, 687 Markov process, 687 maximal probability of success, 701 may testing, 701 minimal probabihty of success, 701 model checking, 706 must testing, 701 n-ary operator, 692 negation-free properties, 705 NIL, 693 nondeterminism, 687 nondeterministic choice operator, 693 nondeterministic formulas, 705
normal step, 703 n %* p, 688 PCCS, 694 PCTL, 706 pCTL*,706 PML, 705 post on steps, 703 precongruences, 702 prefixing operator, 693 probabilistic bisimulation, 695, 697 probabilistic execution, 691 probabilistic formulas, 705 probabilistic I/O automata, 692 probabilistic logics, 704 probabilistic modal logic, 705 probabilistic simulation, 698 probabilistic step-simulation, 703 probabilistic transition system (PTS), 690 probability distribution, 688 process algebras, 687 process context, 698 process expressions, 693 product, 688 reachable, 691 reactive model, 691 recursive definitions, 694 5-^,691 5-^,691 5-%7r,691 Sate is), 105 Sat (s), 105 s e e s , 694 Simone format, 692 simulation, 697 state, 691 step, 702, 703 success-states, 700 symbohc model-checking, 706 synchronous parallel composition, 694 terminal, 691 test, 700 testing preorders, 699 testing system, 700 weighting, 688
CHAPTER 12
Priority in Process Algebra Ranee Cleaveland^ Gerald Luttgen^, V. Natarajan^ ^ Department of Computer Science, State University of New York at Stony Brook, Stony Brook, NY 11794, USA E-mail: [email protected] ^ Institute for Computer Applications in Science and Engineering (ICASE), NASA Langley Research Center, Hampton, VA 23681, USA E-mail: [email protected] Networking Hardware Division, IBM Corporation, Research Triangle Park, NC 27709, USA E-mail: nataraj@raleigh. ibm. com
Contents 1. Introduction 1.1. Classification of approaches to priority 1.2. Summary of this chapter 1.3. Organization of this chapter 2. Basic language and notation 3. Static priority and global pre-emption 3.1. Operational semantics 3.2. Semantic theory based on strong bisimulation 3.3. Semantic theory based on weak bisimulation 3.4. Example 3.5. Prioritization and deprioritization operators 3.6. Extension to multi-level priority schemes 3.7. Concluding remarks and related work 4. Static priority and local pre-emption 4.1. Locations 4.2. Operational semantics 4.3. Semantic theory based on strong bisimulation 4.4. Semantic theory based on weak bisimulation 4.5. Example 4.6. Discussion of alternative design decisions 4.7. Extension to multi-level priority schemes 4.8. Camilleri and Winskel's approach 4.9. Relating the different approaches 4.10. Concluding remarks and related work 5. Dynamic priority and global pre-emption HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved 711
713 713 715 715 716 717 718 718 720 724 725 728 730 730 732 733 734 737 740 740 741 744 746 747 748
712
R. Cleaveland et al.
5.1. Real-time semantics 5.2. Dynamic priority semantics 5.3. Relating dynamic priority and real-time semantics 5.4. Concluding remarks and related work 6. Priority in other process-algebraic frameworks 7. Conclusions and directions for future work 8. Sources and acknowledgments 9. Glossary References Subject index
749 751 752 753 754 756 758 758 762 765
Abstract This chapter surveys the semantic ramifications of extending traditional process algebras with notions of priority that allow some transitions to be given precedence over others. The need for these enriched formalisms arises when one wishes to model system features such as interrupts, prioritized choice, or real-time behavior. Approaches to priority in process algebras can be classified according to whether the induced notion of pre-emption on transitions is global or local and whether priorities are static or dynamic. Early work in the area concentrated on global pre-emption and static priorities and led to formalisms for modeling interrupts and aspects of real-time, such as maximal progress, in centralized computing environments. More recent research has investigated localized notions of pre-emption in which the distribution of systems is taken into account, as well as dynamic priority approaches. The latter allows priority values to change as systems evolve and enables an efficient encoding of real-time semantics. Technically, this chapter studies the different models of priorities by presenting extensions of Milner's Calculus of Communicating Systems (CCS) with static and dynamic priority as well as with notions of global and local pre-emption. For each extension, the operational semantics of CCS is modified appropriately, behavioral theories based on strong and weak bisimulation are given, and related approaches for other process-algebraic settings are discussed.
Priority in process algebra
113
1. Introduction Traditional process algebras [7,41,44,58] provide a framework for reasoning about the communication potential of concurrent and distributed systems. Such theories typically consist of a simple calculus with a well-defined operational semantics [ 1,69] given as labeled transition systems', a behavioral equivalence is then used to relate implementations and specifications, which are both formalized as terms in the calculus. In order to facilitate compositional reasoning, in which systems are verified component by component, researchers have concentrated on developing behavioral congruences, which allow the substitution of "equals for equals" inside larger systems. Over the past decade, process-algebraic approaches to system modeling and verification have been applied to a number of case studies (see, e.g., [3]). Nevertheless, many systems in practice cannot be modeled accurately within this framework. One reason is that traditional process algebras focus exclusively on expressing the potential nondeterminism that the interplay of concurrent processes may exhibit; they do not permit the encoding of differing levels of urgency among the transitions that might be enabled from a given system state. In practice, however, some system transitions are intended to take precedence of others; examples include: • interrupts, where non-urgent transitions at a state are pre-empted whenever an interrupt is raised; • programming language constructs, such as the PRIALT construct in occam [45], that impose a priority order on transition choices; • real-time behavior that is founded on the well-known synchrony hypothesis [13] or maximal progress assumption [79]; and • scheduling algorithms which also rely on the concept of pre-emption. In each of these cases urgency provides a means for restricting nondeterminism. This mechanism is simply ignored in traditional process algebras. Hence, the resulting system models are often not faithful since they contain spurious paths that cannot be traversed by the real-world systems themselves [16,29]. As an illustration of the need for integrating notions of urgency into process algebra consider the interrupt-based system depicted in Figure I. The system consists of two processes: A, which flips back and forth between two states, and S, which prompts A to report its status. Whenever B receives a check message from the environment it instructs A of this via interrupt port /; A in turn issues its response on its ok channel. In the absence of an indication that a communication on / is more urgent than one on back and forth, process A is not required to respond immediately to a request from B. Indeed, the system's behavior is not QWQw fair [34,40] since A may ignore such requests indefinitely. It should be noted that fairness is a weaker notion than priority [8], as it only requires eventual rather than immediate responses. 1.1. Classification of approaches to priority A number of approaches have been proposed for introducing priority to process algebras [5, 12,16,22-24,26,28,29,33,36,38,47,48,54,55,64,65,71,73,74]. One may classify these approaches according to the following two criteria.
714
R. Cleaveland et al.
forth
^ ok
f
>,
A
•\
check
B
I V
J
back
Fig. 1. Back-and-forth example.
Static priority versus dynamic priority: In static approaches transition priorities may be inferred from the syntax of the system description before the system commences execution; they do not change during computation. These schemes find appHcation in the modeling of interrupts or prioritized choice constructs. In the former case, interrupts have a fixed urgency level associated with them; in the latter priorities of transitions are fixed by the static program syntax. Almost all priority approaches to process algebra published so far deal with static priorities. The exceptions are [16,22], which present models that allow priority values of transitions to change as systems evolve. Such dynamic behavior is useful in modeling scheduling algorithms and real-time semantics. Global pre-emption versus local pre-emption: This criterion refers to the scope of priority values. In the case of centralized systems, priorities generally have a global scope in the sense that transitions in one process may pre-empt transitions in another. We refer to this kind of pre-emption, which has been advocated by Baeten, Bergstra, and Klop [5] and by Cleaveland and Hennessy [26] in the late Eighties, as global pre-emption. In contrast, in a distributed system containing multiple sites, transitions should only be allowed to pre-empt those at the same site or location. This kind of pre-emption, which was first studied by Camilleri and Winskel [24] in the early Nineties, is called local pre-emption. Based on the above classification scheme, the body of this chapter investigates the following different semantics for a prototypical process-algebraic language: static/global, static/local, and dynamic/global. Only the combination of dynamic priority and local preemption is omitted, since research has not yet been carried out on this topic. Some caveats about terminology are in order here. Other process algebra researchers have used the term "pre-emption" in a setting without priorities [17]; in their usage preemption occurs when the execution of one transition removes the possibility of others. In our priority-oriented framework, we say that pre-emption occurs when the availability of one transition disables others. Berry [ 12] refers to this latter notion as must pre-emption and to the former as may pre-emption. In this chapter, whenever we speak of "pre-emption", we mean "must pre-emption". It should also be noted that our concept of global pre-emption
Priority in process algebra
715
and dynamic priority differs from the notion of globally dynamic priority found in [73]; as the distinction is somewhat technical we defer further discussion on this point to later in the chapter.
1.2. Summary of this chapter This chapter surveys published work on priority in process algebras. To illustrate the semantic issues involved, we introduce a single process calculus that we then equip with different notions of pre-emption. This calculus extends Milner's Calculus of Communicating Systems (CCS) [58] by attaching priority values to actions. For this language three different semantics are given: one reflecting static priorities and global pre-emption, one for static priorities and local pre-emption, and one capturing dynamic priorities. The common language allows for a detailed comparison of the semantic concepts; in addition, the classification scheme presented above helps categorize most existing approaches to priority. These have been proposed for a variety of well-known process algebras, such as the already mentioned CCS, the Algebra of Communicating Processes (ACP) [9], Communicating Sequential Processes (CSP) [44], the Calculus of Broadcasting Systems (CBS) [70], Synchronous CCS (SCCS) [58], and Asynchronous Communicating Shared Resources (ACSR) [23]. For the static-priority settings in this chapter we develop semantic theories based on the notion of bisimulation [58,67]. Our aim is to carry over the standard algebraic results from CCS [58], including full-abstractness theorems as well as axiomatic, logical, and algorithmic characterizations. In particular, we investigate both strong and weak bisimulations that are based on naive adaptations of the standard definitions as given by Milner; we focus on characterizing the largest congruences contained in these relations. Such fullabstractness results indicate that the behavioral relations are compositional and thus useful for formally reasoning about concurrent and distributed systems. Then we present sound and complete axiomatizations for the obtained strong bisimulations with respect to finite processes, i.e., those which do not contain recursion. These axiomatizations testify to the mathematical tractability of the semantic theories presented here. We also characterize the attendant notions of prioritized strong and weak bisimulations as standard bisimulations via enriched transition labels, so that well-known partition-refinement algorithms [30,50, 66] for their computation become applicable. Such accounts also provide support for logical characterizations of the behavioral relations, as they give direct insights into how the Hennessy-Milner logic [19,58] should be adapted. In case of the dynamic priority semantics, we prove a one-to-one correspondence with traditional real-time semantics [10,61,79] in terms of strong bisimulation. Because of this close relationship, semantic theories developed for real-time process algebras can be carried over to the dynamic priority setting.
1.3. Organization of this chapter The remainder of this chapter is organized as follows. The next section introduces our extension of CCS, defines some formal notation used throughout the chapter, and discusses
716
R. Cleaveland et al.
basic design decisions we have taken. Section 3 presents a semantics of the language based on static priority and global pre-emption; Section 4 then develops a semantics based on static priority and local pre-emption. A dynamic priority approach is illustrated in Section 5. Related work is referred to in each of the last three sections, while Section 6 surveys several priority approaches adopted for process-algebraic frameworks other than CCS. Section 7 contains our conclusions and suggestions for future work. The final section points to the sources of the research compiled in this chapter. A glossary of notation and symbols used may be found at the end.
2. Basic language and notation As mentioned above, the language considered here is an extension of Milner's CCS [58], a process algebra characterized by handshake communication and interleaving semantics for parallel composition. Syntactically, CCS includes notations for visible actions, which are either sends or receives on ports, and a distinguished invisible, or internal action. The semantics of CCS is then given via a transition relation that labels execution steps with actions. When a sender and receiver synchronize, the resulting action is internal. Consequently, transitions labeled by visible actions can be seen as representing only "potential" computation steps, since in order for them to occur they require a contribution from the environment. Transitions labeled by internal actions describe complete synchronizations and, therefore, should be viewed as "actual" computation steps. In order to capture priorities, the syntax of our language differs from CCS in that the port set exhibits a priority scheme, i.e., priorities are attached to ports. Our notion of preemption then stipulates that a system cannot engage in transitions labeled by actions with a given priority if it is able to perform a transition labeled by an internal action of higher priority. In this case we say that the lower-priority transition is pre-empted by the higherpriority internal transition. In accordance with the above discussion visible actions never have pre-emptive power over actions of lower priority, because visible actions only indicate the potential for execution. An algebraic justification of this design decision can be found in Section 3.5. Priority values are taken from some finite domain equipped with a total order. For the sake of simplicity we use finite initial intervals M of the natural numbers N in what follows. We adopt the convention that smaller numbers mean higher priorities; so 0 is the highest priority value. Let {Ak I keJ\f} denote an jV-indexed family of countably infinite, pairwise disjoint sets of ports. Intuitively, Ak contains the ports with priority k over which processes may synchronize. Then the set of actions Ak with priority k may be defined by Ak =df AkU^k^ {r^}, where 'Ak =df {^k I ^k ^ Ak} and Zk i Ak. An action \k ^ Ak may be thought of as representing the receipt of an input on port \ that has priority k, while Xk ^ Ak constitutes the deposit of an output on A. The invisible action Xk represent internal computation steps with priority k. For better readability we write A:/:, if Xk ^ Ak^'k'.k, if \k € Ak, and r:/: for r^. The sets of all ports A, all complementary ports A, and all actions A are defined by \^{Ak \ k eAf], \J{Ak \ k eU}, and [J{Ak I keAf], respectively. In what follows, we use a:k,P:k,... to range over A and a:k,b:k,... to range
Priority in process algebra
117
over AVJ A. We also extend complementation to all visible actions a:khy'd\k =df ^'-k. Finally, if L c yl u 71 then L = {a:k\a:k e L]. The syntax of our language is defined by the following BNF. P \\= ^ \ X \ a:k,P
\ P -\- P \ P \ P \ P[f] \ P\L
\ fix.P
Here, / is a finite relabeling, i.e., a mapping on A with / ( r :k) = r :k, for all k e Af, f{a: k) = f(a : k),foY2i\\a:k e AU A, and \{a : k \ f {a : k) ^ a : k} \< oo. A relabeling is also required to preserve priority values, i.e., for M a : k e A U A, "we have f{a:k) = b:k, for some b:k e AkUAk. The restriction set Lisa subset of 71U 71, and x is a variable taken def
from a set V. Sometimes it is convenient to write C = P for /iCP, where identifier C is interpreted as a variable. We adopt the standard definitions for sort of a process,/r^^ and bound variables, open and closed terms, guarded recursion, and contexts [58]. We refer to closed and guarded terms as processes and use P, Q, R,... to range over the set P of processes. Finally, we denote syntactic equality by =. Although our framework allows for multi-level priority schemes we generally restrict ourselves to a two-level priority framework, i.e., we choose A/" = {0, 1}. The reason is that even in this simple setting most semantic and technical issues regarding the introduction of priority to process algebra can be illustrated. However, we also discuss how the obtained results can be carried over to multi-level priority schemes. In order to improve readability within the two-level priority scheme we often write a for the prioritized action a:0,a for the unprioritized action a : 1, A for Ao, and A for A\. We let 8 and y represent elements taken from A U A. We emphasize that q_ and a are considered to be different ports; i.e., the priority value is part of a port name. Thus, in a CCS-based framework only complementary actions having the same priority value can engage in a communication. We discuss the consequences of Hfting this restriction in Section 3.7 for frameworks involving global preemption and in Section 4.6 for those involving local pre-emption. It should be noted that the dynamic priority approach presented in Section 5 also differs in its interpretation of ports, actions, and priority values. Finally, our language does not provide any operator for changing priority values of actions. However, we will discuss in Section 3.5 the effect of introducing such operators, called prioritization and deprioritization, which increase and decrease the priority values of actions, respectively. 3. Static priority and global pre-emption In this section we introduce a semantics of our language that features static priorities, global pre-emption and a two-level priority scheme on actions. We refer to our language with this semantics as CCS^^ (CCS with static priority and global pre-emption) and develop its semantic theory along the lines mentioned in Section 1.2. The organization of this section is as follows. Section 3.1 formally introduces the operational semantics for CCS^^, Sections 3.2 and 3.3 show how to adapt the notions of strong bisimulation and observational congruence to CCS^^, respectively. Section 3.4 applies the semantic theory to the introductory back-and-forth example illustrated in Figure 1. The consequences of adding prioritization and deprioritization operators to CCS^^
718
R. Cleaveland et al
are discussed in Section 3.5. Finally, Section 3.6 comments on the extension of CCS^^ to multi-level priority schemes, and Section 3.7 discusses the design decisions in our theory and presents related work.
3.1. Operational semantics The semantics of a process P eV is given by a labeled transition system (P, A,-^,P), where V is the set of states, A is the alphabet, -^ C.V x A x V is the transition relation, and P is the start state. We write P -^ P' instead of (P, y, f') € - > and say that P may engage in action y and thereafter behave like process P'. Moreover, we let P -^ stand for 3P' eP. P -^ P'. The presentation of the operational rules rtqwixts prioritized initial action sets X_{P) which are defined as the least sets satisfying the equations in Table 1. Intuitively, J ( P ) denotes the set of all prioritized actions in which P can initially engage. For convenience, we also write ^ ( P ) for the set T_{P) \ (l) of prioritized external actions. The rules in Plotkin-style notation [69] in Table 2 formally define the transition relation and capture the following operational intuitions. Process y.P may engage in action y and then behave like P. The summation operator -f denotes nondeterministic choice. Process P + Q may behave like process P {Q) if Q {P) does not pre-empt an unprioritized transition by performing a prioritized internal transition. P [ / ] behaves exactly as process P with the actions renamed with respect to relabeling f. Process P \ Q represents the parallel composition of P and Q, which are executed according to an interleaving semantics with synchronized communication on complementary actions on the same priority level that results in the internal action r or r. However, if Q (P) is capable of engaging in a prioritized internal transition, then unprioritized transitions of P (Q) are pre-empted. The restriction operator \L prohibits in P \ L the execution of transitions labeled by actions in L U L and, thus, permits the scoping of actions. Finally, fxx.P denotes a recursively defined process that is a distinguished solution to the equation x = P.
3.2. Semantic theory based on strong bisimulation The semantic theory for CCS^^ is based on the notion of bisimulation [58,67]. First, strong bisimulation [58] is adapted from CCS to our setting as follows; we refer to this relation as prioritized strong bisimulation. Table 1 Prioritized initial action sets for CCS^^ X{q_.P) = [a]
liiix.P)
=
IiP[fix.P/x])
UP + Q) = Z{P)^ZiQ)
UP I Q)=UP)^UQ)u(i|X(P)n
UP[f]) = {/(«) I a e !(/>)}
I{P\L)=I{P)\(LU
L)
J ( 0 #0}
Priority in process
719
algebra
Table 2 Operational semantics for CCS^9 Act
a.P-^
Sum1
P
P-^P' P + Q-^
Sum2
a.P
Sum1 P'
Q^a P^P'
Com1
Q^Q'
Com2
Q^Q'
Com3
P\Q-^P'\Q' P^P'
Rel
Pin - ^ p'u\ p-^p'
Res
P\L-^
Rec
q_^L\J
L
Res
P'\L
P[fix.P/x]-^ fix.P^^
•LiUP\Q)
Lil(P\Q)
P\Q-^P\Q'
P^P'
Rel
P-^P' P\Q^^P'\Q
Com2
P\Q-^P\Q'
Com3
LiZiP)
P^Q-^Q''
P\Q-^P'\Q
LiZiQ)
P'
Sum2
P^Q-^Q' Com1
P-^P' P + Q-^
P'
Rec
L^I(P\Q)
p\QJL^p'\Q' P^P' P[f]^^P'{f] P^P' P\L-^ P[fMX.P/x]-^
-a^LUL
P'\L P'
flX.P-^P'
P'
3.1 {Prioritized strong bisimulation). A symmetric relation 1Z^V xV is called 2i prioritized strong bisimulation if for every (P, Q) e1Z and y € ^ the following condition holds. DEHNITION
P -^
P'
implies
3Q', Q-^
Q' and {P\ Q') e 11.
We write P c:^ Q if {P, Q) elZior some prioritized strong bisimulation 71. It is easy to see that ~ is an equivalence and that it is the largest prioritized strong bisimulation. The following result, which enables compositional reasoning, can be proved using standard techniques [1,26,77]. THEOREM 3.2. :^ /^ tz congruence.
720
R. Cleaveland et al Table 3 Axiomatization of ~ (A1) (A3)
t-^u = u-^t /+/= /
(E)
Let t = X^y Yi -fi and u = J2i ^j "y • Then
(Res1) (Res2) (Res3) (Res4)
0\ L= 0 (y.t) \ L = 0 (y € LUL) (K.r) \ L = K.(r \ L) (y^LUL) (r + M)\L = ( / \ L ) + (M\L)
(A2) (A4)
r + (M + r) = (r + M) + u r+0 = r
(Rel1) (Rel2) (RelS) (P)
0[/] = 0 (K.r)[/] = /(>/).(/[/]) (/ + w)[/] = t[f] + M[/] r.r+a.M = r./
An axiomatization of :^ for finite processes, i.e., guarded and closed CCS^^ terms not containing recursion, can be developed closely along the lines of [26]. We write h r = M if process term t can be rewritten to u using the axioms in Table 3. These axioms correspond to the ones presented in [58], except that Axiom (P) dealing with global pre-emption is added. In the Expansion Axiom (E) the symbol J2 stands for the indexed version of +, where the empty sum denotes the inaction process 0. The next theorem states that our equations characterize prioritized strong bisimulation for finite CCS^^ processes. Its proof can be found in [26]; it uses techniques described in [58]. THEOREM
3.3. Let t, u befiniteprocesses. Then t c^u if and only ifh t = u.
3.3. Semantic theory based on weak bisimulation The behavioral congruence developed in the previous section is too strong for verifying systems in practice, as it requires that two equivalent terms match each other's transitions exactly, even those labeled by internal actions. The process-algebraic remedy for this problem involves the development of a semantic congruence that abstracts from internal transitions. In pursuit of such a relation we start off with the definition of a naive prioritized weak bisimulation, which is an adaptation of Milner's observational equivalence [58]. 3.4 (Naiveprioritized weak transitions). (1) T_=df f =df ^, a =df«, anda =df^-
DEFINITION
(2) ^ x = d f ( ^ U-^)*. (3) = ^ x = d f = ^ x O >o=»x.
Observe that this transition relation ignores priority levels for = ^ x . This is in accordance with the fact that a priority value is part of an action name and, thus, unobservable for internal actions.
Priority in process algebra
721
DEHNITION 3.5 (Naive prioritized weak bisimulation). A symmetric relation 1Z^V xP is a naive prioritized weak bisimulation if for every {P, Q) e7Z and y eAihc following condition holds.
P^
P'
implies
SQ'. Q ^ x Q' and {P\ Q') e 7^.
We write P ^ x Q if (P, Q) € 7^ for a naive prioritized weak bisimulation 71. Naive prioritized weak bisimulation can be shown to be an equivalence. Unfortunately, ^ x is not a congruence for CCS^^ with respect to parallel composition and summation. Whereas the compositionality defect for summation is similar to the one for observational equivalence in CCS [58], the problem with parallel composition is due to pre-emption. As def
def
an example consider the processes P = «.0+^.0 and Q = fl.O-|-r.(^.0-(-^.0). It is easy to see that P ^x Q- However, when composing these processes in parallel with process ^.0, 2 I EO - ^ 0 I £ 0 whereas P I'b.O =S=^x. i.e., P I'b.O ^^ Q\ ^ 0 . In order to obtain a congruence, more care must be taken when defining the prioritized weak transition relation. Transitions labeled by visible actions may turn into internal transitions when composed with an environment and, thus, may gain pre-emptive power. An adequate notion of weak transitions must take the processes' potential of engaging in visible prioritized transitions into account. 3.3.1. Prioritized weak bisimulation. Despite its lack of compositionality, the definition of ^ x reflects an intuitive approach to abstracting from internal computation, and consequently we wish to develop a congruence that is as "close" to ^ x as possible. That such a relation exists is due to the following fact from universal algebra. PROPOSITION 3.6. For an equivalence K in some algebra ^ the largest congruence It' ^ n exists and 7^+ = {{P, Q) \ \^\-contexts C{Xl {C[P]X[Q]) e 7^}. Here, a yi-context C[X] is a term in ^ with one free occurrence of variable X.
We therefore know that ^ x contains a largest congruence ^ J for CCS^^ and devote the rest of this section to giving an operational characterization of this congruence. We begin by defining a new weak transition relation that takes pre-emptability into account. DEFINITION 3.7 (Prioritized transitions). Let L c A \ {T}. (i) L =df ^, i =df £, g_ =df £, and a =df ^•
(ii) P -^
P' iiP -^
P' and U(P) c L.
(iii) ^ = d f ( - ^ ) * . (iv) = ^ = d f ( - ^ ^ - r ) * (V) = : > = d f = : ^ 0
(VI)
>0=^.
= ^ = a f = ^ o ^ o = ^ .
722
R. Cleaveland et al.
Intuitively, we have made the transition relation sensitive to pre-emption by introducing conditions involving prioritized initial action sets and by preserving priority levels of internal actions. In particular, P -j^ P' holds when P can evolve to P' by performing the unprioritized action a, provided the environment does not offer any prioritized communication involving an action in L, which contains the prioritized actions P may initially engage in. In the remainder, we show that such prioritized initial action sets are an adequate means for measuring pre-emption potentials. DEHNITION 3.8 {Prioritized weak bisimulation). A symmetric relation 1Z c.p xV is a prioritized weak bisimulation if for every {P, Q) elZ, a^e A, and a G A the following conditions hold.
(1) r ^ I(P) implies 3Q\ Q =^ Q\ MQ')
^ ^ where L = ^ ( P ) ,
T^J(eO,and{/>, (2'>e7^. (2) P -^
P' implies 3Q^ Q =i» Q\ and (P, Q') e 7^.
(3) P -^
P' implies 3 2 ' . Q ^
Q\ where L=U{P).
and {P\ Q') e U.
We write P ~ Q if (P, g) € 7^ for some prioritized weak bisimulation K. This new version of weak bisimulation is algebraically more robust than the naive one, as the next result indicates. It should be noted that Condition (1) of Definition 3.8 is necessary for achieving compositionality with respect to parallel composition [55]. PROPOSITION 3.9. The equivalence ~ is a congruence with respect to prefixing, parallel composition, relabeling, and restriction. Moreover, ~ is the largest congruence contained in ^ x vv/r/z respect to the sub-algebra of OOS^^ induced by these operators and recursion.
Although ~ is itself not a congruence for CCS^^^ this relation provides the basis for obtaining a congruence, as is made precise in the next section. 3.3.2. Prioritized observational congruence. The compositionality defect of ~ with respect to sunmiation is handled by the following notion of prioritized observational congruence. Unfortunately, the summation fix presented in [58], which requires an initial internal transition to be matched by a nontrivial internal weak transition, is not sufficient in order def
to achieve a congruence based on prioritized weak bisimulation. To see why, let D = T_.E and E = r.D. Now define P = r.D and Q = T_.E. By Definition 3.8 we may observe P ~ Q, h\xi P -\-a.{S q^ Q -\- a.O since the former can perform an ^-transition whereas the latter cannot. It turns out that we must require that observationally congruent processes must possess the same prioritized initial action sets; a requirement which is stronger than Condition (1) of Definition 3.8. 3.10. Define P ~ ' Q if for all a and their symmetric counterparts hold.
DEFINITION
G
A and a
G
A the following conditions
Priority in process algebra
(1) I(P) 2 (2) P-^P' (3) P-^
I(Q), implies 3Q'. Q^Q'
and P' ^
723
Q\
P' implies 3Q'. Q = » g', where L=^(P),
and P ' ^ Q\
The following theorem states the desired algebraic result for ~'. THEOREM
3.11. ^^ is the largest congruence contained in^^,
i.e., ^ ' = ^ J .
Whereas the proof of the congruence property of ^ ' is standard (cf. [58]), the "largest" part is proved by using the following fact from universal algebra. 3.12. Let K\ and Ki be equivalences in some arbitrary algebra ^^ such that W^ C 7e2 C 7^l. Then Tt^ = 11^. PROPOSITION
For the purposes of this section, we choose Tl\ =^^ and 7?.2 = ^- The following theorem, which establishes 7^ J = ~', can be proved along the lines of a corresponding theorem in [58]; for details see [55]. THEOREM
3.13. '^ is the largest congruence contained in ~.
In order to apply Proposition 3.12, the inclusions ^ ^ — — — ^ x ^^^^^ to be established. The inclusion ^ c ^ ^ immediately follows from the definition of the naive prioritized weak and the prioritized weak transition relations. One is left with ^ ^ c ^ . This inclusion turns out to be difficult to show directly. Instead, the auxiliary relation ^a=df {(^, Q) I CPQ[P] ^ X CPQ[Q\] satisfying the inclusions ^ ^ c ^^, c ^ is defined. Using the abbreviation 5 for the union of the finite prioritized sorts of P and Q, we define Cp^[X] =^X I ^/>^, where / d^JrHpQ + HPQ'^^C.O-^-
^
/>c|,
I.
Z)L +e.HpQ +
V
b.Hpo
beS
and DL is defined as Yla^L^-^- Actions c, J^ /^,^, for all L c 5 and ^ G S, and their complements, are assumed to be "fresh" actions, i.e., not in 5 U 5. By Proposition 3.6 we may conclude ^ J ^^a- The other necessary inclusion ~^; c ^ is proved by showing that ~« is a prioritized weak bisimulation. Summarizing, Theorem 3.11 is a consequence of Proposition 3.12 when assembling our results as illustrated in Figure 2, where an arrow from relation R\ to relation Ri indicates that R\ ^ Ri3.3.3. Operational characterization. The aim of this section is to show how prioritized weak bisimulation can be computed by adapting standard partition-refinement algorithms [30,50,66] developed for strong bisimulation [58]. To this end, we provide an operational characterization of prioritized weak bisimulation as strong bisimulation by introducing an alternative prioritized weak transition relation.
724
R. Cleaveland et al.
Fig. 2. Proof sketch of Theorem 3.11.
DEFINITION 3.14. Let P,P'
eV.ae
A, and a_e A.
(1) ==>* =df ^:>, and (2) P =A>* P' \i^P\T_il{P")
and P ^
P" ^
P\ for
L=mP')-
Observe that the alternative prioritized weak transition relation is not parameterized by prioritized initial action sets. It can be computed efficiently by using dynamic programming techniques. DEFINITION 3.15. A symmetric relation 7^ c 7^ x P is called an alternative prioritized weak bisimulation if for all (P, Q) G 7^ and y G ^ the following condition holds. P = ^ * P'
implies
3Q'. Q = ^ * Q' and {P', Q') e 7^.
We write P ~* 2 if (^. Q) ^ ^ for some alternative prioritized weak bisimulation 7Z. THEOREM
3.16 (Operational characterization). ~ = ~*.
The proof of this characterization result is straightforward [55]. It should be mentioned that the presented characterization may also serve as a basis for defining a HennessyMilner logic for prioritized weak bisimulation along the lines of [58].
3.4. Example As a simple example, we return to the back-and-forth system introduced in Section 1, def
def
which can be formalized in CCS^9 as follows: Sys = (yA | 8) \ {/} where A = back.A + /.T.ok././A, A' = forth.yA-f/.r.ok.i.yA', and B = check././.B. Intuitively, / is an internal interrupt, and thus prioritized and restricted (via \{/}), which is invoked whenever check is
Priority in process
725
algebra
back
check
Fig. 3. Semantics of Sys. Table 4 A relation whose symmetric closure is a prioritized weak bisimulation [ (Sys
, Spec
)
{(A'\B)\{i}
, Spec'
),
{{A\liB)\{iJ
, 5k.Spec )
{{rMk.l.A\iB)\{i}
, ok.Spec),
{(ok.l.A\i_.B)\{i}
, ok.Spec )
{il.A\i_.B)\{L}
, Spec
{{A'\li_.B)\{i}
, ok.Spec')
{(T.'^l.A'
, ok.Spec),
{(^LA'
, ok.Spec')
{([.A'\ LB) Mi)
\LB)\{i_}
\LB)\{i_}
, Spec'
),
)
executed. Hence, processes A and A cannot engage in a transition labeled by back and forth, respectively, according to our pre-emptive operational semantics, but must accept the communication on prioritized port /. One can think of the r-action in the definition of process A as representing some internal activities determining the current status of the system. The CCS^^ semantics of Sys is shown in Figure 3. In the sequel, we prove that Sys meets its specification Spec, which is given by Spec = back. Spec'+ check, ok. Spec, Spec' = forth.Spec-fcheck.ok.Spec'.
First, the validity of Sys ~ Spec is demonstrated by the relation presented in Table 4, whose symmetric closure is a prioritized weak bisimulation that contains (Sys, Spec). In addition, both processes only possess visible initial actions, and their prioritized initial action sets are identical. Hence, we may conclude Sys ~ ' Spec.
3.5. Prioritization and deprioritization operators There are several other language constructs of interest in the setting of priorities. Of particular interest are the prioritization and deprioritization operators introduced in [26]. The former operator may be used to raise the priority of a visible unprioritized action and is
726
R. Cleave I and et ai
written [a, for a ^ T; the latter lowers the priority of a visible prioritized action and is written L^, for « # i . The operational semantics of these operators is formally defined in Table 5. For them to be well-defined there must be a one-to-one correspondence between prioritized ports a and unprioritized ports a; in addition every relabeling / must satisfy fiQ.) = / ( ^ ) - Intuitively, P \a prioritizes all a-transitions that P can perform, while P [^ deprioritizes all a-transitions in which P can engage. Observe that the notion of priority is still static and not dynamic since the prioritization and deprioritization operators are static operators and therefore define a scope. Including prioritization and deprioritization operators with CCS^^ does not have any consequences for prioritized strong bisimulation since it is compositional with respect to these operators [26]. The axiomatization of prioritized strong bisimulation for finite processes can also be extended to cover the new operators. The necessary additional axioms are stated in Table 6. The presence of the prioritization and the deprioritization operators suggests a formal justification for the design decision that only prioritized internal actions have pre-emptive power over unprioritized actions. For this purpose assume that
Table 5 Semantics for the prioritization and the deprioritization operator P-^
P'
P-^P'
Prio1
Deprid
P\a-^P'\a
PVa-^P'la
P-^P' Prio2
P-^P' LiZiP)
Deprio3
y #A
PVa^P'Vo.
P-^P' y^a
Deprio2
1 € J(P)
Pla^P'fa
Pia^P'la
Table 6 Axioms for the prioritization and the deprioritization operator (Prid)
Or^r = 0
(Prio2) (Prio3)
(a.t)la
=
(y.r)la
= y.(tla)
(Prio4)
{t-^T_M-\-b.v)\a =
(Prio5)
(t-\-8M-\-y.v)\a
(Deprid)
a.Ufa) y^a
(t-\-T^.u)la-{-b.(vla)
= (t-\-S.u)\a-{-{t-\-y.v)la
S,y£A\{T_}
Ola = 0
(Deprio2)
(«0L« =
(Deprio3)
(y-Olo.
a.(tig)
= y-Ufa)
(Deprio4)
(r + r^.u -\- b.v)la = (t-\-L-iOlg. + b.iv[a)
(DeprioS)
(t-{-SM+
y.v)lg_ = (t-\-8.u)la-\-(t-\-y.v)la
y^a
S,yeA\{L}
Priority in process algebra
727
(i) pre-emption is not encoded in the side conditions of the operational rules but, equivalently, in the notion of bisimulation [26] and that (ii) the naive view of pre-emption gives all prioritized actions pre-emptive power. Thus, a naive bisimulation ^n demands the following condition for equivalent processes P ^n Q and unprioritized actions a e A: {P - ^ P' and ^p. P -U)
implies
{SQ\ Q - ^ Q\ ?p.Q-^.
and P' - „ Q')
and vice versa. The condition for prioritized actions can be adopted from standard strong bisimulation. It turns out that '^n is not a congruence; for example, «.0 -h b.O ^n b.O but (a.O-\-b.O) \ {b} ^n(b.O) \ {b} since the former process can engage in an a-transition while the latter is deadlocked. Then the question arises what the largest congruence contained in '^n is; it turns out that it is prioritized strong congruence as defined above (see [26] for details). This shows that in a pre-emptive semantics only prioritized internal actions may pre-empt unprioritized actions. However, the above algebraic result is only correct if we include the deprioritization operator in our language. An operational characterization of the largest congruence contained in ^n with respect to CCS^^ is an open problem. For the language extended by the prioritization and the deprioritization operator, an observational congruence together with an axiomatic characterization with respect to finite processes has been developed in [64,65], which is briefly reviewed here. For this purpose, we need to refine the prioritized weak transition relation. First, we re-define =^ to = ^ o - ^ o =1^, i.e., a weak unprioritized «-transition consists of an a-transition that is preceded and trailed by prioritized internal transitions only. Moreover, we replace ^ ( P ) by ^ ( P ) U 1I(P) in the definition of =^ since one has to take into account the fact that unprioritized actions may turn into prioritized ones when applying the prioritization operator. Finally, we write P = ^ P^ whenever P ==> P' and P # P\ Consequently, visible weak unprioritized transitions only abstract from prioritized internal actions. The reason for this restriction is that, otherwise, prioritized weak bisimulation would not be compositional with respect to the prioritization and the deprioritization operator. In contrast, the original prioritized weak transition relation allows an a-transition to be preceded by any sequence of T_- and r-transitions (satisfying a condition on prioritized initial action sets) and only to be trailed by ^-transitions. The notions of prioritized weak bisimulation and prioritized observational congruence are defined in [64,65] as follows, where Pi}, stands for 3P\ P =^ P' and P' -^^. DEFINITION 3.17. A symmetric relation 7^ c p x P is an extended prioritized weak bisimulation if for every (P, Q) elZ and y eA\{T} the following conditions hold. (1) P 4 implies Qi}^.
(2) P ^
P' implies 3Q'. Q^Q'
(3) P - ^ P'implies 3Q\Q=>Q\
and (P, Q') e 7^. L = S ( P ) U2Z:(P), and ( P \ Q') G 7^.
We write P ^ p j Q if there exists an extended prioritized weak bisimulation TZ such that (P,e>€7^.
728
R. Cleaveland et ai Table 7 Axioms for the r-laws (r1) (r2) (T3)
(T1)
Y-{^-t + t) = Y.t z_.t = r.r 4- r }/.(/ + r.w) = >/.(/ -H T.w) + K-w /-fr.(M + r.i;) = / + r.(M + r.D) + T.i;
l€{r,r}
H/r Cj u
Table 8 Axiomatization of Cj (Axioms /) (iC1) a.r Cj a.u
(iC2)
0 Cj y.r
y € >1 \ {r}
(iC3) a.t Cj 0
DEFINITION 3.18. We define P ^ L Q if forall y G ^ \ {r} the following conditions and their symmetric counterparts hold. (1) P-^ P' implies 3G' G = ^ G' and P ' ^ p ^ G^
(2) P -^
P' implies 3|2^ 2 = » G', where L =^(P)UJX(P),
and P^^p^ G'-
The observational congruence ^^ , possesses nice algebraic properties for our language extended by the prioritization and the deprioritization operators, including a largest congruence result similar to Theorem 3.11 and a sound and complete axiomatization for finite processes. For the latter, the axiomatization for prioritized strong bisimulation is augmented with suitable r-laws as shown in Table 7 (cf. [58]). The relation ^ i , occurring in the side condition of Axiom (r 1), is the pre-congruence on finite processes generated by the axioms presented in Table 8 using the laws of inequational reasoning. We write \-j t ^[U if t can be related to u by Axioms (iC1), (iC2), and (iC3). Intuitively, h/ r Ei w holds, whenever (i) T_ e lit) if and only if £ G J(M), and (ii) ^ ( O ^ ^ ( w ) . Finally, it should be noted that applications underline the importance of the additional abstraction from internal transitions gained by leaving out the prioritization and deprioritization operators. Indeed, the observational congruence ^ L does not relate processes Sys and Spec of our back-and-forth example [55]. This is due to the presence of action T in process Sys.
3.6. Extension to multi-level priority schemes We now remark on the extension of CCS^^ to a multi-level priority scheme. We first alter the definition of prioritized initial action sets to capture the priority-level of actions by introducing sets 1^{P) for process P with respect to priority value k as shown in Table 9.
Priority in process algebra
729
Table 9 Potential initial action sets for CCS^9 l^(a:I.P) = {a:l\l
= k}
I^(P[/]) = { / ( « : / ) | a :/G I^(P)}
I'^ifix.p) =iHP[tix.p/x]) IHPXL)
IHP-^Q)=IHP)UIHQ)
=IHP)\(LUL)
IHP\Q)
=lHP)Ul''(Q)U{r:k\lHP)niHQ)^0]
Table 10 Prioritized weak transition relation i 4 =df (^)*
P ~i P' if P ^
P' andU' (P) ^ L for all I < k
Using this definition and the notation ''r ^ l'^^(P) if ^l < k. r :l e l^(Py\ the operational semantics depicted in Table 2 can be re-stated in the manner illustrated by the following modification to Rule (Com3). p '^'•h^ pf
Com3 p\QlA
Q ^^ -h^ Qi
-^ — X i r^P P'\Q'
I Q)-
Observe that the sets \^{P) may contain actions in which P cannot initially engage, since their definition does not consider pre-emption. In fact, the set X^ (P) of actions with priority value k in which P can indeed initially engage is given by {a: /: G l^(P) 11: / ^ l^(P). for all / < k}. However, it is easy to show that r ^ I^^(P) if and only if r ^ I^^(P) [55]. Thus, the side condition of Rule (Com3) captures our intuition that P \ Q cannot engage in a more urgent internal transition. The re-development of the bisimulation-based semantic theory proceeds along the lines of the above sections and does not raise any new semantic issues. For example, the notion of prioritized observational congruence is defined as follows, where (i) the prioritized weak transition relation is given by the rules in Table 10, (ii) 2Z:^(P)=dfX^P)\{r:/:}, (iii) the relation ~ mi is the adaption of prioritized weak bisimulation to the multi-level priority scheme, (iv) I(P) =df Ui^HP) \keAf}. and (V) lI<''(P)=^fI<^{P)\{T:l\l
and P' ~mi Q'•
730
/?. Cleaveland et al
3.7. Concluding remarks and related work We conclude by first commenting on the design decision that priority values are considered to be part of port names, which implies that only complementary actions having the same priority can synchronize. Lifting this design decision by allowing a :k and a:l, where k^l, to synchronize leads to the question of which priority value to assign to the resulting r. One can imagine several obvious choices for this function, e.g., maximum or minimum. On the other hand, [36,38] recommend using the sum of the priority values of the actions involved. Unfortunately, while a specific function may be suitable for certain examples, it often appears ad hoc in general. In the next section we will see that such a function is unnecessary when dealing with local pre-emption. Regarding related work, Gerber and Lee developed a real-time process algebra, the Calculus of Communicating Shared Resources (CCSR) [35], that explicitly takes the availability of system resources into account. Synchronizations between processes are modeled in an interleaving fashion using instantaneous transitions, whereas the access of resources is truly concurrent and consumes time. In CCSR a priority structure may be defined over resources in order to indicate their importance, e.g., for ensuring that deadlines are met. The underlying concept of priority is similar to that of CCS^^ in that priorities are static and pre-emption is global. In [36] a resource-based prioritized (strong) bisimulation for CCSR together with axiomatizations for several classes of processes [21 ] is presented. Prasad extended his Calculus of Broadcasting Systems (CBS) [70] for dealing with a notion of static priority [71]. He refers to the priority calculus as PCBS. For PCBS nice semantic theories based on Milner's strong and weak bisimulation [58] have been developed. Remarkably, these theories do not suffer from the technical subtleties which have been encountered for CCS^^, although the concept of pre-emption is basically the same. The reason is that PCBS uses a much simpler model for communication which is based on the principle of broadcasting. In this setting, priority values are only attached to output actions, which cannot be restricted or hidden as in traditional process algebras. Finally, it should be mentioned that PCBS contains an operator, called translate, which enables the prioritization and the deprioritization of actions.
4. Static priority and local pre-emption This section provides a new semantics, CCS^' (CCS with static priority and local preemption), for the language introduced in Section 2. The new semantics is distinguished from the one developed in the previous section in that it only allows actions to pre-empt others at the same "location" and, therefore, captures a notion of localized precedence. This constraint reflects an essential intuition about distributed systems, namely, that the execution of a process on one processor should not affect the behavior of a process on another processor unless the designer explicitly builds an interaction, e.g., a synchronization, between them. The following example illustrates why locations should be taken into account when reasoning about priority within distributed systems. The system in question consists of an application that manipulates data from two blocks of memory (see Figure 4). In order to
Priority in process algebra
dma
731
dma
Fig. 4. Example system.
improve efficiency, each memory block is connected to a direct-memory-access (DMA) controller. Assume further, that application AppI fetches pieces of data alternately from def
each memory block, i.e., AppI = fetch 1.fetch2.AppI. Both Blockl and Block2, are contmuously able to serve the application or to allow the external DMA controller to access the memory via channel dma, with the former having priority over the latter; whence, Blockl = fetch 1.Blockl -h dma.Blockl and Block2 = fetch2.Block2 -h dma.Block2. The overall system Sys is given by: Sys =^ (AppI I Blockl | Block2) \ {fetch 1, fetch2|.
Since the application uses the memory blocks alternately, the DMA is expected to be allowed to access the one memory block which is currently not serving the application. However, when using the approach to priority involving global pre-emption presented in Section 3, all dma-transitions in the labeled transition system of Sys are pre-empted, since the application can indefinitely engage in a prioritized communication, i.e., direct-memoryaccess is never granted. Generally speaking, one would expect that priorities at different sites of a distributed system do not influence the behavior of each other, i.e., priorities at different sites are supposed to be incomparable. The semantics given in Section 3 does not permit this distinction to be made. Hence, it precludes too many transitions that one would expect to find in a distributed setting. In the following, we show how to remedy the shortcoming of the semantics of Section 3 for distributed systems. Our elaboration is based on the concept of local pre-emption [24,28]. The remainder of this section is organized as follows. Section 4.1 introduces a notion of locations that is used in Section 4.2 in the definition of the operational semantics of CCS^' for a two-level priority scheme. Sections 4.3 and 4.4 develop the semantic theories based on strong and weak bisimulation, respectively, while Section 4.5 re-considers the directmemory-access example. The consequences of lifting some design decisions in CCS^ are discussed in Section 4.6. After extending CCS^' to a multi-level priority scheme in Section 4.7 and presenting another calculus to priority taken from [24] in Section 4.8, a formal comparison of the two calculi is given in Section 4.9. Finally, Section 4.10 concludes with some additional remarks and with comments on related work.
732
R, Cleaveland et al
4.1. Locations A location represents the "address'' of a subterm inside a larger term; when a system performs an action, CCS^' semantics will also note the locations of the subterm that "generate" this action. Because of the potential for synchronization more than one subterm may be involved in an action. Our account of locations closely follows that of [28,62]. Let ^addr =df [L, /?, /, r] be the address alphabet, and let • be a special symbol not in ^addr. Then Addr =df {•^ | ^ G ^4*^^^} represents the set of (process) addresses ranged over by v and w. Intuitively, an element of Addr represents the address of a subterm, with • denoting the current term, / (r) representing the left (right) subterm of -h, and L (/?) the left (right) subterm of |. For example, in process (a,0 \ b.O) H- c.O the address ofa.O is •L/, of^.Ois»/?/,andofc.Ois«r.If •^i and •52 are addresses, then we write #51 •52 = •s\S2 to represent address concatenation (where s\S2 represents the usual concatenation of elements in w4*jdr)- Further, if V c Addr and ^ e Addr, then we write V - ^ for {v - ^ \ v e V}. Occasionally, we omit • from addresses. As mentioned previously, we adopt the view that processes at different sides of the parallel composition operator are logically - not necessarily physically - executed on different processors. Thus, priorities on different sides of the parallel composition operator are distributed and, therefore, should be incomparable. However, priorities on different sides of the summation operator should be comparable since argument processes of summation are logically scheduled on the same processor. This intuition is formalized in the following location comparability relation on addresses which is adapted from [38]. DEFINITION 4.1 (Location comparability relation). The location comparability relation X on addresses is the smallest reflexive and symmetric subset of Addr x Addr such that for all i;, M; G Addr: (1) {v 'l,w -r) e\x, and (2) (u, w) etx implies (u • ^, w; • ^ e x , for ^ e Addr-
In the sequel, we write v \x\w instead of (u, w) e tx. If v e Addr then we use [v] to denote the set {u; € Addr \ v \xw}. Note that the location comparability relation is not transitive, e.g., we have LI tx r and r ix /?/, but LI t^ Rl, since L t^ R. We now define the set Coc of (transition) locations as Addr U (Addr x Addr). Intuitively, a transition location records the addresses of the components in a term that parTable 11 Distributed prioritized initial action sets for CCS^' XrrM^.P)
= I,„{P[fix.P/x])
iminn) = {/(ot)i«€i,„(n) Zm.L(P\Q) Zim.L.n.R)(P\Q)
= ZnAP) =
{L\ZnAP)f^Z,AQ)^^]
Z.ioL.P) = [a]
i^c^x^) = Z„AP)\(LUL) Zn.R(P\Q)
=
Zn(Q)
Priority in process algebra
733
ticipate in the execution of a given action. In our language, transitions are performed by single processes or pairs of processes (in the case of a synchronization). We define (i;, w) • f =df (D • f, If • 0 and [(u, w)] =df [v] U [w], where v,w e Addr and ^ e AddrWe use m, n, o , . . . to range over £oc in what follows.
4.2. Operational semantics The operational semantics of a CCS^' process P is given by a labeled transition system {V, A U (£oc X A), ->, P). The transition relation -> c 7^ x (£^c x A)) x 7^ with respect to unprioritized actions is defined in Table 12 using Plotkin-style operational rules [69] whereas for prioritized actions the same rules as for CCS^^ apply (cf. Table 2). We write p J!b% p' if ^p^ ^^^ Q,)^ p'^ ^ ^ ^ aj^^j say that P may engage in action a offered from location m and thereafter behave like process P'. The presentation of the operational rules requires distributed prioritized initial action sets which are defined as the least sets satisfying the rules in Table 11. Intuitively, X,„(P) denotes the set of all prioritized initial actions of P from location m. Note that these sets are either empty or contain exactly one initial action. T,„(P) = 0 means that either m is not a location of P or P is incapable of performing a prioritized action at location m. Additionally, let us denote the set |J{J,„(P) \m e M] of all distributed prioritized initial actions of P from locations M c Coc by I^iP) and the set Zcod^) ^^ all distributed prioritized initial actions of P by J ( P ) . We also define analogous sets restricted to visible actions: ^M(P) =diTj^{P) \ {r} a n d ^ ( P ) =df X(P) \ {T}, respectively. The side conditions of the operational rules guarantee that a process does not perform an unprioritized action if it can engage in a prioritized synchronization or in an internal computation, i.e., a r^-transition, from a comparable location. In contrast to the global Table 12 Operational semantics for CCS^'
a.P-^^P
Rel
Res
pJIUO^ •
P^f^JUdl^
P[lJiX.P/x] /JLX.P
; p^Qjld^p'
Sum2
-^--—^—T_iX{P) P + Q -^^-^^ Q'
p'if]
P' m a — > •
LiliQ)
}'
P "^'^y P'
P\L^^^
Rec
P
Sum1
a^LUL
Com1
XL •^p'
p'
M.im](f')^M.(Q) = ^ P\QJILL:^
Com2
QJ}^Q' ^ p\Qjl^^p\Q'
P'\Q
S.\n\iQ)^MP) = ^
734
R. Cleaveland et al.
notion of pre-emption defined in Section 3, the local notion here is much weaker since ^[m] iP) ^ l^iP)^ for all m 6 Coc and P € P . In other words, local pre-emption does not pre-empt as many transitions as global pre-emption does. The difference between CCS^' and CCS^^ semantics manifests itself in the side conditions of the rules for parallel composition with respect to unprioritized transitions. Since locations on different sides of parallel composition P | Q are incomparable, x's arising from a location of P cannot pre-empt the execution of a transition, even an unprioritized one, of Q. Only if P engages in a prioritized synchronization with Q can unprioritized actions from a comparable location of P be pre-empted.
4.3< Semantic theory based on strong bisimulation
As in Section 3, we present an equivalence relation for CCS^' processes based on bisimulation [67]. Our aim is to characterize the largest congruence contained in the "naive" adaptation of strong bisimulation [58], which we refer to as naive distributed prioritized strong bisimulation, to our framework obtained by ignoring location information. The definition of naive distributed prioritized strong bisimulation, ::^, is identical to the one presented in Definition 3.1, except that our transition relation - ^ is defined as mentioned above. Although '21 is an equivalence, it is unfortunately - in contrast to Section 3.2 - not a congruence. The lack of compositionality is demonstrated by the following example, which embodies the traditional view that ""parallelism = nondeterminism". We have a.^.0 + b_.a.0 :^ a.0 I ^.0 but {a.^.0 + b.a.0) | ^.0 qt{a.{S\ ^.0) | §.0; the latter process can perform an ^-transition, while the corresponding «-transition of the former is pre-empted because the right process in the summation can engage in a prioritized communication. The above observation is not surprising since the distribution of processes influences the preemption of transitions and, consequently, the bisimulation. However, we know by Proposition 3.6 that ci includes a largest congruence :^^ for CCS^'. 4.3.1. Distributed prioritized strong bisimulation. we need to take local pre-emption into account.
To develop a characterization of ::^^
DEFINITION 4.2. A symmetric relation K ^V x V is SL distributed prioritized strong bisimulation if for every (P, 2) 6 7^, or G A, a € A, and m e Coc the following conditions hold. (1) P -^ P' implies 3Q'. Q-^ Q' and {P^ Q') e 7^. (2) P - ^ ^ P ' i m p l i e s ^ e ^ « . e ^ ^ G^ 5 [ „ ] ( G ) ^ S [ ; , , j ( / ' ) . a n d ( P ^ G 0 6 7^. We write P c:i^ Q if (P, Q) elZ for some distributed prioritized strong bisimulation 11. Intuitively, the distributed prioritized initial action set of a process with respect to some location is a measure of the pre-emptive power of the process relative to that location. Thus, the second condition of Definition 4.2 states that an unprioritized action a from some location m of process P must be matched by the same action from some location n of Q and that the pre-emptive power of Q relative to n is at most as strong as the pre-emptive power of P relative to m. The next theorem is the main result of this section.
Priority in process algebra THEOREM
735
4.3. :^' is the largest congruence contained in :^.
We refer to [55] for the proof; the context needed in the largest congruence proof is similar to the one used in Section 3.3. 4.3.2. Axiomatic characterization. In this section we present an axiomatization of ::^' for finite processes, for which we introduce a new binary summation operator 0 to the process algebra CCS^'. This operator is called distributed summation operator and is needed for giving an Expansion Axiom (cf. Axiom (E) in Table 13). Its operational semantics is defined below and differs form the nondeterministic choice operator -f in that a location in its left argument is never comparable to one in its right argument. dSum1
t^t'
dSum1
t^u-^t' ,^ ^ dSum2
u —> u
rew^>M'
t-^^^t'
t^u^^^^^t' ^ u dSum2 —
>u
teu-^^^^u'
It can easily be checked that 2::' is compositional with respect to 0 . Now, we turn to the axiom system for distributed prioritized strong bisimulation. We write \-E t = u if term t can be rewritten to u using the axioms in Tables 13 and 14 as well as Axioms (A1 )-(A4), Axioms (Res1 )-(Res4), Axioms (Rel1 )-(Rel3), and Axiom (P) from Table 3. Axioms (Id), (D1), (S2), and (S3) involve side conditions. Regarding Axiom (Id), we introduce the unary predicate t] over processes (of the form YljeJ Yj-^j^ ^^^ some nonempty index set J) together with the following proof rules: (i) tja.^ and (ii) \]t and \\u implies \\(t + u). Intuitively, ^(J^^^yyy.ry) if and only if yy G Aforall; e 7. The relation Cj is defined as in Section 3.5 (cf. Table 8). The axioms in Table 13 are those given in Table 3 and augmented Table 13 Axiomatization of ~ ' (Axioms E) (iA1)
t^u = u®t
(iA2) r 0 (i/ e u) = (^ © M) 0 i^
(iA3)
r0r =r
(iA4) r 0 O = r
(E)
t = 0,- Y.J Yij Aij and ii = 0^. Y.I hi -Ukl implies M " = 0 / E ; iYij-iUj U ) + E^- Uli^-iUj I likl) I Yij ^ hi, Yij, hi e A] 'rT.klll{L-it,j\^kl)\Yij^hh Yij^hl^A])i ®k Eiihhit I uki) + E / Ej{^-(tij I i*ki) I Yij ^ hi, YijJu e A} + E / EjiL-ifij I i*ki) I Yij ^hh Yij^hi e A})
(iRes4) (r 0 M) \ L = (r \ L) 0 (u \ L)
(iRel3) (r 0 u)[f] = t[f] 0 u[f]
736
R. Cleaveland et al Table 14 Axioms E (continued)
(D1) (ret') + ( M e u ) = ((ret') + u')e((Meu')
+ r')
( ( - / r c j r ' , h/MCiw') (D2) (r 0
M)
+ a.u = (r -f a.u) e (« + a.i')
(Id) r©a.M = r + a.M (Ic2) (a.r +
M)
= (a.r +
{\\t) M)
0 a.r
(51) (/ + a.u) 0 (r' + a.u') = (/ + a.w + «.«') 0 {t' + a.w') (52) (r + a.v) 0
(M
+ a.v) = (r + a.u) 0
M
(53) / 0 M = r + M
(h/ t Cj {\-j
M)
t=\u)
with the corresponding axioms for the distributed summation operator. Moreover, the Expansion Axiom has been adapted for our algebra (cf. Axiom (E), where JZ is the indexed version of + , and 0 is the indexed version of 0 ) . Note that paralleUsm in CCS^' cannot be resolved in nondeterminism by using operator -f- only, since priorities on different sides of I are incomparable, but priorities on different sides of + are comparable. This is the motivation for introducing operator 0 . The axioms in Table 14 are new and show how we may "restructure" locations. They deal with the distributivity of the summation operators (Axioms (D1) and (D2)), the interchangeability of the summation operators (Axioms (Id) and (Ic2)), and the saturation of locations (Axioms (S1), (S2), and (S3)), respectively. THEOREM
4.4. Let t, u befiniteprocesses. Then \-E t = u if and only ift 2^' u.
The proof of this theorem can be found in [28,55]. 4.3.3. Operational characterization.
The following definition introduces the equiva-
lence 2:^* which characterizes 2^' as a standard strong bisimulation [55]. It uses the notation P -j-> P\ for P, P ' € P , Of G A, and L c A \ {r}, whenever 3m e Coc. P - ^ ^ P' and ^ [ ^ ] ( P ) c L. Note that these enriched transitions take local pre-emption potentials into account, thereby avoiding the explicit annotation of transitions with locations. 4.5. A symmetric relation 7^ c 'p x P is an alternative distributed prioritized strong bisimulation if for every {P, Q) ^ IZ, a £ A, q^ e A, and L c. A\[T} the following conditions hold. (1) P -^ P' implies 3Q'. Q-^ Q' and {P\ Q') e 71. DEHNITION
(2) P-j^
P' implies 3Q'. Q-j^
Q' and {P\ Q') € U.
We write P c:^^ Q\f (P, Q) £K for some alternative distributed prioritized strong bisimulation 1Z. Similar to Section 3.3.3 we obtain an operational characterization result. THEOREM
4.6 (Operational characterization). ^^ = :^*.
Priority in process algebra
737
4.4. Semantic theory based on weak bisimulation As for CCS^^, we develop a coarser bisimulation-based congruence by abstracting from internal actions. We start off with the definition of a naive distributed prioritized weak bisimulation which is an adaptation of observational equivalence [58]. 4.7 {Naive distributed prioritized weak transitions). (1) y =df ^, if K G (x, r}, and y =df K, otherwise. (2) = ^ x =df ( ^ U U { ^ ^ I m e Coc])\
DEFINITION
(3) = : > x = d f = = ^ x O (4) = ^ x = d f = = > x O
>0=>x>o=»x-
In the following we write P =^x
P' for 3m e Coc. P = ^ x Z^'-
DEFINITION 4.8 {Naive distributed prioritized weak bisimulation). A symmetric relation 1ZC.V xV is a. naive distributed prioritized weak bisimulation if for every {P, Q) elZ and y G .4 the following condition holds.
P-^P'
implies
^Q'. Q = 4 x Q' and {P\ Q') e 7^.
We write P ^x Q if {P, Q) e1l for some naive distributed prioritized weak bisimulation 7^. It is fairly easy to see that ^ x is not a congruence for CCS^'. One compositionality defect arises with respect to parallel composition and is similar to the one mentioned for naive distributed prioritized strong bisimulation. Another defect, which is carried over from CCS, is concerned with the summation operators. 4.4.1. Distributed prioritized weak bisimulation. We devote the rest of Section 4.4 to operationally characterizing the largest congruence contained in naive distributed prioritized weak bisimulation. To do so, we first re-define the weak transition relation. DEHNITION 4.9 {Distributedprioritized weak transitions). For L, M c ^ \ {r} we define the following notations.
(1) i = d f £ , « =dffl, •? =df £, a n d 5 = d f « .
(2) P - ^
P' if P -^^^ P' and M.[m\^P) Q ^•
(3) ^=dfi^U[j{-^\ • ..
(5)
oj
s
me Coc})*. a^^
g ^
=^=ifi^U[J{^\meCoc}r.
(6) P 4%, P' if 3P", P'". P ^
P" ^ ^
/"" = ^ P' and 1I{P") Q M.
738
R, Cleaveland et al.
P ^^^> P' means that P can engage in action a at location m to P' provided that the environment does not offer a prioritized communication involving actions in L. If the environment were to offer such a communication, the result would be a i; at a location comparable to m in P, which would pre-empt the a. Similarly, P ^ ^ P' holds if P can evolve to P' via a nonpre-emptable sequence of internal transitions, regardless of the environment's behavior. These internal transitions should therefore involve either x, which can never be pre-empted, or r, in which case no prioritized actions should be enabled at the same location. Likewise, P =^ P' means that, so long as the environment does not offer to synchronize with P on a prioritized action in L, process P may engage in a sequence of internal computation steps and become P'. Finally, the M-parameter in =^
provides a
measure of the pre-emptive impact that a process has on its environment. P ===^ P' is true if P can engage in some internal computation followed by a, so long as the environment refrains from synchronizations in L, and then engage in some nonpre-emptable internal computation to arrive at P'. In addition, the state at which a is enabled should only offer prioritized communications in M. Note that the definition of P ^=^ P' is in accordance with our intuition that internal actions, and therefore their locations, are unobservable. Moreover, the environment of P is not influenced by internal actions performed by P, since priorities arising from different sides of the parallel composition operator are incomparable. Therefore, the parameter M is unnecessary in the definition of the relation = ^ . Finally, for notational convenience, = = ^ is interpreted as ==>•. DEHNITION 4.10 {Distributedprioritized weak bisimulation). A symmetric relation K c P X P is a distributed prioritized weak bisimulation if for every {P, Q) elZ.a e A,ci_e A, and m G Coc the following conditions hold. (1) 3(2', Q"^ Q=hQ''^ Q\ MQ") ^ MP)^ and (P, Q') e 7^.
(2) P -^ (3) P ^^^
P' implies 3|^^ Q =M^ Q\ and {P\ Q') e K. P^imp\its3Q\n.Q^
Q\ L=^y,,^iP).
M =mP).
^nd {P\ Q') e
n. We write P ^ |2 if (JP, (Q) G 7^ for some distributed prioritized weak bisimulation IZ. Condition (4.10) of Definition 4.10 guarantees that distributed prioritized weak bisimulation is compositional with respect to parallel composition. Its necessity is best illustrated def
def
by the following example. The processes P = x.^.O and Q — a.O would be considered def
_
equivalent if Condition (4.10) were absent. However, the context C[X] = X \ (a.O + ^.0) distinguishes them. The following proposition is the CCS^' equivalent of Proposition 3.9. PROPOSITION 4.11. The equivalence relation ^ is a congruence with respect to prefixing, parallel composition, relabeling, and restriction. Moreover, ^ is characterized as the
Priority in process algebra
739
largest congruence contained in ^ x , in the sub-algebra o/CCS^' induced by these operators and recursion. 4.4.2. Distributed prioritized observational congruence. As in Section 3, the summation fix presented in [58] is not sufficient in order to achieve a congruence relation. DEFINITION 4.12. We define P ^ ' Q if for all or G A, a € A, and m e Coc the following
conditions and their symmetric counterparts hold. (1) I(P) 2 I(Q) (2) P -^ P' implies "^Q'.Q-^Q' and P'^Q'. (3) pJIb^p^
ij^piies 3Q^n. Q ^
Q\ L =^^,„j(P), M =mP).
and
P'^Q\
Now, we can state the main result of this section, which can be proved by using the technique already presented in Section 3.3.2; see [55] for details. THEOREM
4.13. ^ is the largest congruence contained in ^ x •
4.4.3. Operational characterization. We now characterize distributed prioritized weak bisimulation as standard bisimulation over an appropriately defined transition relation. To begin with, we introduce a family of relations = > on processes, where M c A \ {x}, by defining P =^ P' if 3P'^ P ^
P" ^
P' mdlI{P'')
c M. Moreover, we write
P ^> P' whenever there exists some m € Coc such that P =f=^ P' DEFINITION 4.14. A symmetric relation 7?. c 7^ x 7^ is an alternative distributed prioritized weak bisimulation if for every (P, Q) e'R, a e A, q_e A^, and L,M c. A\[z} the following conditions hold. (1) P=^P'
implies 3G^ Q=^ Q' and {P\ Q') € 7^.
(2) P^P'
implies 3Q'. Q ^
Q' md {P', Q') e 7^.
(3) P = = ^ P' implies 3Q^ Q = ^ Q' and {P\ Q') e 7^. We write P^^Q if (P, Q) e1Z for some alternative distributed prioritized weak bisimulation IZ. THEOREM
4.15 (Operational characterization). ^ = ^*.
The interested reader can find the proof of this theorem in [55].
740
R. Cleaveland et al X dmal
1%^
J^
1 dma
Fig. 5. Semantics of the dma-system Sys.
4.5. Example We now return to the direct-memory-access example system introduced above. The CCS^' semantics of Sys, which corresponds to our intuition regarding distributed systems, is given in Figure 5 where we leave out the locations in the transitions' labels. Recall that the application uses the two memory blocks alternately. Thus, the DMA is expected to be allowed to access the free memory block. Accordingly, the specification of def
the system can be formalized by Spec = dma.Spec. It is easy to see that the symmetric closure of {(Spec, Sys), (Spec, (fetch2.Appl | Blockl | Block2) \ {fetch 1, fetch2})}
is a distributed prioritized weak bisimulation. Therefore, Spec ^ Sys as expected, i.e., system Sys meets its specification Spec.
4.6. Discussion of alternative design decisions Up to now we have restricted the number of priority levels in CCS^' to two and communication to complementary actions having the same priority. In this section we study the implications of the removal of these restrictions, which leads to a new version of CCS^', called CCS^i (CCS^' with a multi-level priority scheme), that is formally defined in the next section. Allowing communication between unprioritized actions and complementary prioritized actions raises the question of whether the resulting internal action should be r or £ (cf. Section 3.7). When dealing with local pre-emption, this decision has no important consequences for sequential communicating processes, i.e., those in standard concurrent form [5 8]; however, it is of obvious importance for processes like (£.0 | ^.0)-f-Z7.0 in which one has to decide if the Z?-transition is enabled. One reasonable view is that a communication should be pre-empted whenever one communication partner is pre-empted, i.e., it cannot engage in a communication. This implies that the minimal priority of the complementary actions ought to be assigned to the internal action. To reflect this in the operational semantics, one could replace Rules (Com1), (Com2), and (Com3) for parallel composition by the ones presented in Table 15 plus their symmetric counterparts. The side conditions involve sets 1I{P) that include all unprioritized visible actions in which P can initially engage.
Priority in process algebra
741
Table 15 Modified operational rules p
^-Q
Com1 -
UiQ)^^(Q))
%P'\Q p
'nM^
Com3a
Com3b
P'
,](P)n(S(0u2z:(0):= 0 ,(0n(^(P)u2z:(P)) == 0
Q-
\LMR).T.
P JH:^ P' P\Q^
iLjiR).i
Q •
=^
— ^ i n
and
i(0n(S(P)u2z:(P)) == 0
^P'\Q'
It turns out that the largest congruence results concerning distributed prioritized strong bisimulation and distributed prioritized observational congruence can be carried over to the new calculus. However, the new semantics has algebraic shortcomings since parallel composition is not associative, as illustrated by the following example. Consider process (^.0 -h a.O) I (a.O + c.O) | c.O. In the left-associative case, the initial ^-transition is pre-empted, according to Rule (Com1) since a may potentially communicate with a. In the right-associative case, on the other hand, the ^-transition in the second component is pre-empted, and consequently the Z7-transition is enabled by Rule (Com1). The reason for this problem is that transitions are pre-empted because a process can potentially engage in a higher prioritized communication from a comparable location. However, this potential communication cannot take place if the communication partner is itself pre-empted. The same problem also arises when extending CCS^' to multiple priority levels, even if conmiunication is only allowed on complementary actions of the same priority, as can be observed by using a slight adaptation of the previous example: (Z?:2.0-ha:1.0)|(a:1.0 + c:0.0)|c:0.0. One can imagine two approaches to fixing the problems with the first (and second) alteration to the theory. One is to change the operational semantics; in particular, the side conditions could be weakened such that an unprioritized transition is only pre-empted when a prioritized action from a comparable location can actually engage in a communication. This approach has not yet been investigated in the literature. The second solution follows an idea developed in [24] for a different setting and involves the use of a syntax restriction on processes prohibiting output actions, i.e., actions in A, from occurring as initial actions that are in the scope of +. Hence, all potential communication partners are also actual ones, and the standard side conditions for parallel composition are sufficient to encode the desired notion of pre-emption. It is important to mention that the proposed syntax restriction still allows one to specify many practically relevant examples within the calculus. Indeed, a similar restriction may be found in the programming language occam [45].
4.7. Extension to multi-level priority schemes For CCS^i we allow a multi-level priority scheme and communication between complementary actions having potentially different priorities. As seen in the previous section.
742
R. Cleaveland et al
both of these relaxations yield a semantics for which parallel composition is not associative. However, we have also argued that this problem vanishes if the syntax is restricted such that output actions can never be pre-empted. We adapt the syntax restriction proposed by Camilleri and Winskel [24], which states that initial actions in the scope of a summation operator must be input actions. Therefore, input and output actions are explicitly distinguished in CCS^,, with the internal action r being treated as an input action. In the following, we let «, ^ , . . . range over the set A of input ports and a,b,... over the set A of output ports. Moreover, we let y stand for any input action and let a be a representative of A =df AU A{J{T}. Since in the restricted syntax priority values of output actions need never be compared with other priority values, there are no priority values associated with output actions at all. The syntax of CCS^, is formally defined by the following BNF for P. I ::= 0\ X \ y.k.I \ I + I \ I®I \ I\I \ / [ / ] \ I\L 1 tix.I P ::= 0 1 jc 1 a-.k.P \ I +1 \ P® P \ P \ P \ P[f] \ P\L1 tix.P Here, / is an injective, finite relabeling, L c yi U yl is a restriction set, and JC is a variable taken from a countable domain V. A relabeling satisfies the properties /(yi) c yl, f(A) c yl, / ( r ) = r, and f(a) = f(a). Thus, in addition to the requirements of a finite relabeUng in CCS, relabehngs in CCS^, may only map input ports to input ports and output ports to output ports. Since actions attached with different priority values do not represent different ports here, relabehngs and restriction sets do not deal with priority values. Especially, the priority value of a relabeled transition remains the same, i.e., there is no expUcit or implicit mechanism for prioritization or deprioritization (cf. Section 3.5). In the remainder, we let P^, denote the set of all CCS^, processes. The semantics of CCS^, processes are again labeled transition systems whose transition relations are specified by operational rules. Since transitions labeled by output actions are never pre-empted they do not need to be associated with locations. We first present two auxiliary sets that are useful for^resenting the operational rules: (i) initial output action sets 1I(P) of a process P, and (ii) initial input action sets 1^{P) of P with respect to a priority value k and a location m, which are defined to be the least sets satisfying the equations presented in Tables 16 and 17, respectively. Fortechnical convenience, we remove the complement of output actions in the definition of 2 r ( ) , and we use the following four abbreviations: (i) 1I<^F) = d f U i t i P ) \meMJ
Table 16 Initial output action sets for CCS^, "Sifix.P)
= ^{P[fix.P/x])
TCia.P)
= {a}
mp\Q) = mp)yjmQ) MP^Q) = mp)yjmQ) mpu]) = [f{a)\aemp)] mp\L) =mp)\iLuL)
Priority in process algebra
743
Table 17 Initial input action sets for CCS^,
lU/^x.P)
= l^^iP[^x.P/x])
lUyIP)
={y\k = l}
i^./CP-HG) = tin
t.L^^^Q)
= t(P)
triP + Q) = i(Q)
t^iP^Q)
= ^AQ)
t(P[f])
= {f{y)\yetiP)}
lf„.^(P|(2) =
4(P\L)
= 4(P)\(LUl)
IIR(P\Q)
4(P)U{T
i4(P)n^((2)^0}
= lf,((2)U{r|lf,(0n^(P)#0}
Table 18 Operational semantics for CCS^, with respect to output transitions
Act
iSum1
a.P-^P Rel
P-^
P'
—:
P[f]J^ Rec
P[fjiX.P/x]
=
Com1
PBQ-^P' Q-^Q'i F —
iSum2 — =
ii
Hx.P-^P'
•
pr-^ Com2
P®Q-^Q'
P' [/] =
P\Q-^P'\Q Q-^Q' P\Q-^P\Q'
/>'
Res
=
a^LUL
p\L-^P'\L
(iii) I(P) =df U{Im(^) I ^ ^ ^oc, I ^ ^}^ and (iv) n ( P ) = d f I ( / ' ) \ { r } . The operational rules for CCS^, semantics are formally stated in Table 18 for output transitions and in Table 19 for input transitions. As expected, the rules for output transitions coincide with the ones for plain CCS [58], whereas the rules for input transitions take local pre-emption into account, thereby using location and priority value information in their side conditions. It is worth taking a closer look at the side conditions of Rules (Sum1) and (Sum2) which differ in principle from the corresponding ones in CCS^'. They guarantee that an initial y : /-transition of a process P is also pre-empted whenever there exists a higher prioritized initial y : /[-transition of P, i.e., '\fk
744
R. Cleaveland et al. Table 19 Operational semantics for CCS^, with respect to input transitions
Act
Sum1
T.Yi^i^'iQ)
y.k.P-^^^^P
iSum1
Sum2 — P+
iSum2
Com1
f T, y ^ r * (P) Qj^l:yl^Q'
P\QJ1±:L±^
Rel
pJ!hI^P'
Com2
r, \
Pl^x.P/x] -^^^^^ P' HX.P
\.a :k
Com3
n<^(0 n2z:(/') = 0
P'
Q-^Q\^,
P\QJ!1±:IA.P'\Q'
>• P'
Com4
P JL^ p'
^'"'
(P)niliQ) = i'
n.a :k
0 "-"-^^ o' -- ^^-Vi^MQ) r ^n<^(0n2z:(P) =0
Res
(1) p-^
JL<;;AP)nll(Q)=^(^
P\Q'
P\Q Rec
P'\Q
y^LUL
p' implies a e ^ e - ^ G^ and ( P \ 2 0 ^ 7^, and
(2) P ^ ^ ^ ^ P' implies 3(2^/,^. 2 ^ ^ Q\ I,(e) c Ef^l^CP), and ( P \ (2'> € We write P Crimi Q if (P, Q) elZ for some distributed prioritized strong bisimulation 7^ forces^:. 4.17. The relation c^mi is compositional with respect to all operators except summation. PROPOSITION
The proof is by standard techniques [58] and, therefore, is omitted here. The reason for the lack of compositionality with respect to summation is illustrated by the following example: a: 0.0 :^mi « : 1.0 holds, but A : 0.0 + r : 0.0 ^^mi a : 1.0 + r : 0.0 since the former process can engage in a transition labeled by action a whereas the latter cannot. This defect can easily be repaired (note the analogy with weak bisimulation [58]) but is not important in the remainder. 4.8. Camilleri and Winskel 's approach In this section we briefly review Camilleri and WinskeFs approach to priority [24], which we refer to as CCS^^ (CCS with priority due to Camilleri and Winskel). In contrast to the
Priority in process
745
algebra
approaches considered so far, this process algebra with priority does not assign priority values to actions. Instead, there exists a special summation operator +), called prioritized choice, which favors its left argument over its right one. The syntax of CCS^^ is given by the following BNF for P. I P
::= ::=
0 0
\ XX \ yJ X
\
a.P
1^)1 I I\I 1^)1 \ I ^I IV)I \ P + P \ P\P
I / [ / ] \ I\L \ Pin \ P\L\
\ iixJ pix,P
Here, the action y, the injective, finite relabeling / , and the restriction set L satisfy the constraints mentioned in Section 4.7. Again, closed and guarded terms determine the set V^ of CCS^^ processes. Further, we introduce initial output and input action sets as depicted in Tables 20 and 21, respectively, and write ^ ^ ( P ) for P^(P) \ {r}. The semantics of a CCS^^ process is given by a labeled transition system whose transition relation possesses transitions of the form h ^ P - % P\ where M ^A. Intuitively, process P can engage in an a-transition to P' whenever the environment does not offer communications on ports in M. Despite notational differences, this is the same underlying principle as for the transition relations defined in the previous sections, which are parameterized by initial action sets. Note that a e A implies M = 0. The CCS^^ transition relation is formally defined in Table 22, where f{M) stands for {f{m) \ m € A/}. Recall that the initial actions of P '\nP-\-)Q are given preference over the initial actions of Q. As expected, a prioritized r, i.e., an internal action in which the left argument of -f) can initially engage, has pre-emptive power over unprioritized actions, i.e., actions in which the right argument of +) can initially engage. Thus, the prioritized choice operator +) in CCS^^ is evocative of the summation operator -j- in CCS^,. In [24] the operator -f- stands for nondeterministic choice where priorities arising from the left and the right argument are incomparable. This operator is matched by the distributed summation operator 0 in CCS^,. We further investigate the correspondence of these operators in the next section.
Table 20 Initial output action sets for CCS^^
'S^ia.P)
= {a}
^^(P\Q)
=
^'^(P)U^'^(Q)
"S^iPUD
=
{f{a)\ae^^{P)]
"S^iPXD
=
^^(P)\(LUL)
Table 21 Initial input action sets for CCS^'
lcw(/>+)0) = ic^(/>)uF^((2) icw(p[/]) ^ {f{y)\yel^iP)}
I'^'^iP + Q) = l^^(P)ui^((2) l^(P\L)
=
l'^(P)\iLUL)
746
R. Cleaveland et al. Table 22 Operational semantics for CCS^^
Act
Sum1
V-'^a.P^ y-'^P-^
P'
iSum2
Rel
Sum2
P'
Com1
^^P + Q- a^p, h ^ Q ^ 'Q' H^p + e -^Q'
^^-^
a^LUL
^
^
^-
r,a ^ I^(P)
^^^^ M n ^ ^ ( 0 =0 1 - ^ /^ 1(2 - ^ / " 1(2 A^n^^(P) = 0
Com2 ^-^T ^ I (2 - ^ ^ 112'
a ^ pi
H-f ^/IM,
Rec
•
h^ PM\{LUL)
^'^P+)Q- ^P' i_cw p _a
iSum1
Res
P
^[/]
JU^
/>'[/]
t-=7 /-[M^c.PA] - ^ /" P'
Com3
^ ^ /^ I (2 - ^ Z'' I <2'
Com4 ^-^ /^ I (2 - ^ ^' I (2'
Camilleri and Winskel also developed a bisimulation-based semantic theory for CCS^^. Their notion of strong bisimulation for CCS^^, as defined below, is a congruence [24]. DEFINITION 4.18. A symmetric relation TZ'OP x V is a. distributed prioritized strong bisimulation for CCS^^ if for every (P, Q) £1Z, a e A, and Af c yi the following condition holds. h57 F - ^ P '
implies
3Q\ N. h^^ Q-^Q\
N^M,
and {P\ Q') e 7^.
We write P :^cw G if (P, 2) G 7^ for some distributed prioritized strong bisimulation 1Z forCCS^^.
4.9. Relating the different approaches We show that the algebras CCS^, and CCS^^ are closely related by providing an embedding of CCS^"" in CCS^,. For this purposes we define J\f =df {0, 1 }* and the strict order < on priority values to be the lexicographical order on jV, where 1 is less than 0. We now introduce the translation function ^('):V^ -> P^, by defining §(P) =df §^(P), which maps CCS^^ terms to CCS^, terms. The functions ^^(P), for k ej\f, are inductively defined over the structure of CCS^^ processes as shown in Table 23. We note that the translation function is not surjective, e.g., consider (a : 0.0 -h ^: 2.0) -f- c: 1.0 on which no CCS^^ process is mapped. This example also shows that the notion of compositionality
Priority in process algebra
lAl
Table 23 Translation function
HHY.P)=diY-k.HHP)
HHP\Q)
=di^HP)\HHQ)
$Hfxx.P)=d\^x.^HP)
^Ha.P)=df^r(P)
in CCS^^ is more restrictive than the one in CCS^,, since a comparable summation can only be extended by summands that have a higher or a lower priority than the already considered summands. The following theorem, which is proved in [55], makes the semantic relationship between a CCS^^ process P and its embedding § (P) precise. THEOREM
4.19. LetP,Qe
7^^^. Then P 2^cw Q if and only if^(P) :^mi ^(l2).
Consequently, distributed prioritized strong bisimulation for CCS^, is also compositional with respect to summation in the sub-calculus of CCS^, induced by CCS^^.
4.10. Concluding remarks and related work A local concept of pre-emption is also considered by Hansson and Orava in [38], where CSP [44] is extended with priority by assigning natural numbers to actions. As for CCS^', they use a notion of location, and pre-emption in the calculus is sensitive to locations. Indeed, their work served as an inspiration for CCS^'. However, the authors only conjecture that their version of strong bisimulation is a congruence, and they provide neither an axiomatization for their behavioral relation nor a theory for observational congruence. One may also criticize their semantics as not truly reflecting distributed computation. In particular, despite having a local pre-emptive semantics they compute a global priority for synchronizations. After stressing the strong similarity of CCS^' to the process algebra CCS^^ in the previous section, we focus on the algebraic results established in these frameworks. In [24,48] the transition relation is directly annotated with pre-emption potentials. By using this transition relation in the definition of standard strong bisimulation one immediately obtains a congruence. In contrast, [28] starts off by defining naive distributed prioritized strong bisimulation using the naive transition relation; the potential of pre-emption is considered subsequently (by introducing the distributed prioritized initial action set condition). Then it is shown that the resulting congruence is the largest congruence in the naive equivalence. Similarly, Jensen [48] defines a naive distributed prioritized weak bisimulation based on the above-mentioned annotated transition relation. His naive weak transition relation corresponds to the distributed prioritized weak transition relation in CCS^' if the parameter M is dropped. Because of the difference in the naive transition relations the abstraction result presented here is somewhat stronger than Jensen's, although the observational congruences appear to coincide.
748
R. Cleaveland et ai
One may wonder about the relationship between CCS^' and CCS^^, i.e., the static priority and global pre-emption language of Section 3. If in CCS^' the distributed summation operator is left out and pre-emption is globalized by defining [m] =df ^oc, for all m e Hoc, the operational semantics and the behavioral relations reduce to the corresponding notions presented in Section 3. Like Camilleri and Winskel, Barrett [8] devises a semantics of Occam's priority mechanism that is additionally concerned with fairness aspects. His framework is based on a structural operational semantics augmented with ready-guard sets which model possible inputs from the environment. Intuitively, these sets characterize the nature of the contexts in which a transition is enabled. Thus, they correspond to the action sets with which the CCS^' and the CCS^^ transition relations are parameterized. Barrett is not concerned with investigating behavioral relations, but focuses instead on implementing Occam's PRIALT and PRIPAR constructs on the transputer platform. Other researchers have also extended Hoare's Communicating Sequential Processes (CSP) [44] with a concept of static priority. Inspired by the notion of priority in Ada [51], Fidge [33] introduced new versions of the operators for external choice, parallel composition by interleaving, and parallel composition by intersection. Their operational semantics favors execution of the left-hand operands, as was also done by Jensen in [48]. The semantic theory in [33] is based on failure semantics which is made sensitive to local preemption. For this purpose, traces are augmented with 2i preference function that identifies the priority relation on the initial action sets of a given process. A related approach was presented by Lowe [54]. It differs from [33] in that the underlying algebra is a timed version of CSP [31]. Additionally, Lowe aims at obtaining a fully deterministic language by employing a similar notion of priority as the one proposed by Fidge. Finally, we remark on the notions of strong and weak bisimulation for CCS^'. Since the semantic theory reflects local pre-emption, locations occur implicitly in our semantic equivalences. In contrast to work on location equivalences [18,25,63], we only indirectly consider locations for defining a suitable notion of local pre-emption potential in form of prioritized initial action sets; our objective is not to observe locations but to capture local pre-emption.
5. Dynamic priority and global pre-emption This section develops a theory in which priorities are dynamic and pre-emption is global. The motivation for this theory originated in a desire to devise a compact model of real-time computation, and we devote significant space to establishing a tight connection between the seemingly different notions of priority and real-time [10]. For this purpose we equip our language with a dynamic priority semantics based on global pre-emption and refer to it as CCS^Q (CCS with dynamic priority and global pre-emption). The connection with real-time arises when we interpret delays as priorities: the longer the delay preceding an action, the lower its priority. This approach contrasts significantly with more traditional accounts of real-time, where the only notion of pre-emption arises in the context of the maximal progress assumption [79], which states that time may only pass if the system under consideration cannot engage in any further internal computation. The main result
Priority in process algebra
749
of this section is the formalization of a one-to-one correspondence between the strongbisimulation equivalences induced by dynamic priority semantics and real-time semantics. Unlike the process algebras with priority considered so far, actions in CCS^^ have priority values that may change as systems evolve. Accordingly, we alter our point of view regarding actions and priorities by separating action names from their priority values, i.e., an action's priority is no longer implicit in its port name. In this vein, we take the set of actions A to be {a, P,...}. We also allow priority values to come from the full set N of natural numbers rather than a finite set. Our syntax of processes will then require that each action is equipped with a priority value taken from N. The structure of this section is as follows. Section 5.1 briefly presents a real-time semantics for our language, whereas the dynamic priority semantics is introduced in Section 5.2. The one-to-one correspondence between dynamic priority semantics and real-time semantics is estabhshed in Section 5.3. Finally, Section 5.4 contains our concluding remarks and discusses related work.
5.1. Real-time semantics We first define a real-time semantics, CCS'^^ for the language introduced in Section 2. CCS'^* explicitly represents timing behavior: the semantics of a process is defined by a labeled transition system that contains explicit clock transitions - each representing a delay of one time unit - as well as action transitions. With respect to clock transitions, the operational semantics is such that processes willing to communicate with some process running in parallel are able to wait until the communication partner is ready. However, as soon as it is available, the communication must occur, i.e., further idling is prohibited. This assumption is usually referred to as the maximal progress assumption [79] or the synchrony hypothesis [13]. Formally, the labeled transition system corresponding to a process P is a four-tuple (:P, ^ U {1}, i->, P), where the alphabet ^ U {1} satisfies 1 ^ A. The transition relation for actions coincides with the one for traditional CCS (cf. Table 24). The transition relation H> c 'p X {1} X 'P for clock transitions is defined in Table 25. We use y as representative Table 24 Operational semantics for CCS"^^ (action transitions) Pv^P'
Act
a:O.Ph^
P
P^Qy^
Pv^P' Rcl
P[f]J^P'
Rec
Sum1
[/]
P'
Sum2 — ^ •^— P^Qy^Q'
Res
Com2
Com3
P^^P' Com1 P\Qy^P'\Q
^ ^ ^ — P\QH^P\Q'
P[nx.P/x]h^ Hx.Pi-^
P' P'
Pv^P' P\LY^P'\L
P\Q
Ci d 1 U /
^P'\Q'
750
R, Cleaveland et ai Table 25 Operational semantics for CCS"^ (clock transitions) P[^x.P/x]\-U
tNil
tRec - ^
Oh-Uo tAct1
k >0 a:k.P\-Ua:{k-
tSum
Pv-Up'
—^
P + Q^
tAct2
\).P Qv^Q' ~ P'^Q'
tCom
tRes
P[f]^P'[f]
P'
^
aiO.PH-UfliO.P
P}-U P' tRel
— AtJC.PH-U P'
—^ P\Q^P'\Q' P ^ P\Lv-U
j
— P\Q y-^
P' P'\L
of ^ U {1}, and write P i - ^ P' instead of (P, y, P') € i->. If y G ^ we speak of an action transition, otherwise of a clock transition. Sometimes it is convenient to write P i - ^ for 3P' eV.P h-^ P\ In order to ensure maximal progress, our operational semantics is such that P h^^ whenever P i—^, i.e., clock transitions are pre-empted if P can engage in internal computation. Intuitively, process a.k.P, where k > 0, may engage in a clock transition and then behave like a:(k ~ l).P, Process a.O.P performs an of-transition to become process P. Moreover, if a ^T, it may also idle by executing a clock transition to itself. Time must proceed equally on both sides of summation, i.e., P -|- 2 can engage in a clock transition and, thus, delay the nondeterministic choice if and only if both P and Q can engage in a clock transition. Hence, time is a deterministic concept. Similar to summation, P and Q must synchronize on clock transitions according to Rule (tCom). Its side condition implements maximal progress by ensuring that there is no pending communication between P and Q. Although this condition is negative, our semantics is still well-defined [77]. A semantic theory based on the notion of bisimulation has been developed for CCS"^* (cf. [61]). For this section we restrict ourselves to {strong) temporal bisimulation, a congruence which is defined as follows. 5.1 (Temporal bisimulation). A symmetric relation 1ZC.V xV is called a temporal bisimulation if for all (P, Q) e1Z and y G ^ U {1} the following holds: P i-A- P^ implies 3Q'. Q\^ Q' and {P\ Q') e 7^. We write P -^rt Q if {P^ Q) ^^ for some temporal bisimulation 1Z. DEFINITION
Observe that CCS'^^ semantics unfolds every delay value into a sequence of elementary time units. For example, process a.k.O has k-i-2 states, namely 0 and a : 1.0, for 0 ^ I ^ k (see also Figure 6 in Section 5.3). Representing a.k.O by a single transition, which is labeled by a:k and leads to state 0, would yield labeled transition systems with fewer states. This idea of compacting the state space of real-time systems can be implemented by viewing k as priority value assigned to action a.
Priority in process algebra
751
5.2. Dynamic priority semantics We introduce CCS^^, i.e., a dynamic priority semantics for our language presented in Section 2. The notion of pre-emption incorporated in CCS^^ is similar to CCS^^, and it naturally encodes the maximal progress assumption employed in CCS*^* semantics. Formally, the CCS^^ semantics of a process P is given by a labeled transition system CP, .4 X N, ^ , P). The presentation of the operational rules for the transition relation -^ requires two auxiliary definitions. First, we introduce potential initial action sets as defined in Table 26, the actions in which a given process can potentially engage. Note that these sets are only supersets of the initial actions of processes because they do not take pre-emption into account. However, this is sufficient for our purposes regarding pre-emption, since r ^ \^^{P) if and only if ^l
= {a\l^k}
IHP\Q)
= I^CP) U 1^(0 U {r | I^(P) ni^(!2) ^ 0}
I^(P + 0
= I^(P)UI^'((2)
lHP[f])
=
I'^ilix.P)
= l^(P[ixx.P/x])
IHP\L)
= I^(P)\(LUl)
{/(a)|«Gl^(P)}
Table 27 Priority adjustment function [0]^
[x]^=dfx
[ixx.Pf
=df
[P[nx.P/x]t
ot\{l-k).P'\il>k
[otA.Pt
=df
a.O.PiU^k
[P\Qt {P\Lf
=df [^1^ 1 [0]^
=df 0,
[a-.l.Pt
=df
[P + Qf
=df
{Pf-^{Qf
[puvt
=df
[pfm
=df [^1^ \ L
752
R, Cleaveland et al Table 28 Operational semantics for CCS^9 Art1
/ "^ Z'
p
^'-^y
T-.k.P - ^ P p'
Sum1
Ti P-\-Q-^ P
Sum2
l^^iQ)
P'
^-^y
i\'^HP\Q)
P'
T
^\^^{P\Q)
(X-^^ p'
Q^ ^
Q'
,
— T
^I^HP\Q)
p'{n
pJLA^P' Res P\L-^
-—
Q'
Rel p{f] -^^^^
^—— P\Q-^^{Pf\Q' P- ^
^ T ^ \ < H P )
- ^ p
T P\Q-^^P'\[Qt
Com3
- ^
P^Q
p'
Com1
Com2
-
Act2
a:k.P-^P
Rec
P\Q-1XP'\Q'
P'\L
P[fxx.P/x]-^ D
fjLX.P
"-^
P' Of
> P
like P if Q does not pre-empt the considered transition by being able to engage in a higher prioritized internal transition. Process P \ Q denotes the parallel composition of P and Q according to an interleaving semantics with synchronized communication on complementary actions of P and Q having the same priority value k, which results in the internal action r attached with priority value k (cf. Rule (Com3)). The interleaving Rules (Com1) and (Com2) incorporate the dynamic behavior of priority values as explained in the previous paragraph. The side conditions of Rules (Com/) implement global pre-emption. The semantics for relabeling, restriction, and recursion is straightforward. As for CCS'^^ we introduce a notion of strong bisimulation, referred to as prioritized bisimulation. 5.2 {Prioritized bisimulation). A symmetric relation 1Z£V xV is called prioritized bisimulation if for every (P, Q) elZ, a £ A, and A: € N the following holds: P - ^ P' implies 3Q\ Q - ^ Q' and (P\ Q') e 7^. We write P --dg Q if there exists a prioritized bisimulation H such that (P, 2) G H. DEFINITION
5.3. Relating dynamic priority and real-time semantics We show that CCS^^ and CCS"^^ semantics are closely related. The underlying intuition is best illustrated by a simple example dealing with the prefixing operator. Figure 6 depicts the dynamic priority semantics and real-time semantics of process a.k.f^. Both transition systems intuitively reflect that process a.k.^ must delay at least k time units before it may engage in the tsf-transition. According to CCS*^* semantics, this process consecutively engages in k clock transitions passing the states a:{k — /).0, for 0 ^ / ^ /:, before it may either continue idling in state a : 0.0 or perform the (^-transition to inaction process 0. Thus,
Priority in process algebra dynamic-priority semantics
753 real-time semantics
a:k.O
a:k.O
'1 'I
a:(k-l).0 a:(k+i)
a:b.OC)'
1
0
oO'
Fig. 6. Relating CCS^9 semantics and CCS''^ semantics.
time is explicitly part of states and made visible by clock transitions, each representing a step consuming one time unit. In contrast, the dynamic priority semantics encodes the delay of at least k time units in the transitions rather than in the states. Hence, it possesses only the two states a.k.O and 0 connected via transitions labeled by a: I, for I ^ k. Although at first sight it seems that the price for saving intermediate states is to be forced to deal with infinite-branching, an upper bound for / can be given. In our example this upper bound is k itself, since a delay by more than k time units only results in idhng and does not enable new or disable existing system behavior. Therefore, the dynamic priority transition system of aik.Q just consists of the two states a.k.O and 0 and a symbolic transition labeled by a:k, whereas the real-time transition system has A: H- 2 states and k-\-2 transitions. The following proposition formally states that CCS^^ semantics can indeed be understood as an efficient encoding of CCS"^^ semantics. Here, i—>^ denotes k consecutive clock transitions. PROPOSITION ^p"
5.3. Let P,P' eV,
p I ^ yk prr j Qf^
a € A, and k en.
Then P - ^
P' if and only if
p,
Proposition 5.3 is the key to prove the main result of this section. THEOREM
5.4. Ut P,Qe
V. Then P -dg Q if and only if P --rt Q-
Consequently, prioritized and temporal bisimulation possess the same properties; in particular, prioritized bisimulation is a congruence for CCS^^. Proof details can be found in [16]. 5.4. Concluding remarks and related work As shown above, real-time semantics can be encoded by dynamic priority semantics. The utihty of this encoding stems from the fact that the state space of CCS^^ models is much
754
R. Cleaveland et al
smaller and the size of the transition relation is at least not worse, but in practice often better, than the one of corresponding CCS"^^ models. This has been demonstrated by formally modehng and verifying several aspects of the widely-used SCSI-2 bus-protocol, for which the state space of the dynamic priority model is almost an order of magnitude smaller than the one resulting from traditional real-time semantics [16]. Regarding related work, a similar approach to the one presented above has been investigated by Jeffrey [47]. He established a formal relationship between a quantitative real-time process algebra and a process algebra with static priority which is very similar to CCS^^ introduced in Section 3. Jeffrey also translates real-time to priority based on the idea of time-stamping. In contrast to CCS"^^ semantics, however, a process modeled in Jeffrey's framework may either immediately engage in an action transition or idle forever. This semantics does not allow a process to wait until a communication partner becomes available, but instead forces a "livelock" in such situations. It is only because of this design decision that Jeffrey does not need to choose a dynamic priority framework. In [22] a variant of CCSR [23], called CCSR92, has been introduced, which allows for the modehng of not only static priority but also dynamic priority. The main focus of CCSR involves the specification and verification of real-time concurrent systems including scheduling behavior. Thus, a notion of dynamic priority, as applied in priority-inheritance and earliest-deadline-first scheduling algorithms, is important. In [22] dynamic priorities are given as a function of the history of the system under consideration. Accordingly, the operational semantics of CCSR92 is re-defined to include the historical context. The authors show that dynamic priorities do, in general, not lead to a compositional semantics and give a sufficient condition that ensures compositionality. 6. Priority in other process-algebraic frameworks This section completes the discussion of related work by focusing on approaches to priority which either do not fit in our classification scheme presented in Section 1, such as approaches for ACP [5], SCCS [73], and stochastic [11,43] or probabilistic [49,74,76] process algebras, or are concerned with process-algebraic descriptions of non-processalgebraic languages, such as Esterel [12,13] and Statecharts [39]. Baeten, Bergstra, and Klop were the first researchers who investigated priority in process algebras [5] by developing a notion of priority in the Algebra of Communicating Processes (ACP) [9]. Their work is inspired by the insight that it is essential to incorporate an interrupt mechanism in process-algebraic frameworks, as it enhances their expressive power as specification and verification formalisms for concurrent systems. Therefore, a new unary operator 0 together with semantics-defining equations is introduced in [5]. The definition of 0 is based on a given partial order < on actions. Intuitively, OiP) is the context of P in which action a has precedence over action b, whenever /? < «, i.e., nondeterministic choices between actions a and b are resolved within 0(P). Technically, the axiomatic semantics of the new language, notated as a term rewrite system, is shown to possess nice algebraic properties such as confluence and termination. The utility of the theory is demonstrated by simple examples dealing with interrupts, timeouts, and other aspects of system behavior. The approach in [5] differs from most other work presented in this chapter in that
Priority in process algebra
755
the partial order expressing priorities is fixed with respect to the system under consideration, i.e., the same priority relation holds at all states of the system. For example, if a < b at some state of the system, then a > b cannot be valid at another state, i.e., priorities in [5] are not globally dynamic in the sense of [73]. It should also be mentioned that the version of ACP used in [5] does not include a designated internal action, cf. action r in CCS; a fact which simplifies the development of algebraic theories. Stochastic process algebras [11,43], which enhance the expressiveness of classical process algebras by integrating performance descriptions of concurrent systems, also define notions of priority. One example of a popular stochastic process algebra is the Extended Markovian Process Algebra (EMPA) [11] whose semantics is given in terms of strong bisimulation and whose static priority approach is adapted from CCS^^. Smolka and Steffen [73] have introduced static priority to the Synchronous Calculus of Communicating Systems (SCCS) [58]. They extended a probabilistic version of this language, known as PCCS [76], whose semantics is given in terms of probabilistic bisimulation. Their work shows that the concept of priority is not only related to real-time, as investigated in Section 5, but also to probability. The idea in [73] is to allow probability guards of value 0 to be associated with alternatives of a probabilistic summation. Such alternatives can be chosen only if the non-zero alternatives are precluded by contextual constraints. Thus, priority may be viewed as an extreme case of probability. Tofts has investigated another extension of SCCS, the Weighted Synchronous Calculus of Communicating Systems (WSCCS) [74]. Its semantics rehes upon a notion of relative frequency that is suitable for specifying and reasoning about aspects of priority, probability, and time in concurrent systems. In this approach, priority is encoded by means of higher ordinals; a transition has priority over another if their weights are separated at least by a factor of co. An operator similar to the ^-operator in [5] is defined, which extracts the highest priority transitions enabled at a process state by referring to a global notion of pre-emption. In contrast to [5], Toft's operator allows for different priority structures at different states. His concept of priority yields a simpler operational semantics than the one in [73], but a more complicated definition of bisimulation. For WSCCS, a congruence adapted from strong bisimulation together with an equational characterization, which is sound and complete for finite processes, has been developed. The concept of pre-emption has also been studied by Berry in EstereVs zero-delay process calculus [12], a theoretical version of the Esterel synchronous programming language [13]. The calculus' semantics, which obeys maximal progress [79], interprets processes as deterministic mappings from input sequences to output sequences. Berry emphasizes the importance of pre-emption in control-dominated reactive and real-time programming. He suggests that pre-emption operators be considered as first-class operators that are fully orthogonal with respect to all other primitives, such as concurrency and communication. This is in contrast to the approach chosen in this chapter, in which pre-emption is implicitly encoded as side conditions of operational rules involving nondeterminism. Several examples of useful pre-emption operators are presented and axiomatized in [12], all of which are based on the ideas of abortion and suspension. The specification language Statecharts [39], for which process-algebraic descriptions of its semantics have been developed [53,56,75], extends communicating finite automata by concepts of hierarchy, concurrency, and priority. In Statecharts static priorities can be
756
R. Cleaveland et al.
expressed via the absence of actions, which are called events, by permitting negated actions as guards, which are referred to as triggers. As an example, consider the Statecharts-hke term a:b. P-\-~>b:c. Q consisting of a nondeterministic choice between a Z7-transition with guard a to process P, and a c-transition with guard -«Z? to Q. Intuitively, the Statechart may only engage in the latter transition if it cannot execute the former one. The reason is that the former transition produces event b which falsifies the guard of the c-transition. Thus, the /7-transition is given precedence over the c-transition. Approaches to priority based on negated events (cf. [37]) do not go well with the concept of hiding, which is employed in many process algebras and also in an alternative language to Statecharts called Argos [57]. Hiding enables one to relabel a visible action into a distinguished invisible action. The difficulty with hiding arises when several events are hidden, i.e., all of them are relabeled to the same event and, thus, have the same implicit priority value attached to them. Hence, hiding may destroy priority schemes. In contrast, in the priority approaches considered in this chapter priorities are assigned to transitions, thereby allowing for a more fine-granular priority mechanism and avoiding the above-mentioned problem.
7. Conclusions and directions for future work This chapter investigated various aspects of priority in process algebra. The utility of introducing priority to traditional process algebras is to enhance their expressiveness and, thereby, making them more attractive to system designers. In a nutshell, priorities allow one to resolve potential nondeterminism. Conclusions. We illustrated the most important aspects of priority in a prototypic language that extends Milner's CCS. This language was equipped with several semantics according to whether priorities are static or dynamic and whether the adopted notion of pre-emption is global or local. In practice it is easy to determine when to use static priority semantics and when to use dynamic priority semantics. For modeling interrupts and prioritized choice constructs a static notion of priority is adequate, whereas for modeling real-time or scheduling behavior, dynamic priorities should be considered. However, static priority approaches also allow for the description of simple scheduling algorithms, as shown in [48] in the presence of a prioritized parallel composition operator. The dynamic priority approach yields a more efficient verification of real-time systems, since the sizes of system models with respect to dynamic priority semantics are often significantly smaller than the ones regarding real-time semantics [16]. If one needs to deal with both interrupt and real-time aspects at the same time, static and dynamic priority approaches should be combined. In this situation each action could be assigned two priority values, the first interpreted as a global priority value for scheduling purposes, and the second interpreted as a local priority value for modeling interrupts, where the first priority value has more weight than the second one. Suitable guidelines for choosing between a global or a local notion of pre-emption are the following. A semantics obeying global pre-emption is favorable when modeling interrupts and prioritized-choice constructs in concurrent, centralized systems or when specifying real-time and scheduling aspects. Global pre-emption also provides a simple means
Priority in process algebra
757
for enforcing that action sequences are executed atomically. This supports the accurate modeling of certain system behavior and, moreover, helps one to keep system models small [29]. However, when dealing with interrupts or prioritized-choice constructs within distributed systems, the concept of global pre-emption is inadequate. Here, the use of local pre-emption does not only lead to an intuitive but also to an implementable semantics, since it does not require any knowledge about computations that are internal to other, potentially unknown sites (cf. [27]). In this chapter we equipped the three calculi presented in Sections 3-5 with a bisimulation-based semantics. The re-development of the semantic theory of CCS for the static priority calculi included: (i) characterizations of the largest congruences contained in the naive adaptations of the standard strong and weak bisimulations, (ii) encodings of the new behavioral relations as standard strong bisimulations on enriched transition relations, and (iii) axiomatic characterizations of the prioritized strong bisimulations for the class of finite processes. For the dynamic priority calculus, strong bisimulation served as a semantic tool for establishing a one-to-one correspondence between dynamic priority and real-time semantics. We want to point out that the semantic theories presented here show that extensions of process algebras by priority do not need to sacrifice the simplicity and the elegance that have made traditional process-algebraic approaches successful. This chapter also surveyed related approaches to priority which are concerned with process-algebraic calculi other than CCS and its derivatives. We have classified them according to whether priorities are considered to be static or dynamic and whether their concept of pre-emption is global or local. The concept of priority has also been investigated in other concurrency frameworks, most notably in Petri Nets [14,72]. In this setting priorities are either expressed explicitly by priority relations over transitions [15] or implicitly via inhibitor arcs [46]. Finally, it should be mentioned that priorities can implicitly arise when studying causality for mobile processes (see, e.g., [32]). In these approaches, priorities eliminate superfluous paths that only present new temporal but not causal system dependencies. Future work. In addition to the fact that a calculus combining dynamic priority and local pre-emption has not yet been developed, the semantic theories for CCS^^ and CCS^' need to be completed by axiomatizing their observational congruences. Forfiniteprocesses, one should be able to establish these axiomatizations using standard techniques [59]. However, for regular processes - i.e., the class of finite-state processes that do not contain recursion through static operators - it is not clear how to obtain a completeness result. The point is that existing methods for proving completeness of axiomatizations with respect to observational congruences rely on the possibility to remove or to insert r-cycles in processes. In the context of pre-emption, however, this would possibly change the pre-emption potential of processes and, thus, is semantically incompatible with the prioritized observational congruences presented here. Recently, a similar problem, which was identified for the temporal process algebra PMC [2] before, has been attacked in [42] and in [20] for a different, more classical process-algebraic setting in which only a single visible unprioritized action
758
R. Cleaveland et al.
exists. It remains to be seen whether the techniques used in these papers can be employed for the priority settings investigated in this chapter. Most process algebras that have been equipped with a notion of priority rely on an interleaving semantics, handshake communication, and a semantic theory based on bisimulation. Therefore, it should be investigated how the approaches and results presented here can be adapted to broadcasting calculi, such as Hoare's CSP [44]. Moreover, since for semantics based on local pre-emption the usual interleaving law is not valid, it is worth pursuing research regarding local pre-emption for non-interleaving semantic frameworks [4,78]. Preliminary considerations have been made in Jensen's thesis [48]. However, the insights obtained by Jensen are restricted to a structural operational semantics for a CCS-based calculus, which is defined using asynchronous transition systems [78]. Jensen's results do not involve a behavioral relation such as bisimulation (cf. [63]). Finally, we want to note that - to the best of our knowledge - extensions of higher-order process algebras [60,68] with concepts of priority do not yet exist. Thus, it would be interesting to see if some of the approaches presented here can be carried over. 8. Sources and acknowledgments Major parts of this chapter have been adapted from several publications by the authors, which include two PhD theses: the results of Section 3 are taken from [26,55,64,65] and the ones of Section 4 from [28,55]; Section 5 heavily borrows from material contained in [16,55]. This work was supported by the National Aeronautics and Space Administration under NASA Contract No. NASI-97046 while the second author was in residence at the Institute for Computer Applications in Science and Engineering (ICASE), MS 132C, NASA Langley Research Center, Hampton, Virginia 23681-2199, USA. The first author acknowledges support by NSF grants CCR-9257963, CCR-9505662, CCR-9804091, and INT-9603441, AFOSR grant F49620-95-1-0508, and ARO grant P-38682-MA. Last but not least we would like to thank Girish Bhat, Matthew Hennessy, Michael Mendler, and Bemhard Steffen for many discussions about priority in process algebras, as well as Scott Smolka for carefully proofreading a draft of this chapter. 9. Glossary The following table lists notation and symbols used in this chapter and is organized according to the chapter's sections. Notation introduced in Section 2 CCS Calculus of Communicating Systems Af finite initial interval of N A, port name Ak ports with priority k (receiving) kk.'k'.k representative of Ak Ak complementary ports with priority k (sending)
Priority in process algebra Xk,^'-k Tk,T:k
Ak A 'A a:k,b:k,...
A a:k,p:k,... A a A a
s,y L
f
V X
V P,Q,R,... C[X] 0 a :k.
+ 1
[/] \L flX.P,
= IZ'^
X = P
representative oi Ak invisible, internal action with priority k set of actions with priority k set of (receiving or input) ports set of complementary (i.e., sending or output) ports representatives oi A\J A set of actions representatives of A set of unprioritized actions (i.e., AQ in 2-level priority-scheme) representative of A set of prioritized actions (i.e., A\ in 2-level priority-scheme) representative of >4 representatives oi AKJ A subset of yl U yi (restriction set) finite relabeling set of variables representative of V set of processes representatives of V representative of a context nil process prefix operator nondeterministic choice operator parallel-composition operator relabeling operator restriction operator recursion syntactic equality largest congruence contained in equivalence IZ
Notation for static priority and global pre-emption (cf. Section 3) CCS^9 J(P) T^{P) y.
CCS with static priority and global pre-emption prioritized initial action set of P visible prioritized initial action set of P (i.e., X(P) \ [T}) (standard) transition relation parameterized transition relation naive prioritized weak transition relation prioritized weak transition relation alternative prioritized weak transition relation prioritized strong bisimulation naive prioritized weak bisimulation
759
760
R. Cleaveland et al. ~ ~^ ~* ^pj ^L [• L• h ^j
prioritized weak bisimulation prioritized observational congruence alternative prioritized weak bisimulation extended prioritized weak bisimulation extended prioritized observational congruence prioritization operator deprioritization operator axiomatic derivation auxiliary pre-congruence for axiomatization
Notation for static priority and local pre-emption (cf. Section 4) CCS^' .4addr Addr • Coc m,n,o x 0 l-£ \\ X^ (P) I_f^{P) T{P) 'MiP) ^yv^(P) m,a
a L ' q_^
parameterized transition relation
m,o(
X •>
a — = - r\ ^ ,
CCS with static priority and local pre-emption address alphabet {L,/?,/, r} set of addresses address pointing to current process term set of transition locations representatives of Coc location comparability relation distributed-summation operator axiomatic derivation auxiliary predicate for axiomatization distributed prioritized initial action set of P with respect to location m ... with respect to locations m e M distributed prioritized initial action set of P visible distributed prioritized initial action set of P ... with respect to locations m eM (i.e., Z.M^^) \ (l))
'
m,a. ••
TJVT
^ X
naive distributed prioritized weak transition relation distributed prioritized weak transition relation naive distributed prioritized strong bisimulation distributed prioritized strong bisimulation alternative distributed prioritized strong bisimulation naive distributed prioritized weak bisimulation distributed prioritized weak bisimulation distributed prioritized observational congruence alternative distributed prioritized weak bisimulation
Notation for CCS^, {cf Section 4.7) CCS^i A
CCS^' with a multi-level priority-scheme set of input ports
Priority in process algebra
761
a,b,... y A a,b,... A a V^^
representatives of A representative of 71 U {r} set of output ports representatives of A set of actions (i.e., A =df AU representative of A set of CCS^i processes
-^^^ 1I{P) T[{P) I^ (P) 1^{P), ^^{P) \{P) I(P) :^mi
transition relation for CCS^' visible unprioritized initial actions of P initial output action set for P initial input action set for P wrt. priority k and location m variants of initial input action sets initial input action set of P initial visible input action set of P (i.e., I(P) \ {r}) distributed prioritized strong bisimulation for CCS^,
AU{T})
Notation for CCS^'' {cf. Section 4.8) CCS^^ +) P^^ h^ -%
CCS with priority due to Camilleri and Winskel prioritized-choice operator set of CCS^^ processes transition relation for CCS^^
II (P) P^(P) r^(P) :^cw $ (•)
initial output action set for P initial input action set for P initial visible input action set for P (i.e., P^(P) \ {r}) distributed prioritized strong bisimulation for CCS^^ translation function
Notation for dynamic priority and global pre-emption (cf Section 5) CCS^9 A a, p,... 1 y 1
l^(P) ^rt ^dg [P]^
CCS with dynamic priority and global pre-emption set of actions representatives of A clock tick (i.e., one time unit) representative of ^ U {1} transition relation for action transitions transition relation for clock transitions transition relation for dynamic priorities potential initial action sets for CCS^^ with respect to P and priority k temporal bisimulation prioritized bisimulation priority adjustment function
762
R. Cleaveland et ai
References [1] L. Aceto, W. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [2] H.R. Andersen and M. Mendler, Complete axiomatization of observational congruence for PMC, Technical Report ID-TR: 1993-126, Department of Computer Science, Technical University of Denmark, Lyngby, Denmark (1993). [3] J.C.M. Baeten, ed.. Applications of Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 17, Cambridge University Press (1990). [4] J.C.M. Baeten and T. Basten, Partial-order process algebra {and its relation to Petri nets). Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 769-872. [5] J.C.M. Baeten, J.A. Bergstra and J.W. Klop, Syntax and defining equations for an interrupt mechanism in process algebra, Fundamenta Informaticae IX (1986), 127-168. [6] J.C.M. Baeten and J.W. Klop, eds, 1st International Conference on Concurrency Theory (CONCUR '90), Amsterdam, The Netherlands, Lecture Notes in Comput. Sci. 458, Springer-Veriag (1990). [7] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 18, Cambridge University Press (1990). [8] G. Barrett, The semantics of priority and fairness in occam, 5th International Conference on Mathematical Foundations of Programming Semantics (MFPS '89), New Orleans, Lousiana, Lecture Notes in Comput. Sci. 442, M. Main, A. Melton, M. Mislove and D. Schmidt, eds. Springer-Veriag (1989), 194^208. [9] J.A. Bergstra and J.W. Klop, Algebra of communicating processes with abstraction, Theoret. Comput. Sci. 37(1) (1985), 77-121. [10] J.A. Bergstra, C.A. Middelburg and Y.S. Usenko, Discrete time process algebra and the semantics of SDL, This volume. [11] M. Bernardo and R. Gorrieri, A tutorial on EMPA: A theory of concurrent processes with nondeterminism, priorities, probabilities and time, Theoret. Comput. Sci. 202 (1-2) (1998), 1-54. [12] G. Berry, Preemption in concurrent systems, 13the International Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS '93), Bombay, India, Lecture Notes in Comput. Sci. 761, R.K. Shyamasundar, ed.. Springer-Veriag (1993), 72-93. [13] G. Berry and G. Gonthier, The ESTEREL synchronous programming language: Design, semantics, implementation, Sci. Comput. Programming 19 (2) (1992), 87-152. [14] E. Best, R. Devillers and M. Koutny, A unified model for nets and process algebras. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 873-944. [15] E. Best and M. Koutny, Petri net semantics of priority systems, Theoret. Comput. Sci. 96 (1) (1992), 175215. [16] G. Bhat, R. Cleaveland and G. Liittgen, A practical approach to implementing real-time semantics. Annals of Software Engineering (Special issue on Real-time Software Engineering) 7 (1999), 127-155. [17] T. Bolognesi and E. Brinksma, Introduction to the ISO specification language LOTOS, Computer Networks and ISDN Systems 14 (1987), 25-59. [18] G. Boudol, I. Castellani, M. Hennessy and A. Kiehn, Obsening localities, Theoret. Comput. Sci. 114 (1) (1993), 31-61. [19] J. Bradfield and C. Stirling, Modal logics and mu-calculi: An introduction. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 293-330. [20] M. Bravetti and R. Gorrieri, A complete axiomatization for obsen'ational congruence of prioritized finitestate behaviors, 27th International Colloquium on Automata, Languages and Programming (ICALP 2(X)0), Geneva, Switzerland, Lecture Notes in Comput. Sci. 1853, U. Montanari, J. Rolim, E. Welzl, eds, SpringerVerlag (2000), 744-755. [21] P. Bremond-Gregoire, J.-Y. Choi and I. Lee, A complete axiomatization of finite-state ACSR processes. Inform, and Comput. 138 (2) (1997), 124-159. [22] P. Bremond-Gregoire, S. Davidson and I. Lee, CCSR92: Calculus for communicating shared resources with dynamic priorities. First North American Process Algebra Workshop (NAPAW '92), Stony Brook, New York, Workshops in Computing, P. Purushothaman and A. Zwarico, eds. Springer-Veriag (1992), 65-85. [23] P. Bremond-Gregoire, I. Lee and R. Gerber, A process algebra of communicating shared resources with dense time and priorities, Theoret. Comput. Sci. 189 (1/2) (1997), 179-219.
Priority in process algebra
763
[24] J. Camilleri and G. Winskel, CCS with priority choice. Inform, and Comput. 116 (1) (1995), 26-37. [25] I. Castellani, Process algebras with localities. Handbook of Process Algebra, J. A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 945-1045. [26] R. Cleaveland and M.C.B. Hennessy, Priorities in process algebras. Inform, and Comput. 87 (1/2) (1990), 58-77. [27] R. Cleaveland, G. Liittgen and M. Mendler, An algebraic theory of multiple clocks, 8th International Conference on Concurrency Theory (CONCUR '97), Warsaw, Poland, Lecture Notes in Comput. Sci. 1243, A. Mazurkiewicz and J. Winkowski, eds. Springer-Verlag (1997), 166-180, [28] R. Cleaveland, G. Liittgen and V. Natarajan, A process algebra with distributed priorities, Theoret. Comput. Sci. 195 (2) (1998), 227-258. [29] R. Cleaveland, V. Natarajan, S. Sims and G. Liittgen, Modeling and verifying distributed systems using priorities: A case study. Software - Concepts and Tools 17 (2) (1996), 50-62. [30] R. Cleaveland and O. Sokolsky, Equivalence and pre order checking for finite-state systems. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 391^24. [31] J. Davies and S. Schneider, A brief history of Timed CSP, Theoret. Comput. Sci. 138 (2) (1995), 243-271. [32] P. Degano and C. Priami, Causality of mobile processes. International Conference on Automata, Languages and Programming (ICALP '95), Szeged, Hungary, Lecture Notes in Comput. Sci. 944, Z. Fulop and P. Gecseg, eds. Springer-Verlag (1995), 660-671. [33] C.J. Fidge, A formal definition of priority in CSP, ACM Transactions on Programming Languages and Systems 15 (4) (1993), 681-705. [34] N. Francez, Fairness, Springer-Verlag (1986). [35] R. Gerber and I. Lee, CCSR: A calculus for communicating shared resources. Applications of Process Algebra, Cambridge Tracts in Theoretical Comput. Sci. 17, J.C.M. Baeten, ed., Cambridge University Press (1990), 263-277. [36] R. Gerber and I. Lee, A resourced-basedprioritized bisimulation for real-time systems. Inform, and Comput. 113(1) (1994), 102-142. [37] S.M. German, Programming in a general model of synchronization, 3rd International Conference on Concurrency Theory (CONCUR '92), Stony Brook, NY, Lecture Notes in Comput. Sci. 549, R. Cleaveland, ed.. Springer-Verlag (1992), 534-549. [38] H. Hansson and F. Orava, A process calculus with incomparable priorities. First North American Process Algebra Workshop (NAPAW '92), Stony Brook, New York, Workshops in Computing, P. Purushothaman and A. Zwarico, eds. Springer-Verlag (1992), 43-64. [39] D. Harel, Statecharts: A visual formalism for complex systems, Sci. Comput. Programming 8 (1987), 231274. [40] M.C.B. Hennessy, An algebraic theory offair asynchronous communicating processes, Theoret. Comput. Sci. 49 (1987), 121-143. [41] M.C.B. Hennessy, Algebraic Theory of Processes, MIT Press (1988). [42] H. Hermanns and M. Lohrey, Priority and maximal progress are completely axiomatisable, 9th International Conference on Concurrency Theory (CONCUR '98), Nice, France, Lecture Notes in Comput. Sci. 1466, D. Sangiorgi and R. de Simone, eds. Springer-Verlag (1998), 237-252. [43] H. Hermanns, M. Rettelbach and T. WeiB, Formal characterisation of immediate actions in SPA with nondeterministic branching, Comput. J. 38 (7) (1995), 530-541. [44] C.A.R. Hoare, Communicating Sequential Processes, Prentice Hall (1985). [45] INMOS Limited, Occam Programming Manual, International Series in Computer Science, Prentice Hall (1984). [46] R. Janicki and M. Koutny, Semantics of inhibitor nets. Inform, and Comput. 123 (1) (1995), 1-17. [47] A. Jeffrey, Translating timed process algebra into prioritized process algebra. Symposium on Real-Time and Fault-Tolerant Systems (FTRTFT '92), Lecture Notes in Comput. Sci. 571, J. Vytopil, ed., SpringerVerlag (1992), 493-506. [48] C.-T. Jensen, Prioritized and independent actions in distributed computer systems, Ph.D. Thesis, Aarhus University, Denmark (1994). [49] B. Jonsson, W. Yi and K.G. Larsen, Probabilistic extensions of process algebras. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 685-710.
764
R. Cleaveland et ai
[50] P.C. Kanellakis and S.A. Smolka, CCS expressions, finite state processes, and three problems of equivalence. Inform, and Comput. 86 (1) (1990), 43-68. [51] Kempe Software Capital Enterprises, Ada95 reference manual: Language and standard libraries (1995). Available at http://www.adahome.com. [52] L. Lamport, What it means for a concurrent program to satisfy a specification: Why no one has specified priority, 12th Annual ACM Symposium on Principles of Programming Languages (POPL '85), New York, IEEE Computer Society Press (1985), 78-83. [53] F. Levi, verification of temporal and real-time properties of Statecharts, Ph.D. Thesis, University of PisaGenova-Udine, Pisa, Italy (1997). [54] G. Lowe, Probabilistic and prioritized models of timed CSP, Theoret. Comput. Sci. 138 (2) (1995), 315352. [55] G. Luttgen, Pre-emptive modeling of concurrent and distributed systems, Ph.D. Thesis, University of Passau, Germany, Shaker-Verlag (1998). [56] G. Luttgen, M. von der Beeck and R. Cleaveland, Statecharts via process algebra, 10th International Conference on Concurrency Theory (CONCUR '99), Eindhoven, The Netherlands, Lecture Notes in Comput. Sci. 1664, J.C.M. Baeten and S. Mauw, eds. Springer-Verlag (1999) 399-414. [57] F. Maraninchi, The ARGOS language: Graphical representation of automata and description of reactive systems, 1991 IEEE Workshop on Visual Languages, Los Alamitos, California, IEEE Computer Society Press (1991). [58] R. Milner, Communication and Concurrency, Prentice Hall (1989). [59] R. Milner, A complete axiomatisation for observational congruence of finite-state behaviours. Inform, and Comput. 81 (2) (1989), 227-247. [60] R. Milner, J. Parrow and D. Walker, A calculus of mobile processes, parts I and II, Inform, and Comput. 100(1) (1992), 1-77. [61] F. Moller and C. Tofts, A temporal calculus of communicating systems. Applications of Process Algebra, Cambridge Tracts in Theoretical Comput. Sci. 17, J.C.M. Baeten, ed., Cambridge University Press (1990), 401^15. [62] U. Montanari and D. Yankelevich, Location equivalence in a parametric setting, Theoret. Comput. Sci. 149 (2) (1995), 299-332. [63] M. Mukund and M. Nielsen, CCS, locations and asynchronous transition systems, 12th International Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS '92), New Delhi, India, Lecture Notes in Comput. Sci. 652, R.K. Shyamasundar, ed.. Springer-Verlag (1992), 328341. [64] V. Natarajan, Degrees of delay: Semantic theories for priority, efficiency, fairness, and predictability in process algebras, Ph.D. Thesis, North Carolina State University, Raleigh, North Carolina (1996). [65] V. Natarajan, L. Christoff, I. Christoff and R. Cleaveland, Priorities and abstraction in process algebra, 14th International Conference on Foundations of Software Technology and Theoretical Computer Science (FSTTCS '94), Madras, India, Lecture Notes in Comput. Sci. 880, PS. Thiagarajan, ed.. Springer-Verlag (1994), 217-230. [66] R. Paige and R.E. Taijan, Three partition refinement algorithms, SIAM J. Comput. 16 (6) (1987), 973-989. [67] D.M.R. Park, Concurrency and automata on infinite sequences, 5th GI Conference on Theoretical Computer Science, Lecture Notes in Comput. Sci. 104, P. Deussen, ed.. Springer-Verlag (1981), 167-183. [68] J. Parrow, An introduction to the n-calculus. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 479-543. [69] G.D. Plotkin, A structural approach to operational semantics. Technical Report DAIMI-FN-19, Computer Science Department, Aarhus University, Denmark (1981). [70] K.V.S. Prasad, Programming with broadcasts, 4th International Conference on Concurrency Theory (CONCUR '93), Hildesheim, Germany, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer-Verlag (1993), 173-187. [71] K.V.S. Prasad, Broadcasting with priority, 5th European Symposium on Programming (ESOP '94), Edinburgh, United Kingdom, Lecture Notes in Comput. Sci. 788, D. Sannella, ed.. Springer-Verlag (1994), 469-484. [72] W Reisig, Petri Nets: An Introduction, Springer-Verlag (1985).
Priority in process
algebra
765
[73] S.A. Smolka and B. Steffen, Priority as extremal probability. Formal Aspects of Computing 8 (5) (1996), 585-606. [74] C. Tofts, Processes with probabilities, priority and time. Formal Aspects of Computing 6 (5) (1994), 536564. [75] A.C. Uselton and S.A. Smolka, A compositional semantics for Statecharts using labeled transition systems, 5th International Conference on Concurrency Theory (CONCUR '94), Uppsala, Sweden, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer-Verlag (1994), 2-17. [76] R. van Glabbeek, S.A. Smolka and B. Steffen, Reactive, generative, and stratified models of probabilistic processes. Inform, and Comput. 121 (1) (1995), 59-80. [77] C. Verhoef, A congruence theorem for structured operational semantics with predicates and negative premises, Nordic J. Comput. 2 (2) (1995), 274-302. [78] G. Winskel and M. Nielsen, Models for concurrency. Handbook of Logic in Computer Science, Vol. 4, S. Abramsky, D.M. Gabbay and TS.E. Maibaum, eds, Oxford Science Publications (1995), 1-148. [79] W. Yi, CCS + time = an interleaving model for real time systems, 18th International Colloquium on Automata, Languages and Programming (ICALP '91), Madrid, Spain, Lecture Notes in Comput. Sci. 510, J. Leach Albert, B. Monien and M. Rodriguez-Artalejo, eds. Springer-Verlag (1991), 217-228.
Subject index action transition, 749 axiomatization of distributed prioritized strong bisimulation, 735 axiomatization of prioritized observational congruence, 728 axiomatization of prioritized strong bisimulation, 720 clock transition, 749 deprioritization operator, 725 distributed summation operator, 735 interrupt, 713 interrupt port, 713 largest congruence of distributed prioritized observational congruence, 739 largest congruence of distributed prioritized strong bisimulation, 734 largest congruence of prioritized observational congruence, 722, 729 location, 730
location comparabihty relation, 732 maximal progress assumption, 748 may pre-emption, 714 must pre-emption, 714 pre-emption, 713 pre-emption potential, 722 prioritization operator, 725 prioritized action, 717 prioritized choice, 714 prioritized strong bisimulation, 718 priority scheme, 716 priority semantics, 751 real-time, 713, 748 real-time semantics, 749 static priority, 714 synchrony hypothesis, 713 unprioritized action, 717
This Page Intentionally Left Blank
Parts Non-Interleaving Process Algebra
This Page Intentionally Left Blank
CHAPTER 13
Partial-Order Process Algebra (and its Relation to Petri Nets) J.C.M. Baeten', T. Basten^* ^Department of Computing Science, Eindhoven University of Technology, PO Box 513, NL-5600 MB, The Netherlands E-mail: josb @ win. tue. nl ^Department of Electrical Engineering, Eindhoven University of Technology, PO Box 513, NL-5600 MB, The Netherlands E-mail: tbasten @ ics. ele. tue.nl
Contents 1. 2. 3. 4. 5.
6.
7. 8.
9.
Introduction Notation Process theory Labeled Place/Transition nets Process algebra 5.1. The equational theory 5.2. A semantics for the equational theory 5.3. A total-order semantics 5.4. A step semantics 5.5. Concluding remarks The causal state operator 6.1. The equational theory 6.2. A semantics 6.3. An algebraic semantics for labeled P/Tnets 6.4. Concluding remarks Intermezzo on renaming and communication functions Modular P/T nets 8.1. Place fusion 8.2. Transition fusion 8.3. Concluding remarks Cause addition 9.1. The equational theory 9.2. A semantics
771 773 774 778 783 783 793 801 804 808 809 809 814 815 818 818 820 820 828 830 831 831 832
*Part of this work was done while the author was employed at the Department of Computing Science, Eindhoven University of Technology, The Netherlands. HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
769
770
J.C.M. Baeten, T Basten
9.3. Buffers 9.4. Cause addition and sequential composition 9.5. Concluding remarks 10. A non-interleaving process algebra 10.1. The algebra of non-terminating serializable processes 10.2. A brief discussion on causality 10.3. Elimination of choice, sequential composition, and communication 10.4. Concluding remarks 11. Conclusions References Subject index
833 836 842 842 843 852 853 865 866 867 870
Abstract To date, many different formalisms exist for describing and analyzing the behavior of concurrent systems. Petri nets and process algebras are two well-known classes of such formalisms. Petri-net theory is well suited for reasoning about concurrent systems in a partialorder framework; it handles causal relationships between actions of concurrent systems in an explicit way. Process algebras, on the other hand, often provide a total-order framework, which means that information about causalities is not always accurate. This chapter illustrates how to develop a partial-order process algebra in the style of AGP. It is shown how to extend such an algebraic theory with a causality mechanism inspired by Petri-net theory. In addition, the chapter clarifies the concepts of interleaving and non-interleaving process algebra; total-order semantics for concurrent systems are often incorrectly referred to as interleaving semantics.
Partial-order process algebra
111
1. Introduction The behavior of parallel and distributed systems, often called concurrent systems, is a popular topic in the literature on (theoretical) computing science. Numerous formal languages for describing and analyzing the behavior of concurrent systems have been developed. The meaning of expressions in such a formal language is often captured in a so-called formal semantics. The objective of a formal semantics is to create a precise and unambiguous framework for reasoning about concurrent systems. Along with the development of the large number of formal languages for describing concurrent systems, an almost equally large number of different semantics has been proposed. The existence of so many different semantics for concurrent systems has created a whole new area of research named comparative concurrency semantics [43]. The primary purpose of comparative concurrency semantics is the classification of semantics for concurrent systems in a meaningful way. On a high level of abstraction, the behavior of a concurrent system is often represented by the actions that the system can perform and the ordering of these actions. Such an abstract view of the behavior of a concurrent system is called a process. The semantics of a formal language for describing the behavior of concurrent systems defines a process for each expression in the formal language. Two expressions in a formal language describe the same system if and only if they correspond to equivalent processes in the semantics, where the equivalence of processes is determined by a so-called semantic equivalence. The quest of developing formalisms and semantics that are well suited for describing and analyzing the behavior of concurrent systems is characterized by a number of ongoing discussions on classifications of semantic equivalences. One discussion is centered around linear-time semantics versus branching-time semantics. In a linear-time semantics, two processes that agree on the ordering of actions are considered equivalent. However, such processes may differ in their branching structure, where the branching structure of a process is determined by the moments that choices between alternative branches of behavior are made. A branching-time semantics distinguishes processes with the same ordering of actions but different branching structures. Another discussion focuses on total-order semantics versus partial-order semantics. In a total-order semantics, actions of a process are always totally ordered, whereas in a partial-order semantics, actions may occur simultaneously or causally independent of each other. Partial-order semantics are often referred to as true-concurrency semantics, because they are well suited to express concurrency of actions. A typical characteristic of a total-order semantics is that concurrency of actions is equivalent to non-determinism: A process that performs two actions in parallel is equivalent to a process that chooses non-deterministically between the two possible total orderings of the two actions. Thus, a total-order semantics abstracts from the causal dependencies between actions. Total-order semantics are often confused with interleaving semantics. As pointed out in [2], the term "interleaving" originates from one specific class of formal languages for describing concurrent systems, namely process algebras. Process-algebraic theories have in common that processes are represented by terms constructed from action constants and operators such as choice (alternative composition), sequential composition, and parallel composition (merge operator, interleaving operator). A set of axioms or equational laws specifies which processes must be considered equal. Most process-algebraic theories contain
772
J.C.M. Baeten, T Basten
some form of expansion theorem. An expansion theorem states that parallel composition can be expressed equivalently in terms of choice and sequential composition. A processalgebraic theory with an expansion theorem is called an interleaving theory; the semantics of such an algebraic theory is called an interleaving semantics or an interleaving process algebra. An algebraic theory without an expansion theorem is said to be non-interleaving. The semantics of such a theory is a non-interleaving semantics or a non-interleaving process algebra. As mentioned, most process-algebraic theories are interleaving theories. Very often, such an interleaving theory has a total-order semantics, which causes the confusion between the terms "total-order" and "interleaving". However, in [2], it is shown that it is possible to develop both process-algebraic theories with an interleaving, partial-order semantics and algebraic theories with a non-interleaving, total-order semantics. These examples show that the characterizations interleaving versus non-interleaving and total-order versus partial-order for process algebras are orthogonal. The above discussion also makes clear that, for semantics of non-algebraic languages for describing concurrent systems, the characterization interleaving versus non-interleaving is not meaningful. This chapter can be situated in the field of comparative concurrency semantics. Its main topic is to illustrate a way to develop a process-algebraic theory with a partial-order semantics. The starting point is an algebraic theory in the style of the Algebra of Communicating Processes (ACP) [13]. The basic semantic equivalence that is used throughout the chapter is bisimilarity [51]. Bisimilarity is often used to provide process-algebraic theories with a semantics that, in the terminology of this chapter, can be characterized as a branchingtime, interleaving, total-order semantics. An interesting aspect of bisimilarity is that it can be turned into a semantic equivalence called step bisimilarity [49] that provides the basis for a partial-order view on the behavior of concurrent systems. By means of step bisimilarity, it is possible to obtain a process-algebraic theory with a branching-time, interleaving, partial-order semantics in a relatively straightforward way. Furthermore, we show how to obtain a non-interleaving variant of such a process algebra. This chapter does not discuss variations of process-algebraic theories in the linear-time/branching-time spectrum. The interested reader is referred to [28,29] and [27], Chapter 1 of this Handbook. Another important theme of this chapter is the study of concepts known from Petri-net theory [53] in the process-algebraic framework developed in this chapter. The Petri-net formalism is a well-known theory for describing and analyzing concurrent systems. Petri nets have been used both as a language for describing concurrent systems and as a semantic framework for providing other languages for describing concurrent systems with a formal semantics. The Petri-net formalism is particularly well suited for creating a partial-order framework for reasoning about the behavior of concurrent systems. The non-interleaving, partial-order process algebra of Section 10 of this chapter is an algebra that incorporates a number of the most important concepts of the Petri-net formalism. In particular, it adopts the standard Petri-net mechanism for handling causalities. The chapter is written in the style of a tutorial. This means that it is self-contained, focuses on concepts, and contains many (small) examples and detailed explanations. The goal is not to develop a complete framework with a formal description language and semantics that is applicable to the development of large, complex concurrent systems. In addition, we do not claim that the approach of this chapter is the only way to obtain a process-algebraic theory with a partial-order semantics. It is our aim to provide a conceptual understanding
Partial-order process algebra
113
of several important concepts that play a role in describing and analyzing the behavior of concurrent systems. A better understanding of these concepts can be useful in the development of formalisms that are sufficiently powerful to support the development of large and complex systems. The chapter combines and extends some of the ideas and results that appeared earlier in [2,4], and [8, Chapter 3]. The remainder of this chapter is organized as follows. Section 2 introduces some notation for bags, which are omnipresent in the remainder of this chapter, and a convenient notation for quantifiers. In Section 3, the basic semantic framework used throughout this chapter is defined. The framework of labeled transition systems is used to formalize the notion of a process and bisimilarity of processes. It is shown how labeled transition systems can be used to obtain both a total-order view of concurrent systems and a partial-order view, where the latter is based on the notion of step bisimilarity. Section 4 introduces a class of Petri nets called labeled P/T nets. The framework of labeled transition systems is used to define both a total-order semantics and a step semantics for labeled P/T nets. Section 5 provides an introduction to standard ACP-style process algebra. As in Section 4, labeled transition systems form the basis for both a total-order and a partial-order framework. In Section 6, the algebraic framework of Section 5 is extended with a class of algebraic operators, called causal state operators. This class of operators is inspired by the Petri-net approach to defining the behavior of concurrent systems. It is shown that the resulting algebraic framework is sufficiently powerful to capture the semantics of labeled P/T nets in algebraic terms. Section 7 contains a brief intermezzo on algebraic renaming and communication functions, which is useful in the remaining sections. Section 8 describes two approaches to modularizing P/T nets. A modular P/T net models a system component that may interact with its environment via a well defined interface. It is explained how modular P/T nets in combination with the algebraic framework of Section 6 can be used to develop a compositional formalism for modeling and analyzing concurrent systems. The resulting formalism is a step towards a framework supporting the development of complex concurrent systems. In Section 9, the algebraic framework of Section 6 is extended with a class of so-called cause-addition operators. Cause-addition operators allow for the explicit specification of causalities in algebraic expressions. This class of operators is inspired by the way causalities are handled in Petri-net theory. The relation between cause addition and sequential composition, which is the most important operator for specifying causal orderings in process algebra, is studied. Section 10 studies a process algebra that incorporates several of the important characteristics of Petri-net theory. It is a non-interleaving, partialorder process algebra that includes the classes of causal state operators and cause-addition operators. In the context of this algebra, the relation between the causality mechanisms of standard ACP-style process algebra and Petri-net theory is investigated. Finally, Section 11 summarizes the most important conclusions of this chapter. It also provides some pointers to related work and it identifies some interesting topics for future study.
2. Notation Bags. In this chapter, bags are defined as finite multi-sets of elements from some alphabet A. A bag over alphabet A can be considered as a function from A to the natural numbers
774
J.C.M. Baeten, T Basten
N such that only a finite number of elements from A is assigned a non-zero function value. For some bag X over alphabet A and a e A,X{a) denotes the number of occurrences of a in Z, often called the cardinality of a in X. The set of all bags over A is denoted B{A). Note that any finite set of elements from A also denotes a unique bag over A, namely the function yielding 1 for every element in the set and 0 otherwise. The empty bag, which is the function yielding 0 for any element in A, is denoted 0. For the explicit enumeration of a bag, a notation similar to the notation for sets is used, but using square brackets instead of curly brackets and using superscripts to denote the cardinality of the elements. For example, [a^ I P{a)] contains two elements a for every a such that P{a) holds, where P is some predicate on symbols of the alphabet under consideration. To denote individual elements of a bag, the same symbol " G " is used as for sets: for any bag X over alphabet A and element a e A, a e X if and only if X{a) > 0. The sum of two bags X and 7, denoted X l±l 7, is defined SLsla"" \a e A An = X{a)-\- Y(a)l The difference of X and F, denoted X-Y/is defined SLS [a" \ a e A A n = (X{a) — Y(a)) max 0]. The binding of sum and difference is left-associative. The restriction of X to some domain D c A, denoted X f Z), is defined as [a^^^^ \a e D]. Restriction binds stronger than sum and difference. The notion of subbags is defined as expected: Bag X is a subbag of 7, denoted X ^ K, if and only if for aWa e A, X(a) ^ Y(a). Quantifiers. For quantifiers, we use the convenient notation of [23] in which the bound variables are represented explicitly. A quantifier is a commutative and associative operator with a unit element. Examples of well-known quantifiers are the logical quantifiers V and 3. Given a quantifier Q and a non-empty list of variables Jc, a quantification over x is written in the following format: (Qx : D(x): E(x)), where D is a predicate that specifies the domain of values over which the variables in x range and where E(x) is the quantified expression. Note that also the explicit enumeration of sets and bags could be written in quantifier notation. However, for sets we adhere to the standard notation with curly brackets and for bags we use the notational conventions introduced in the previous paragraph. Another notational convention concerning quantifiers is the following. Any binary commutative and associative operator 0 with a unit element can be generalized to a quantifier, also denoted 0 , in a straightforward way. Consider, for example, the binary + on natural numbers. The sum of all natural numbers less than 10 can be written as follows: (+x:xeNAx < 10:JC). 3. Process theory A natural and straightforward way to describe the behavior of a concurrent system is a labeled transition system. A labeled transition system consists of a set of states plus a transition relation on states. Each transition is labeled with an action. An action may be any kind of activity performed by a concurrent system, such as a computation local to some component of the system, a procedure call, the sending of a message, or the receipt of a message. However, for modeling purposes, the details of actions are often not important. The set of states in a labeled transition system is an abstraction of all possible states of a concurrent system. The transition relation describes the change in the state of a concurrent system when some action, represented by the label of the transition, is performed.
Partial-order process algebra
775
The framework of labeled transition systems introduced in this section is used throughout the remainder of this chapter to provide the Petri-net formalism of the next section and the various process-algebraic theories of the other sections with a formal semantics. Labeled transition systems can be used to define both a total-order and a partial-order semantics for concurrent systems. The difference is made by choosing an appropriate definition for the actions of a labeled transition system. In a total-order view, actions are assumed to be atomic entities without internal structure. A system can perform only a single atomic action at a time. Thus, the actions are totally ordered. In a partial-order view, a concurrent system can perform causally independent atomic actions simultaneously. Atomic actions are no longer totally ordered. It is even possible that a system performs the same atomic action several times in parallel, because also different occurrences of the same action may be causally independent. Thus, in a partial-order view on the behavior of concurrent systems, actions are bags of atomic actions. In this case, actions are often called multi-actions or steps. A partial-order semantics of concurrent systems that is based on the notion of steps is often called a step semantics. The basic notion in the framework of labeled transition systems used in this chapter is the sO'CeillQd process space. A process space describes a set of processes. A process space is a labeled transition system as described above extended with a termination predicate on states. Each state in a process space can be interpreted as the initial state of a process. A process is a labeled transition system extended with a termination predicate and a distinguished initial state. The termination predicate of a process defines in what states the process can terminate successfully. If a process is in a state where it cannot perform any actions or terminate successfully, then it is said to be in a deadlock. The possibility to distinguish between successful termination and deadlock is often useful. A predicate on the elements of some set is represented as a subset of the set: It holds for elements in the subset and it does not hold for elements outside the subset. DEFINITION 3.1 (Process space). A process space is a quadruple CP, A, ->, | ) , where V is a set of process states, ^ is a set of actions, _ - ^ _ c P x ^ x P i s a ternary transition relation, and | _ c p is a termination predicate.
Let (P, ^ , ->, I ) be some process space. Each state pinV cess that consists of all states reachable from p.
uniquely determines a pro-
3.2 (Reachability). The reachability relation = ^ C^V xVis smallest relation satisfying, for any p,p',p" ^V and a eA,
DEHNITION
p ==> p
defined as the
and
iP=>P A/7 —> p )^p=^p
.
Process state p^ is said to be reachable from state p if and only if p = ^ p'. The set of all states reachable from p is denoted /?*. 3.3 (Process). Let /? be a state in V. The process defined by p is the tuple (/7, /?*, A, -> n(/7* X ^ X /7*), i 0/7*). Process state p is called the initial state of the process. DEFINITION
776
J.CM. Baeten, T Bast en
r/
P/
\5
P P2\
/Pi
i (a)
(b)
(c)
(d)
Fig. 1. Some simple examples of processes.
In the remainder, processes are identified with their initial states. Sometimes, it is intuitive to think about elements of V as states, whereas sometimes it is more natural to see them as processes. 3.4. Let (V, .4, ->, | ) be some process space, where the set of actions equals a set of atomic actions A that includes the atomic actions p, p\, pi.f, and s. Figure 1 shows some examples of processes. Process states are depicted as dots. The initial state of a process is marked with a small incoming arrow. The process in Figure 1(a) is a simple sequential process. It represents, for example, a system that receives a message from its environment, processes this message, sends the processed message to its environment, and terminates successfully. The process in Figure 1(b) is almost the same, except that the processing action may result in a deadlock. The third process is a variant that iterates the behavior of the system in (a) without a possibility of termination. Finally, the process in Figure 1(d) represents a system that performs two processing actions in any order on the incoming message before it returns the processed message to its environment. In a total-order view on concurrent systems, one could also say that the system performs the two processing actions in parallel. There is no way to distinguish concurrency from nondeterminism. A total-order semantics abstracts from the causal dependencies between the occurrences of actions. EXAMPLE
EXAMPLE 3.5. Consider again a process space (V, A, -^, i). Let A be the same set of atomic actions as introduced in the previous example. Assume that the set of actions A is defined as B(A), the set of bags over A. Figure 2(a) shows the process corresponding to the process in Figure 1(d). It represents a system that receives a message, performs two processing actions in any order, and returns the processed message to the environment. The occurrences of the two processing actions are causally dependent. The process of Figure 2(a) does not model a system that may perform two causally independent processing actions. Such a system is represented by the process depicted in Figure 2(b). It performs the two processing actions in any order or simultaneously. Thus, in a step semantics it is possible to distinguish concurrency from non-determinism.
Partial-order process
[r]
ni
algebra
[r]
[P\]/'\[P2\
[P2K,/[P1]
[p\]
[P2]
[P2^
[Pl]
[s] a =
(a)
[p\,P2\
(b)
Fig. 2. Concurrency versus non-determinism in a step semantics.
The above example claims that the two processes depicted in Figure 2 are different. This raises the question when precisely processes are equivalent or not. To answer this question, the following definition introduces the so-called bisimilarity relation on processes, which is the basic semantic equivalence used throughout this chapter. It states that two processes are equivalent if and only if they can copy each others behavior and if they have the same termination options. The notion of bisimilarity was originally introduced in [51]. In [28] and [27] (Chapter 1 of this Handbook) bisimilarity is studied in more detail and a comparison with other semantic equivalences is made. DEFINITION 3.6 (Bisimilarity). A binary relation 1Z^V and only if, for any p,p\q,q' eV and a e A,
(i) pUqAp-^p' (ii) pUqAq-^q' (iii) pUq =^
^ {^q':q'^V:q^^q' ^ (3 p : p'eV : p-^ iip^iq).
xV is called a bisimulation if
Ap'Hq'). p A p'1Zq'), md
Two processes p and q are called hisimilar, denoted p -^ q/if and only if there exists a bisimulation IZ such that pTZq. PROPERTY
3.7. Bisimilarity, ^, is an equivalence relation.
PROOF. Reflexivity of bisimilarity follows from the fact that the identity relation on processes is a bisimulation. Symmetry follows immediately from the definition of bisimilarity. Transitivity follows from the fact that the relation composition of two bisimulations is again a bisimulation. D
An important property of bisimilarity is that it preserves moments of choice in processes as well as deadlocks. EXAMPLE 3.8. As before, let (P, ^ , ->, ^|.) be some process space, with A defined as the set of atomic actions A of Example 3.4. Consider the three processes depicted in Figure 3. Although all three are different, they appear to behave similarly. In all three cases.
778
J. CM. Baeten, T. Basten
?- - ~ .
P\\
P\[
Pi
\Pi
P\
\Pl
~ ^ i* ^ ^ -i' (a)
(b)
(0
Fig. 3. Bisimilar or not?
the process performs one out of two possible processing actions on the incoming message. In the process of Figure 3(a), the choice is made immediately upon receipt of the message. In process (b), the choice is made after the message has been received. The dashed lines depict an attempt to construct a bisimulation. It is not difficult to see that it is impossible to define a bisimulation between the two processes. As mentioned above, bisimilarity preserves moments of choice. Thus, the two processes of Figure 3(a) and (b) are not bisimilar. Bisimilarity provides the basis for a branching-time semantics for concurrent systems. The processes depicted in Figure 3(b) and (c), on the other hand, are bisimilar. The dashed lines depict what pairs of process states construct a bisimulation. It is straightforward to check that it satisfies the conditions of Definition 3.6. The two processes have the same moments of choice. The only difference is that in process (c) the two branches do not join, whereas they do come together in the process depicted in (b). EXAMPLE 3.9. Consider again Example 3.4. None of the processes in Figure 1 is bisimilar to any of the others. The fact that the two processes in Figure 1(a) and (b) are different conforms to the claim that bisimilarity preserves deadlocks. Consider Example 3.5. It is not possible to construct a bisimulation between the two processes in Figure 2. This confirms the remark made in Example 3.5 that in a step semantics it is possible to distinguish concurrency from non-determinism.
If bisimilarity is defined on a process space where the actions are bags over some set of atomic actions, then the resulting equivalence is often called step bisimilarity. The concept of step bisimilarity dates back at least to [49].
4. Labeled Place/Transition nets Petri-net theory is one of the most well-known examples of a partial-order theory for modeling and analyzing concurrent systems. Petri nets were introduced in 1962 by Carl Adam Petri [53]. Since then, Petri-net theory has been extended in many ways and applied to many kinds of problems. Its popularity is due to both its easy-to-understand graphical
Partial-order process algebra
779
representation of nets and its potential as a technique for formally analyzing concurrent systems. This section introduces so-called labeled Place/Transition nets, which is a class of Petri nets illustrative for any other Petri-net formalism. Let U be some universe of identifiers; let L be some set of labels. DEFINITION 4.1 (Labeled P/Tnet). An L-labeled Place/Transition net, or simply labeled P/T net, is a tuple (P, T, F, W, I) where (i) P C.U is a non-empty, finite set of places; (ii) r c L^ is a non-empty, finite set of transitions such that P H T = 0; (iii) F C (P X r ) U ( r X P) is a set of directed arcs, called the flow relation; (iv) H^: F ^- N is a weight function; (v) £ : r ^^ L is a labeling function. EXAMPLE 4.2. As mentioned, labeled P/T nets also have a graphical representation. Figure 4 shows a labeled P/T net. Places are depicted by circles, transitions by rectangles, and the flow relation by arcs. The weight function is represented by labeling arcs with their weights; weights equal to one are omitted. Attached to each place is its identifier. Attached to each transition is its label. Transition identifiers are usually omitted. They are only included if it is necessary to distinguish different transitions with the same label. The small black dot residing in place 1 is called a token. Tokens are introduced below.
Let (F, r , F, W, t) be a labeled P/T net. Elements of F U F are referred to as nodes. A node x G F U F is called an input node of another node j G F U F if and only if there exists a directed arc from x io y; that is, if and only if xFy. Node x is called an output node of y if and only if there exists a directed arc from y to x. If an input or output node X is a place in F, it is called an input place or output place; if it is a transition, it is called an input or an output transition. Two auxiliary functions i, o: (F U F) ^- B{P U F) assign to each node its bag of input and output nodes, respectively. For any x G F U F, ix = [>;^(>-^) I yFx] and ox = [y^^'-y^ I xFy]. 4.3. Consider again the P/T net in Figure 4. The bag of input places of transition r is the singleton bag containing place 1; that is, i> = [1]. The bag of output places of r is [2, 3];or = [2, 3]. The bag of output transitions of place 6 is empty; o6 = 0. EXAMPLE
A labeled P/T net as defined above is a static structure. Labeled P/T nets also have a behavior. The behavior of a net is determined by its structure and its state. To express the state of a net, its places may contain tokens. In labeled P/T nets, tokens are nothing more
..^V^^^^N^6 3
p^ 5
Fig. 4. An example of a labeled P/T net.
780
J.CM. Baeten, T. Basten
than simple markers. (See the graphical representation of a labeled P/T net in Figure 4.) The state of a net is defined as the distribution of the tokens over the places. In Petri-net theory, the state of a net is often called the marking of the net. 4.4 {Marked, labeled P/T net). A marked, L-labeled P/T net is a pair (A^, m), where A^ = (P, 7, F, W, i) is an L-labeled P/T net and where w is a bag over P denoting the marking of the net. The set of all marked, L-labeled P/T nets is denoted AT. DEFINITION
The behavior of marked, labeled P/T nets is defined by a so-called^rm^ rule, which is simply a transition relation defining the change in the state of a marked net when executing an action. To define a firing rule, it is necessary to formalize when a net is allowed to execute a certain action. The following definitions form the basis for a total-order semantics for labeled P/T nets. DEnNITlON4.5 {Transition enabling). Let {N,m) with A^ = {P,T,F,W,l) be a marked, labeled P/T net in A/". A transition t e T is enabled, denoted (A^, ni)[t), if and only if each of its input places p contains at least as many tokens as the cardinality of p in /r. That is, {N,m)[t) ^it ^ m . 4.6. In the marked net of Figure 4, transition r is enabled. None of the other transitions is enabled. EXAMPLE
When a transition t of a labeled P/T net is enabled, the net can^zr^ this transition. Upon firing, t removes W{p, t) tokens from each of its input places /?; it adds W{t, p) tokens to each of its output places p. This means that, upon firing r, the marked net (N, m) changes into another marked net (A^, m - ir l±l ot). When firing r, the labeled P/T net executes an action, defined by its label. That is, when firing transition r, the P/T net executes the action
4.7 {Total-orderfiringrule). The total-order firing rule _ [_)^
{N, m)[t) ^ {N, m) [l{t)y {N, m-it\±)
ot).
Tokens that are removed from the marking when firing a transition are often referred to as consumed tokens or the consumption of a transition; tokens that are added to the marking are referred to as produced tokens or the production of a transition. 4.8. In the P/T net of Figure 4, firing transition r changes the marking from [1] to [2, 3]. In the new marking, both transitions p\ and pi are enabled. As a result, either p\ can fire yielding marking [3,4] or pi can fire yielding marking [2, 5]. After firing one of these two transitions, the other one is the only transition in the net that can still fire. Independent of the order in which p\ and pi are fired the resulting marking is [4, 5]. In this marking, transition s is enabled; firing s yields marking [6].
EXAMPLE
Partial-order process algebra
781
As explained in the introduction to this chapter, a semantics of a formal language for describing concurrent systems defines a process for each expression in the formal language. The definitions given so far provide the following semantics for the language of labeled P/T nets. The usual Petri-net semantics does not distinguish successful termination and deadlock. Recall the notions of a process space and bisimilarity from Definitions 3.1 and 3.6. DEHNITION 4.9 (Total-order semantics). The process space (Af, L, [ ) \ 0), with the set of marked, labeled P/T nets as processes, the set of labels as actions, the total-order firing rule as the transition relation, and the empty termination predicate, combined with bisimilarity as the semantic equivalence defines a (branching-time) total-order semantics for labeled P/T nets. EXAMPLE 4.10. In the semantics of Definition 4.9, the process corresponding to the labeled P/T net of Figure 4 is the one depicted in Figure 1(d), except that it does not terminate successfully after the execution of action s. (Note that dots in Figure 1(d) correspond to marked, labeled P/T nets; labeled arrows represent the total-order firing rule [)'.) Figure 5 shows two other P/T nets with exactly the same semantics. Intuitively, the P/T net of Figure 4 models a system with true concurrency, whereas the two P/T nets of Figure 5 do not. In the P/T nets of Figure 5, the actions p\ and p2 may happen in any order, but not simultaneously. However, as one might expect by now, in the total-order semantics of Definition 4.9, it is not possible to distinguish the three nets. Note that, if desirable, the process-theoretic framework of the previous section is sufficiently flexible to express that the P/T nets of Figures 4 and 5 terminate successfully after firing transition s. Let ^^ be the termination predicate defined as follows: ^6 = {(^' m) eJ\f \6 em}. In the process space (A/*, L, [ ) ^ le), the semantics of all the three P/T nets of Figures 4 and 5 is the process depicted in Figure 1(d).
2
£1
4
P\
3
P2
Fig. 5. Two examples of P/T nets without true concurrency.
782
J.C.M. Baeten, T Basten
The total-order semantics of Definition 4.9 can be generalized to a step semantics for labeled P/T nets in a very natural way. It suffices to allow that multiple transitions can fire at the same time. A marking of a labeled P/T net enables a set of transitions if and only if all transitions in the set are simultaneously enabled. The auxiliary functions i and o are lifted to sets of transitions as follows: For any labeled P/T net A^ = (P, 7, F, W, i) and set 5 c 7, iS = {\^t\t^S: it) and oS = {}St \t € S \ ot). 4.11 {Set enabling). Let (N, m) be a marked, labeled P/T net in AT, where A^ = (P, r , F, W, €). A set 5 C 7 is enabled, denoted (N, w)[5), if and only if iS^m.
DEFINITION
Let A^ = (F, 7, F, V^, i) be an L-labeled P/T net. Any set 5* c 7 that is enabled in some given marking of N determines a possible step of A^. The transitions in the set 5 can fire simultaneously; the bag of labels of transitions in S forms the step that the net performs when firing S. Note that the set of all subsets of a given set X, also called the powerset of X, is denoted V{X). The labeling function I: V{T) -> B{L) on sets of transitions of A^ is defined as follows: For any set 5 c 7, t{S) = (\St: t eS: [l(t)]). 4.12 (Step firing rule). The step firing rule _ [_)' ^QAf x B(L) x Af is the smallest relation satisfying for any marked, labeled P/T net (A^,m) in AT, where A^ = (F, 7, F, W , € ) , a n d a n y 5 C 7 , DEFINITION
(A^, m)[S) => (A^, m) [i{S)y (N, m-iS^S
oS).
The step firing rule forms the basis for the following step semantics for labeled P/T nets. DEFINITION 4.13 (Step semantics). The process space (J\f, B(L), [ y, 0), with the bags over L as actions and the step firing rule as the transition relation, combined with bisimilarity as the semantic equivalence defines a step semantics for labeled P/T nets.
Note that the semantic equivalence resulting from Definitions 3.6 (Bisimilarity) and 4.13 (Step semantics) is the step-bisimilarity equivalence introduced in the previous section. Thus, the semantics of Definition 4.13 can be characterized as a branching-time, partialorder semantics. 4.14. Recall the two processes depicted in Figure 2. Consider the two variants of these processes that cannot terminate successfully after performing the last action. Assuming the semantics of Definition 4.13 for labeled P/T nets, the process in Figure 2(b) is the semantics of the labeled P/T net of Figure 4. The other process depicts the semantics of the two P/T nets in Figure 5. Thus, in the step semantics of Definition 4.13, it is possible to distinguish concurrency from non-determinism. EXAMPLE
This section has given a brief introduction to elementary Petri-net theory. The class of labeled P/T nets has been introduced, as well as two different semantics for this class of nets. Labeled P/T nets handle causal relationships between actions very explicitly via
Partial-order process algebra
783
places and tokens and are, therefore, well suited for developing a partial-order framework for reasoning about concurrent systems. The introduction is not exhaustive. In particular, there are several other approaches to defining a partial-order semantics for P/T nets than the one chosen in this section. However, the framework of this section is sufficient for the remainder of this chapter. Good starting points for further reading on Petri nets are [17, 47,52,56-58]. In the remainder of this chapter, we introduce a process-algebraic theory with both a total-order and a step semantics. In addition, we study several concepts from Petri-net theory in the algebraic partial-order framework.
5. Process algebra The goal of this section is to illustrate how process algebra in the style of the Algebra of Communicating Processes (ACP) can be used to reason about concurrent systems in both a total-order and a partial-order setting. The theory ACP originates from [13]. Good introductions to ACP-style process algebra can be found in [5,6,25]. Other well-known process-algebraic theories are CCS [44,45] and CSP [36]. Specifications and verifications in ACP-style process algebra are based on an equational style of reasoning, whereas CCS and CSP emphasize model-based reasoning. In the latter case, the starting point of the theory is a semantic framework of processes in the style of Section 3. The goal is to find equational laws that are valid in this semantic framework. In the former case, the starting point is an equational theory, which may have several semantic interpretations. For a detailed comparison of ACP, CCS, and CSP, the reader is referred to [6, Chapter 8]. This section presents the theory ACP and a few of its extensions. It illustrates how the communication mechanism of ACP can be used to define a step semantics for concurrent systems. It is also defined when a process-algebraic theory and its semantics are said to be interleaving. Both the total-order and the partial-order framework developed in this section can be characterized as interleaving frameworks.
5.1. The equational theory The Algebra of Communicating Processes. Any ACP-style process-algebraic theory is essentially an equational theory. An equational theory consists of a signature and a set of axioms. The signature defines the sorts of the theory, a set of variables for each sort, and the functions of the theory. Functions and variables can be used to construct terms. Terms not containing any variables are called closed terms. The axioms of the theory determine which terms are equal. A process-algebraic theory usually has only a single sort; terms of this sort represent processes. A 0-ary function is often called a constant; other functions are often called operators. The signature and axioms of the equational theory ACP(AC, y) are given in Table 1. The theory is parameterized by a set of constants AC, which is a set of actions, and a partial function y :AC x AC -> AC, which is a communication function. The first part of Table 1 lists the sorts in the signature of ACP(AC, y); the second part defines the constants and the operators in the signature. The third entry of Table 1 gives the variables and lists the
784
J.C.M. Baeten, T Basten Table 1 The equational theory ACP(y4C, y) ACP(AC,y) P; ACCP; x,y,z:
S \P\
dn
:P -^ P;
-+ , . • . , _ | | . , . 1 L . , _ | .
PxP-^ P\
P\ X + y = y -\-x
8-x = 8
Al M A3 AA A5 A6 Al
e\f = f\e (e\f)\g = 8\e = 8
C\ CI C3
{x-^y) +
Z=x^iy-^z)
X +JC =X
{x + y)-z = x-z + y'Z {xy)z = x{yz) JC + 5 = JC
e\(f\g)
y(a,b) defined =^ a \b = y{a,b) yia,b) undefined =^ a\b = 8
CF\ CFl
X \\y = x
ly~hylx-^x\y
e \[x =e • X
e-x ly = e-{x \\ v) (x-hy)lz=xlz-\-ylz e-x\f = {e\f)-x e\f-x = ie\f)-x e-x\f-y = ie\f)-ix\\y) (x-^y)\z = x\(y + z) =
x\z-\'y\z x\y+x\z
a/,(.r + >') = a//(A-) + a//(v) dH(xy)
=
dH(x)dHiy)
CM\ CMl CM3 CM4 CMS CM6 CMl CMS CM9 D\ D2 D3 DA
axioms of the equational theory. Note that new variables may be introduced any time when necessary. An informal explanation of the operators and the axioms is given below. As mentioned, AC is a set of actions. Terms of sort P represent processes. Each action is a process, namely the process that can only execute the action and then terminates. The two basic operators of ACP(AC, y) are + and •, denoting alternative composition or choice and sequential composition, respectively. These two operators are elementary in describing the behavior of sequential processes. Sequential composition binds stronger than choice. Choice and sequential composition are axiomatized by Axioms Al through A5. Most of these axioms are self-explanatory. Only Axiom AA might need some explanation. It states the right distributivity of sequential composition over choice. The converse, left distributivity, is not an axiom of the theory. As a result, processes with different moments of choice are distinguished. The constant 6 stands for inaction, often also called deadlock. However, the former name is best suited, as follows from Axiom A6. It says that a process which can choose between some behavior x and doing nothing is equivalent to the process that has no choice and can only do x. Hence, in the context of a choice, 5 is not a true deadlock. Axiom Al shows that 5 is a deadlock in the context of a sequential composition. Axioms CMl through CM9 axiomatize the behavior of concurrent processes. Constants e and / range over AC U {5}. Thus, an axiom such as CMl containing the constant e is actually an axiom scheme; the equational theory ACP{AC, y) contains one axiom for each possible constant e e AC U {5}. The parallel-composition operator ||, often called the merge operator, denotes the parallel execution of its operands. It is axiomatized using two auxiliary operators, namely |i.
Partial-order process algebra
785
called the left merge, and |, called the communication merge. The left merge has the same meaning as the merge except that the left process must perform the first action. The communication merge also denotes the parallel execution of its operands, this time with the restriction that they must synchronize on their first action. Sequential composition binds stronger than merge, left merge, and communication merge, whereas choice binds weaker. The result of the synchronization of two actions is defined by the communication function y, as expressed by Axioms CF\ and CF2. Constants a and b range over AC. Operator I and function y are named communication merge and function, respectively, because the standard interpretation in ACP-style process algebra of the synchronization of two actions is (synchronous) communication. However, in the remainder, it is shown that the communication function can also be used to define a step semantics for processes. This means that the synchronization of actions conforms to simultaneous execution. Axioms CI, C2, and C3, where e, / , and g range over AC U {5}, state that the synchronization of actions is commutative and associative and that actions cannot synchronize with the inaction constant S. To the experienced reader, it might be clear that the combination of Axioms CI, C2, C3, CFl, and CF2 can only be consistent if the communication function y is associative and commutative. This requirement becomes explicit in the next subsection, where a model of the equational theory of this subsection is constructed. (See the proof of Theorem 5.13.) Finally, the equational theory ACP(AC, y) contains the so-called encapsulation operators. For any subset of actions H c AC, the operator 3// renames all actions in / / in a process to the constant (5, as expressed by Axioms D\ through DA. Thus, the execution of actions in H is effectively blocked. Constant e ranges over AC U {6]. In ACP-style process algebra, an encapsulation operator is usually used to enforce communication between actions. This can be achieved by encapsulating the actions that must participate in a communication when they occur in isolation. An equational theory such as ACP(AC, y) of Table 1 provides the basis for reasoning about concurrent processes. The set of axioms of an equational theory defines an equivalence relation on process terms, called derivability. For any process terms x and y in some given equational theory X, X\- x = y denotes that x = y can be derived from the axioms of X. Derivability in an equational theory is defined as follows. First, the axioms themselves can be derived from the axioms of the theory. Second, since derivability is an equivalence relation, it is reflexive, symmetric, and transitive. Third, if an equation is derivable from the axioms, then also any equation obtained by substituting terms for variables in this equation is derivable. Finally, any equation obtained by replacing a term in an arbitrary context by another derivably equivalent term is also derivable from the theory. The axioms of an equational theory must be chosen in such a way that derivability defines a meaningful equivalence relation on processes. Below, it is explained that in the case of the theory ACP(AC, y) derivability corresponds to bisimilarity. 5.1. Let A be some set of actions that includes the actions p\, pi.r, and s\ let y be some arbitrary communication function. It can be shown that ACP(A, y)\- r - {{p\ + pi)' s) = r • {p\' s -\- p2- s). The first step is to substitute p\, pi. and s for the variables X, y, and z in Axiom A4, which shows that ACP(A, y)\~ t\ = ti, where ri is the term {p\ + P2) • s and t2 denotes the term p\ - s -\- p2 • s. The second and final step consists EXAMPLE
786
J.CM. Baeten, T Basten
of an application of the context rule explained above: Replacing term t\ inr equivalent term t2 yields the desired result.
tx with the
The intuitive meaning of the operators of ACP(y4C, y), the axioms, and the induced equivalence relation given above can be analyzed further by defining an operational semantics. However, before doing so, a few extensions of ACP(y4C, y) are discussed that are needed in the remainder. Renaming, The encapsulation operators of ACP(AC, y) form a subclass of a much larger class of operators, namely the algebraic renaming operators. A renaming operator applied to a process term simply renames actions in the term according to a renaming function. A renaming function / : {AC U [8]) -> {AC U [8)) is any function with the restriction that f{S) =8. This restriction means that the inaction process can be the result of a renaming, but that it cannot be renamed itself. It is included in the domain of renaming functions only for the sake of convenience. The set of all renaming functions is denoted RF. The Algebra of Communicating Processes with renaming, abbreviated ACP + RN, is defined in Table 2. It is parameterized with a set of actions AC and a communication function y. The first entry of Table 2 says that the equational theory (ACP + RN) (AC, y) extends the theory ACP(AC, y) of Table 1. The other entries of Table 2 have the same meaning as the corresponding entries in Table 1. In Table 2, function / ranges over the set of renaming functions RF and constant e ranges over AC U {8}. As mentioned, the encapsulation operators of ACP(AC, y) belong to the class of renaming operators. Let / / c AC be some set of actions. Let e{H): (ACU {8}) -> {AC U {8}) be a renaming function in RF defined as follows: e{H){8) = 8, for any a e H, e{H){a) = 8, and, for any a eAC\H, e{H){a) = a. It is not difficult to see that the encapsulation operator 3// and the renaming operator Pe(H) ^^ identical. Iteration. In practice, many concurrent processes exhibit some kind of recursive behavior. A restricted form of recursive behavior is iterative behavior. Table 3 defines the Algebra of Communicating Processes with iteration and renaming, abbreviated ACP* -I- RN. The binary Kleene star * was introduced in ACP-style process algebra in [11]. It is adapted from the original star operator as introduced in [41]. In [11], also the Axioms Table 2 The equational theory (ACP + RN)(AC, y) (ACP + RN)(AC,K)
ACP(AC, Y) Pf.P-^P;
Pf{e) = f{e) Pf (X + v) = pf (x) + Pf (y) Pfix-y) = pf{x)pf(y)
RN\ RN2 RN3
Partial-order process algebra
787
Table 3 The equational theory (ACP* + RN)(AC, y) (ACP*+RN)(AC,y) (ACP+ RN) (AC,)/) - * . : P X P^ x,y,z:
P-
P; jc*y=jc(jc*,v) + v
BKSl
x*(y-z) = {x*y)-z xHy • {{X + yr z) + z) = {x + yr z Pf{x''y) = pfixrpf{y)
BKSl BKS3 BKS4
BKSl through BKS4 appear, although BKS4 is formulated only for the specific renaming operators encapsulation and abstraction. Abstraction in process algebra is not covered in this chapter. An extensive study of iteration in ACP-style process algebra can be found in [12], Chapter 5 of this Handbook. In Table 3, function / ranges over the set of renaming functions RF as introduced above. Axiom BKSl is characteristic for iteration. It states that behavior x is iterated an arbitrary number of times before continuing with behavior y. (Axiom BKS3 is a sophisticated axiom which is needed to get a complete axiomatization of bisimilarity in a setting much simpler than the equational theory developed in this subsection; see [11] or [12], Chapter 5 of this Handbook, for more details.) The binary Kleene star has the same binding priority as sequential composition. Recursive equations. Since often verifications in an equational theory result in an equation that is recursive in some given process, it is useful to have a means to determine solutions for such recursive equations. Table 4 presents the theory (ACP* + RN -h RSP*)(AC, y) which extends (ACP* -h RN)(AC, y) with a so-called recursion principle. The Recursive Specification Principle for the binary Kleene star (RSP*) is a derivation rule which gives a solution in terms of the binary Kleene star for some restricted set of recursive equations.
Table 4 The equational theory (ACP* + RN + RSP*){AC, y) (ACP* + R N + /?5P*) (AC, K) (ACP* + RN) (AC, y)
x,y,z
: P; X = y -x -\- z X = v^z
RSP*
788
J.C.M. Baeten, T Basten Table 5 The equational theory (ACP* + RN + RSP* + SC)(AC, y) (ACP* + RN -f RSP* + S O (AC, K) (ACP* + RN + /?5P*)(AC, K)
^, v,z : P\ x\y = y\x x\\y = y II X x\{y\z) = {x\ y) 1 z
(•^lLv)lLz = -^lL(vlU) {x\y)lz
=
x\{ylz)
(^ll>^)IU = -^ll(ylU)
sc\
SCI 5C3 5C4 5C5 5C6
Observe that, compared to theory (ACP* + RN)(AC, y), equational theory (ACP* + RN -f- RSP*)(AC, y) has no new constants or operators. Another interesting observation is that, in theory (ACP* + RN + RSP*)(AC, y), the axioms BKS2. BKS3, and BKS4 are derivable from the other axioms of the theory. (It is an interesting exercise for the reader to give the three derivations.) Standard concurrency. A final extension of the equational theory developed so far in this subsection is the extension with the so-called axioms of standard concurrency. Table 5 presents the Algebra of Communicating Processes with iteration, renaming, the Recursive Specification Principle for the binary Kleene star, and standard concurrency, abbreviated ACP* + RN+/?5P* + SC. The equational theory (ACP* + RN-h/?5F* -hSC)(AC, y) has no new constants or operators. The extension solely consists of six new axioms, formulating some desirable properties of the merge, left merge, and communication merge. A consequence of the extension of the equational theory with the axioms of standard concurrency is that it allows the straightforward formulation of a general so-called expansion theorem. This theorem is very useful for simplifying many calculations. It states how a parallel composition can be expanded into an alternative composition. Recall from Section 2 that the commutative and associative binary process-algebraic operator + with unit element 8 generalizes to a quantifier in a standard way. Furthermore, note that the binary operators || and | in the equational theory (ACP* -h RN -h /?5P* -h SC)(AC, y) are also commutative and associative but that they do not have unit elements. Nevertheless, general quantifier notation may be used for these two operators. For example, for some positive natural number n, and operands XQ, . . . , JC„, the quantifier notation (||/ :0^i^n: x;) is used as a shorthand notation for xo \\ ... \\ A,,, where redundant brackets are omitted, and the notation {\\i :i =k : JC,), for some k with 0 ^k ^n, denotes .v^. 5.2 (Expansion). Let XQ, . . . , x,j be process terms of sort P, where n is a positive natural number Let I be the set {0,..., n].
THEOREM
(ACP* + RN + /?5P* -h S O (AC, y) h
Partial-order process algebra (11/ : / G / : x/) = (+y : 0 c y C / : (|7 : 7 € 7 : Xj) I {\\i :ieI\J:
789 x/))
4-(|/:/e/:x/). PROOF.
It is straightforward to prove the desired result by induction onn.
D
EXAMPLE 5.3. Let A be some set of actions that includes the actions a, b, c, and d. Function y : A X A -> A is the communication function defining that the communication of actions a and b yields action c. In set notation, y = {((a, b), c), ((Z?, a), c)}. In its simplest form, the expansion theorem given above corresponds to Axiom CM\ of Table 1. The following derivation in the equational theory (ACP* + RN -f RSP* -f SC)(A, y) shows the application of the expansion theorem to a parallel composition of three components:
a\\b\\d =
{Theorem 5.2 (Expansion)} al(b\\d)-^bl(a\\d)-hdl(a\\b)
+
(a\b)ld-^(a\d)lb
-\-(b\d)\la-\-(a\b\d) =
{Exercise for the reader} a'{b-d-\-d-b)-\-b'(a-d-hd'a)-{-d(a'b-\-b'a-\-c)-^C'd.
Note that the above expansion theorem allows the synchronization of an arbitrary number of processes. In the standard literature on process algebra [5,6], only a simpler version of the expansion theorem is formulated. The simplifying assumption, called the handshaking axiom, is that only pairs of processes can synchronize. In the current setting, it is desirable to allow arbitrary synchronization, because one possible interpretation of synchronization corresponds to concurrency. There is no obvious reason to restrict concurrency to two processes. Interleaving theory. As explained in the introduction, a process-algebraic theory with an expansion theorem is said to be interleaving. In this paragraph, we formalize the notion of an interleaving theory in terms of more elementary concepts. To the best of our knowledge, such a formalization does not yet exist in the literature on concurrency theory. (The definition of a (non-)interleaving process-algebraic theory in [2] is kept informal.) Therefore, the definition given in this paragraph is phrased in general terms such that it is applicable to any ACP-style equational theory. It can also be easily adapted to other process-algebraic frameworks such as CCS and CSP. Let X(AC) be some ACP-style equational theory which is parameterized with a set of actions AC. Note that it may have more (unspecified) parameters such as a communication function. In addition, assume that X(AQ has a single process sort P and that its signature contains at least the choice operator +, the sequential-composition operator •, and the parallel-composition operator ||. The following format of process terms forms the basis of the formalization of the notion of an interleaving equational theory. Note that this format is a standard format defined in the process-algebraic literature [6].
790
J.CM. Baeten, T Basten
5.4 {Head normal form). The sci of process terms over the signature of X{AC) in head normal form, denoted H(AC), is inductively defined as follows. First, each action constant in AC is an element of H(AC). Second, if the signature of X(AQ contains the inaction constant 8, then also 8 is an element of H(AQ. Third, for any action a in AC and term x of sort P, the term a • x is an element of H(AC). Finally, for any terms y and z in H{AC), the term y + z is an element of H(AC). An arbitrary term x of sort P is said to have a head normal form, denoted HNF(x) if and only if there is a term y in H{AC) such that X(AC) hx = y. DEFINITION
EXAMPLE 5.5. Consider the equational theory ACP(AC, y) of Table 1. As in Example 5.1, let A be some set of actions that includes the actions p\, pi.r, and 5; let y be some arbitrary communication function. The closed term r • {{p\ -f pi) • s) is in head normal form. Term {p\ + pi) • s is not in head normal form. However, it has a head normal form, because it is derivably equal to the term p\ • s -\- pi- s, which is in head normal form. The term x of sort P, where jc is a variable, does not have a head normal form.
An equational theory is said to be interleaving if and only if each parallel composition has a head normal form under the assumption that its operands have head normal forms. DEFINITION 5.6 {Interleaving theory). The equational theory X{AQ is an interleaving theory if and only if, for any terms x and y of sort P, HNF{x) and HNF{y) implies HNF{x II y).
All the equational theories given so far in this subsection are interleaving theories. The proof of this result uses two auxiliary properties about head normal forms of compositions using the auxiliary operators left merge and communication merge. 5.7. Let AC be some set of actions; let y be an arbitrary communication function. The equational theories ACP(AC, y), (ACP + RN)(AC, y), (ACP* + RN)(AC, y), (ACP* + RN + /?SP*)(AC, y), and (ACP* + RN -h RSP* + SC){AC, y) are all interleaving theories. THEOREM
The proof is identical for each of the theories. Therefore, let x and >' be terms of sort P of any of the above theories such that HNF{x) and HNF{y). It must be proven that HNF{x II y). It follows from Axiom CM\ of Table 1 that x \\ y = x ly + y Ix + x \y. Definition 5.4 implies that it suffices to prove that HNF{x |i >0, HNF{y IL x), and HNF{x \ y), which follows immediately from Properties 5.8 and 5.9. D PROOF.
5.8. Let AC be some set of actions', let y be an arbitrary communication function. For any terms x and y of sort P of any of the equational theories ACP(AC, y), (ACP + RN)(AC, y), (ACP* + RN)(AC, y). (ACP* + RN + RSP*){AC, y), and (ACP* -f RN -f RSP"" 4- SC)(AC, y), HNF{x) implies HNF{x I y). PROPERTY
PROOF. Let H{AC) be the set of terms in head normal form of any of the above theories. Let X and y be terms of sort P of the same theory such that HNF{x). It must be proven that
Partial-order process algebra
791
HNF(x W_ y). According to Definition 5.4, there must be a term in H(AC) that is derivably equal to x. Thus, it suffices to prove that for any z e H(AQ, HNF(z |L y). Let z be a term in H{AC). Since the signature of any of the theories in this property contains the inaction constant 8, term z can be in any of four formats. The proof is by induction on the structure of term z. The symbol = denotes syntactical equivalence of terms. (i) Assume that z = 5. It follows that 8 \ly ^^k^'^ s. Since 8 € H(AQ, it follows that HNF{8 IL y), which completes the proof for the case z = 5. (ii) Assume that z = a, for some action a in AC. It follows that a ^y —^ay. Since a-y ^ H(AC), it follows that HNF(a U_ >'), which completes the proof also in this case, (iii) Assume that z = a • JCi, for some action a in AC and some term x\ of sort P. It follows that a 'X\ ^y = a '{x\ \\y). Since a -{xi \\ y) e H{AQ, it follows that HNFiaxi ly). (iv) Finally, assume that z = zi + Z2, for some terms z\ and Z2 in H(AC). It follows that(zi-f-Z2) IL}^ = Zi ILy + Z2 IL J By induction, it follows that//A^F(zi IL>') and HNF{z2 IL y). which means that HNF(z\ ly + zily)- Consequently, HNFi(z\ + zi) IL y)^ which completes the proof. D 5.9. Let AC be some set of actions', let y be an arbitrary communication function. For any terms x and y of sort P of any of the equational theories ACP(AC, y), (AC? + RN)(AC, y), (ACP* + RN)(AC, y), (ACP* + RN + RSP''){AC, y), and (ACP* -h RN + /?5P* + SC)(AC, y), HNF{x) and HNF(y) implies HNF(x \ y). PROPERTY
PROOF. Let H(AC) be the set of terms in head normal form of any of the above theories. Let X and y be terms of sort P of the same theory such that HNF{x) and HNF(y). It must be proven that HNF(x \ y). According to Definition 5.4, there must be terms in H(AC) that are derivably equal to x and >', respectively. Thus, it suffices to prove that for any terms xo and yo in H(AC), HNF(xo \ yo). Let XQ and yo be terms in H(AQ. The proof is by induction on the structure of XQ. (i) Assume that XQ = 8. It must be shown that HNF{8 \ yo). This result is shown by straightforward induction on the structure of term vo(a) Assume that yo = ^ or that yo = ^. for some action a in AC. It follows that C3
8\yQ = 8. Thus, HNF{8 \ yo), which completes the proof in this case. (b) Assume that yo = ^ * y u for some action a in AC and some term y\ of sort P. It follows that 8\a'y\ '=' 8, which completes the proof also in this case. (c) Finally, assume that yo = Zi + Z2, for some terms zi and Z2 in H{AC). It follows that 5 I (zi + Z2) = d I zi + 5 I Z2. By induction, it follows that HNF{8 | zi) and HNF{8 I Z2), which means that HNF{8 \ (zi -h Z2)). (ii) Assume that JCQ = fl, for some action a in AC. Again, the desired result that HNF{a \ yo) is proven by induction on the structure of yo. (a) Assume that yo = 5. It follows that a \ 8 ^^=^ 8. Thus, HNF{a \ 8).
792
J,C.M. Baeten, T. Basten
(b) Assume that yo = b, for some action b in AC. It follows from Axioms CF\ and CFl and the fact that the result of the communication function is an action in AC thai HNF(a \b). (c) Assume that yo = ^ • >'i, for some action b in AC and some term y\ of sort P. It follows that a\b • y\ = (a \b) - y\At follows from the fact that y yields an action in AC and Axioms CFl, CF2, and Al that HNF{{a | ^) • >'i). (d) Finally, assume that yo^z\ -h Z2. for some terms z\ and zi in H{AC). It follows thatfl I (zi-I-Z2) = « I z i + « U2-By induction, it follows that//A^F(^ I Zi) and HNF{a I Z2), which means that HNF{a \{z\-^ zi)). (iii) Assume that JCQ = fl xi, for some action a in AC and some term x\ of sort P. As in the previous two cases, the desired result is proven by induction on the structure of Jo- The details are very similar to the proof of the previous case and, therefore, left to the reader. (iv) Finally, assume that JCQ = zi -h Z2, for some terms z\ and Z2 in H(AC). It follows that (zi + Z2) I yo = z\\yo-\- Z2\ yo- By induction, it follows that HNF(z\ \ yo) and HNF(z2 I yo), which means that HNF((z\ + Z2) I yo). ^ EXAMPLE 5.10. Let A be some set of actions that includes the actions a, b, and c; let y be the communication function {((a, b), c), ((/?, a), c)}. Consider the following derivation (which can be made in any of the equational theories given in this subsection):
a\\b =
{Axioms CMl,CM2(2x)} a 'b-hb-a
—
-\-a \ b
{Definition y\ Axiom CF\} a'b-\-b'a-\-c.
This derivation is characteristic for an interleaving equational theory. It shows how a parallel composition can be rewritten into an alternative composition of all its interleavings, including the interleaving in which the two actions communicate. Clearly, the last term of this derivation is in head normal form. Consequently, term a || b has a head normal form (as required by Theorem 5.7). Another derivation that is characteristic for an interleaving equational theory is the derivation shown in Example 5.3 that uses the expansion theorem of Theorem 5.2. It is an interesting observation that all the equational theories given in this subsection are interleaving theories. The proof of this result does not depend on the expansion theorem given in Theorem 5.2. The axiomatization of the merge operator in terms of the auxiliary operators left merge and communication merge is the fundamental reason that a theory is an interleaving theory as defined above. Note that this observation does not contradict our informal definition that an equational theory is an interleaving theory if and only if it has some form of expansion theorem. It is possible to prove an expansion theorem for any of the theories of this subsection, although the convenient formulation of such an expansion
Partial-order process algebra
793
theorem is only possible when the theory contains the axioms of standard concurrency given in Table 5. As already mentioned in the introduction, most process-algebraic theories in the literature are interleaving theories. In particular, the proof of Theorem 5.7 carries over to any of the ACP-style equational theories presented in [5,6,25]. This includes equational theories without communication and theories with recursion or abstraction. To prove that equational theories without communication are interleaving, it is even sufficient to use Property 5.8. Finally, also the equational theories in the CCS framework of [44,45] and the CSP framework of [36] can be characterized as interleaving theories. Concluding remark. As already mentioned, the motivation to develop the theory (ACP* -h RN + /?5P* -h SC) (AC, y) of Table 5 is to provide the means to reason about the behavior of concurrent processes. However, so far, the meaning of the algebraic constants, operators, and axioms has only been explained informally. In the next subsection, the semantics of (ACP* + RN + RSP"" -\- SC) (AC, y) is formalized using the framework of Section 3. 5.2. A semantics for the equational theory A model As before, assume that AC is a set of action constants and that y : AC x AC -^ AC is a communication function. The semantics of terms in an equational theory is formalized by defining a so-called model of the theory also called an algebra for the theory. Since the terms in a single-sorted equational theory such as (ACP* + RN + /?5P* -h SC)(AC, y) are supposed to be interpreted as processes, a model of an ACP-style equational theory is also called di process algebra. In general, a model of a single-sorted equational theory X consists of a domain of elements plus a number of functions on that domain, called the signature of the model. A model M with domain V must satisfy the following properties. First, there must exist an interpretation of the functions in the signature of X in terms of the functions in the signature of the model M that preserves the arity of functions. Second, any equation that is derivable from the axioms of the equational theory must be valid in the model, where vaHdity is defined as follows. Let r be a term in the equational theory X; let a be a mapping from variables in t to elements from domain V, called a variable substitution. The interpretation of t in the model M under substitution a, denoted \t\a, is obtained by replacing all functions in t by the corresponding functions in M and by replacing all variables in t by elements of domain V according to a. An equation t\ = r^ in X is valid in model M, denoted A^ |= ^i = r2, if and only if, for all substitutions a for the variables in ri and ti, {HIG =V llijcj. where = p is the identity on domain V. If > t is a model of an equational theory X, it is also said that X is a sound axiomatization oi M. EXAMPLE 5.11. Assume that M with domain P is a model of the theory ACP(AC, y) of Table 1. Recall that the functions in the signature of ACP(AC, y) consist of the inaction constant 5, the action constants in AC, and the operators listed in Table 1. Assume that, for any function / in the signature of ACP(AC, y), / denotes the corresponding function in the signature of M. Consider the equation a -\- ^ = a, where a is an action in AC. It
794
J.C.M. Baeten, T Basten
follows from Axiom A6 that this equation is derivable from theory ACP(AC, y). Since M is amodel of this theory, a-\- 8 =a must be valid in M, which means that the equahty fl-f 5 = p a, where =x> is the identity on domain P , must hold. In fact. Axiom A6 itself is derivable from the theory and must, therefore, be valid in M. That is, for any d eV, the equality d^8 = p d must hold. The basis for a model of the equational theory (ACP* + RN + RSP* + SC) (AC, y) is a process space, as defined in Definition 3.1. This means that a set of processes, a set of actions, a transition relation, and a termination predicate need to be defined. Let C(AQ be the set of closed (ACP* + RN + RSP* + SC) (AC, y) terms. The set C(AQ forms the basis for the set of processes in the process space. Since the equational theory (ACP* -h RN + RSP* -h SC) (AC, y) has no means to express the process that can perform no actions, but can only terminate successfully, a special process y , pronounced "tick", is introduced. Thus, the set of processes in the abovementioned process space is the set C(AC) U {y/}. The set AC is the set of actions. The termination predicate is the singleton {s/}. That is, process y/ is the only process that can terminate successfully. The transition relation _ -^ _ c (C(AC) U{^})xACx (C(AO U {^1) can now be defined as the smallest relation satisfying the derivation rules in Table 6. Note that the transition relation has an implicit parameter, namely the communication function y. It is not difficult to verify that the transition relation conforms to the informal explanation of the operators given in the previous subsection. The process space (C(AC) U {y/},AC, —> , {y/}) can be turned into a model M(AC, y) of the equational theory (ACP* -f RN + RSP* -h SC) (AC, y) as follows. Recall that bisimilarity, as defined in Definition 3.6, is an equivalence relation on the set of processes C(AC) U {y/}. Thus, it is possible to define equivalence classes of processes modulo bisimilarity in the usual way: For any p e C(AQ U {V), the equivalence class of p modulo bisimilarity, denoted [p]^, is the set {q € C(AC) U {y/} \q ^ p}- It follows from Definition 3.6 (Bisimilarity) that the special element [y/]^ only contains the process y . The domain of the model under construction is formed by the set of all the equivalence classes of closed terms modulo bisimilarity.' The special element [y/]-^ is excluded from the domain of model A1 (AC, y) for technical reasons: As mentioned, the equational theory (ACP* + RN + RSP* + SC) (AC, y) has no means to express the process that can only terminate successfully. It remains to define the constants and operators of (ACP* + RN + RSP* -h SC) (AC, y) on the domain of the model. The interpretation c in model M(AC, y) of some constant c in the signature of (ACP* + RN + RSP* + SC) (AC, y) is defined as the equivalence class [c]~. Note that this definition fulfills the requirement that c is a 0-ary function on the domain of A1 (AC, y). Also for the operators there is a straightforward way to interpret them in the domain of A^(AC, y), provided that bisimilarity is a congruence for all the ' In standard process-algebraic terminology, the elements in the domain of a model of some ACP-style equational theory are referred to as processes. However, Definition 3.3 defines a process as some kind of labeled transition system. The domain of model M{AC, y) consists of equivalence classes of such labeled transition systems. In the hterature on concurrency theory, the use of the term "process" for both equivalence classes of labeled transition systems and individual representatives of such equivalence classes is common practice and does not lead to confusion.
Partial-order process algebra
795
operators of (ACP* + RN + RSP* + SC)(AC, y). That is, the following property must be satisfied. Let © be an arbitrary n-ary operator in the signature of (ACP* -f- RN -h RSP* + SC)(AC, y), where n is some positive natural number; let p i , . . . , /?„, ^ i , . . . , ^;, be closed terms in C(AC) such that p\ ^q\,..., pn ^qn. Then, the congruence property requires thate(/7i,...,/7„)-®(^,,...,^„). 5.12 (Congruence). Bisimilarity, ^ , is a congruence for the operators of (ACP* + RN + /?5P* + SC){AC, y).
PROPERTY
PROOF. The property follows from the format of the derivation rules in Table 6. For details, the reader is referred to [5]. Note that the formulation of the derivation rules in Table 6 differs slightly from the formulation of such derivation rules in [5]. However, it is not difficult to verify that the two formulations are equivalent. An extensive treatment of the theory underlying the approach to defining the semantics of (algebraic) languages by means of derivation rules such as those of Table 6 can be found in [1], Chapter 3 of this Handbook. D
Informally, the congruence property says that equivalence classes of processes can be constructed independently of their representatives. Let p\,..., pn be closed terms in C(AC), where n is some positive natural number; for any M-ary operator 0 in the signature of (ACP* H- RN -h RSP* + SC)(AC, >/), function © is defined on equivalence classes of closed terms as follows: ©([pi]-^,..., [p,,]-) = [ © ( p i , . . . , /?«)]-. At this point, the construction of model M(AC, y) of the equational theory (ACP* 4RN + RSP* + SC)(AC, y) is complete. The domain consists of the equivalence classes of closed terms in C(AC) modulo bisimilarity; the interpretation of any of the constants in the signature of (ACP* + RN + RSP* -\- SC)(AC, y) is the corresponding equivalence class; the interpretation of any operator in the signature of the theory is that same operator lifted to equivalence classes of closed terms. Informally, two closed terms in C(AQ that are derivably equal in the equational theory (ACP* H- RN + RSP* + SC) (AC, y) yield the same equivalence class when they are interpreted in the model M(AC, y), which in turn implies that the corresponding processes are bisimilar. Thus, the equational theory (ACP* -h RN + RSP* -h SC)(AC, y) is a sound axiomatization of bisimilarity. THEOREM
5.13 (Soundness). For any closed terms p,q e C(AQ,
(ACP*-hRN-h/?5P* + SC)(AC,y)h/7 = ^ =^ M(AC,y)
\= p = q.
Since bisimilarity is a congruence for the operators of (ACP* -h RN -h RSP* -h SC)(AC, y), it suffices to show the validity of each of the axioms. Except for the recursion principle RSP*, it is not difficult to construct a bisimulation for each axiom. Note that the validity of Axioms CI, C2, C3, CFl, and CF2 can only be proven if it is assumed that the communication function is commutative and associative. To prove the validity of RSP*, assume that p,q. and r are closed terms in C{AQ; let 7^ be a bisimulation between p and q p -\- r,li can be shown that the following relation. PROOF.
796
J. CM. Baeten, T Basten Table 6 The transition relation for (ACP* + RN + /?5P* + SC)(AC, y) a,b.AC\f:
RF\ p, p\q,q'
: C(AO; p—^ p a pq—> p' q
p ^
a
p
a
q—>y/
p—> V
-^v pq—>q
(1
1
p+q —> V
p-\-q—>
^
p + q—> p' a
^'
q'
1
P ^ P p\q-^
p"\q
p\^q-^
p-^p',q—> pIIq p-^
p\\q'
q'.yia^b) dti. ^ p IIq
p\q ^
yJ,Yi(i^^) ^^^-
p IIq
a
yUi.h)
p\qa
P -^ \l^q -^ q',y(a,b)
,
, ..
/
h
,
p\q
p - ^ ^,q -^ .
P—>P p'^q-^
p' (p*q)
> Pfip ) q—>q
p*q-^q'
,
^v
p - ^ V, q —> q\ y(a, b) def. ,
p\q
pJ^p\f{a)^S Pfip)
^, yia,b) def. y(a.h)
p\q
,
>p
>q /
^'
,
y/, yia, b) def.
yUi.h)
def.
P—^ V pVq-^q
>p\\q
p\ q -^
P
>V
p\\q P\\q-
p - ^ p\q -^ q', yia,b) def. I
p\q-^^ V, y(a, b) def.
p\\q
> P P—> P p\q-^p'\\q
p-
p\\q-^q p - ^ V, q -^
yUi.h)
>q
,
p-^^,fia)^8 Pfip)
^ V
P—^V p*q-^p*q
q —^ V p*q-^\/
which uses the transitive closure of 7Z, denoted 7^"^, is a bisimulation between p and q*r, thus proving the vahdity of RSP*: {(/7,^*r)}U7^+U{(5,(7*r)hGC(AOU{V}A57^+p} U {(5, r • (^ *r)) I ^ G C(AQ U{^]Ate
C(AQ A 57^•^r • p}.
In [9], a detailed proof is given (in a setting with silent behavior).
D
Partial-order process algebra + pi) • s)
r • ({p\
r (Pl -^
P2)-S
Pi (
) P2
r
'{p\s -\- Pi-s) r P\S-\-
P2'S
P\l
j P2 s
S
s
797
s
Fig. 6. Visualizing the semantics of closed (ACP* + RN + /?5P* + SC)(AC, y) terms.
EXAMPLE 5.14. Since the basis of the semantics of (ACP* + RN + /?5P* + SC)(AC, y) is a process space, it is possible to visualize the semantics of closed terms in C(AC). Consider again Example 5.1. Figure 6 depicts the semantics of closed terms r • ({p\ + pi) • s) and r • (p\-s-\-p2'S). Clearly, these two processes are bisimilar, which conforms to Theorem 5.13 (Soundness) and the conclusion of Example 5.1 that the two closed terms are derivably equal.
Theorem 5.13 is an important result, because it shows that the equational theory (ACP* + RN + RSP* + SC) (AC, y) provides a meaningful framework for reasoning about the equality of concurrent processes. It is only possible to prove the equality of two processes if they are bisimilar. This raises the question whether it is always possible to prove the equality of two bisimilar processes in the equational theory (ACP* + RN + RSP* H- SC)(AC,y). An equational theory is said to be a complete axiomatization of some given model if and only if every equality that is valid in the model is also derivable from the axioms of the theory. To the best of our knowledge, it is still an open problem whether the equational theory (ACP* -h RN -h RSP* + SC) (AC, y) is complete for model M(AC, y). (Note, however, that it follows from the results of [59] that the theory (ACP* -h RN -h SC) (AC, y), which is obtained by removing the recursion principle RSP*, is not complete for A^(AC, y).) Interleaving process algebra. In the previous subsection, it has been defined when an equational theory can be characterized as an interleaving theory. As explained in the introduction, a model of an interleaving equational theory is called an interleaving semantics or an interleaving process algebra. However, algebras are well-known mathematical structures (see, for example, [37]) that are not necessarily derived from equational theories as is done in the previous paragraph. Therefore, in this paragraph, we focus on (single-sorted) algebras as mathematical structures in isolation. A single-sorted algebra is simply a structure that has a single domain of elements and a signature of functions of arbitrary arity on that domain. It is not possible to formally define when such a single-sorted algebra is a process algebra. However, the following informal definition suffices for our purposes. First, the elements of the domain of the algebra should represent processes, where a process is some abstract notion of the behavior of a (concurrent) system. Second, the functions in
798
J.C.M. Baeten, T Hasten
the signature of the algebra should correspond to meaningful process constants and composition operators on processes. In this paragraph, it is formalized when such a process algebra is an interleaving process algebra. In addition, it is shown that the model of the equational theory of Section 5.1 constructed in the previous paragraph is an interleaving process algebra. The formaUzation of the notion of an interleaving process algebra is based on ACP-style process algebra. However, it can be easily adapted to other process-algebraic frameworks such as CCS and CSP. Let ^ be a process algebra with domain V. The elements of V are referred to as processes. Assume that the signature of ^ contains a set of action constants AC. Furthermore, assume that the signature contains at least a (binary) choice operator -f, a sequential composition operator ", and a parallel-composition operator ||. In addition, the signature may contain an inaction constant 8. In order to define the notion of an interleaving process algebra, the concept of a process term in head normal form as defined in Definition 5.4 is adapted to the setting of a process algebra. The algebraic framework in this paragraph proves to be simpler than the setting of an equational theory in the previous subsection. The set of processes in a process algebra that have a head normal form can be defined without the use of an auxiliary predicate. DEFINITION 5.15 {Head normal form). The set of processes over the signature of the algebra A in head normal form, denoted H, is inductively defined as follows. First, AC c Ti. Second, if the signature of A contains an inaction constant 5, then also 8 is an element of H. Third, for any action a e AC and process d eV, the process <7 ~ J is an element of H. Finally, for any processes u,v eH, process w + f is an element of H.
A process algebra is said to be interleaving if and only if the set of processes in head normal form is closed under parallel composition. DEFINITION 5.16 (Interleavingprocess algebra). The process algebra ^ is an interleaving process algebra if and only if, for any processes u and u in H, also u \\ v eH. Let us recall the construction of the model of the equational theory of Section 5.1 in the previous paragraph. Assume that AC is some set of actions; let y be a communication function. The model M(AC, y) of theory (ACP* -I- RN -h RSP* + SC)(AC, y) is based on the set of closed (ACP* + RN + RSP* -h SC)(y4C, y) terms, denoted C(AQ. The domain of M{AC, y) has been defined as the set of equivalence classes of closed terms in C(AC) modulo bisimilarity. Furthermore, for any action constant a e AC, the interpretation a in the model has been defined as [«]-; similarly, the interpretation 8 of the inaction constant 8 has been defined as [8]^. Finally, for any n-ary operator 0 in the signature of (ACP* -h RN -h RSP* -h SC)(AC, y), where n is some positive natural number, the corresponding function 0 in the signature of M{AC, y) has been defined as follows: For any closed terms pi ,...,/?„ G C(AQ, 0 ( [ / 7 i ] ^ , . . . , [/?„]-) = [0(/?i,..., p«)]-. Clearly, model Ai{AC, y) is a process algebra in the general sense defined above. To prove that the algebra M(AC, y) is an interleaving process algebra, it is necessary to determine the set of processes in head normal form, as defined by Definition 5.15. The set of action constants AC of the algebra M(AC, y) can be defined in terms of the set
Partial-order process algebra
799
of actions AC as follows: AC = {a \ a e AC}. Furthermore, the signature of the algebra contains, among other functions, the desired choice operator + and sequential-composition operator ~. In addition, it contains the inaction constant 8. Thus, the set of processes of M(AC, y) in head normal form, denoted H(AC), is defined as in Definition 5.15, where AC plays the role of AC. The set of processes in head normal form is parameterized with the set of actions AC, because AC is defined in terms of AC which is a parameter of model M(AC, y). Thus, varying the value of parameter AC influences the set of processes in head normal form. Having defined the set H{AC), it is possible to prove that M(AC, y) is an interleaving process algebra. Note that the signature of A1 (AC, y) contains a parallel-composition operator, as required by Definition 5.16 (Interleaving process algebra), namely the operator ||. Essentially, the desired result follows from the fact that (ACP* + RN + RSP* + SC) {AC,y) is an interleaving equational theory and an auxiliary property stating that each process of M(AC, y) in head normal form can be expressed in the signature of the equational theory by a closed term that has a head normal form. THEOREM
5.17. The process algebra M. (AC, y) is an interleaving process algebra.
Let p and q be closed terms in C(AC) such that [p]^, [q]^ e HiAC). It must be shown that [p]^ \\ [q]^ e H(AC). It follows from Property 5.18 given below that there exist closed terms u and v in C(AO such that HNF(u), HNFiv), [u]^ = [/?]^, and [v]^ - [q]^. Hence, it suffices to prove that [«]- || [v]^ e HM- Since HNF(u) and HNF(v), it follows from Theorem 5.7 that HNF(u \\ v). Definition 5.4 (Head normal form) in the previous subsection implies that there exists a closed term in head normal form w G H(AQ such that (ACP* + RN + /?5P* -F SC)(AC, y)\-u\\v = w. Theorem 5.13 (Soundness) and the definition of validity yield that [u || i;]^ = [w]^. Clearly, it follows from the correspondence between Definitions 5.4 and 5.15 that [w]^ is an element of H(AC). Since [w]^ = [u \\ v]^ = [u]^ II [n]^, it is shown that [u]^ \\ [v]^ is an element of W(AC), which completes the proof. D PROOF.
Recall Definition 5.4 from the previous subsection, which formalizes when a closed term defined in the signature of the equational theory (ACP* -f RN + RSP* + SC) (AC, y) has a head normal form. The following property proves the claim made above that any process in the domain of A1 (AC, y) that is in head normal form, as defined by Definition 5.15, can be specified in the signature of (ACP* + RN + RSP* 4- SC) (AC, y) by means of a closed term that has a head normal form. It also proves the converse, namely that any process in M(AC, y) that can be specified by means of a closed term that has a head normal form, as defined by Definition 5.4, is indeed a process in head normal form, as defined by Definition 5.15. PROPERTY
5.18. For any closed term
[p]^ e HiAC) 4>(3q:qe PROOF.
Let/? be a closed term in
peCiAQ,
C(AQ A HNF{q): [q]^ = [p]^). C(A0.
800
J.CM. Baeten, T Basten
First, assume that [p]^ e H{AC). It must be shown that there exists a closed term q e C(AQ such that HNF(q) and [q]^ = [p]^. The proof is by induction on the structure of processes in H(AQ, as defined by Definition 5.15. (i) Assume that [p]^ = a, for some a € AC. It follows from Definition 5.4 (Head normal form) in the previous subsection that HNF{a). The observation that a — [«]~ completes the proof in this case, (ii) Assume that [p]^ = 8. Since HNF{8) and 8 = [8]^, term 8 satisfies the desired requirements, (iii) Assume that [p]^ =a~ [q]^, for some a eAC and q € C{AQ. Since a" [q]^ = [a ' q]^ and HNF{a • q), the term a • q satisfies the requirements in this case. (iv) Assume that [p]^ = [u]^ -f [ f ] - , for some u,v e C{AC) such that [M]^, [V]^ € H{AC). (Note that terms u and v are not necessarily elements of H(AC), in which case term u -\- v would have satisfied the requirements.) By induction, it can be derived that there must exist terms r and s in CiAQ such that HNF(r), HNF{s), [r]^ = [M]^, and [s]^ = [v]^. Hence, it follows from Definition 5.4 (Head normal form) that HNF(r -f s). Since, in addition, [u]^ + [v]^ = [r]^ -f [s]^ = [r -h 5]^, term r -\-s satisfies the requirements, which completes the first part of the proof. Second, assume that (^ is a term in C{AC) such that HNF{q) and [q]^ = [/7]~. It follows from Definition 5.4 (Head normal form) that there is a term r in H(AC) such that (ACP* -h RN + RSP* + SC)(AC, y)\-q=^r. Theorem 5.13 (Soundness) yields that [q]^ = [r]^. The correspondence between Definitions 5.4 and 5.15 implies that [r]^ is an element of H{AC). The observation that [q]^ = [p]^ = [r]^ completes the proof. D 5.19. Consider again Example 5.10. Let A again be the set of actions that includes the actions fl, b, and c; let y be the communication function {((a, b),c), ({b, a),c)}. Since the terms a \\ b and a - b -\- b - a ^ c are derivably equal in the equational theory (ACP* + RN -h RSP* + SC)(A, y), it follows from Theorem 5.13 (Soundness) that [a II b]^ = [a'b-]-b'a-{-c]^. That is, the two closed terms specify the same process in the model M{A,y). (Note that it is also straightforward to obtain this equality by defining a bisimulation between the two terms.) In the algebra MiA, y), the same process can also be written as « || ^ and a~b^b~a^c. Clearly, the latter expression is in head normal form, which means that process a || ^ is in head normal form, as required by Theorem 5.17. EXAMPLE
An interesting observation is that the proof of Theorem 5.17 does not use any specific characteristics of the equational theory (ACP* -f- RN -f RSP* + SC) (AC, y) or its model M(AC, y) other than the fact that the equational theory is an interleaving theory. Thus, the proof carries over to any model of any interleaving equational theory. This conforms to our informal definition of an interleaving semantics given in Section 1. Another interesting observation is that Property 5.18 can be strengthened in case the equational theory under consideration is a complete axiomatization of an algebra. In that case, any closed term over the signature of the equational theory that specifies a process in head normal form in the algebra must have a head normal form itself. Concluding remark. Both the equational theory (ACP* 4- RN + /?5P* -h SC) (AC, y) of Section 5.1 and its model A^(AC, y) given in this subsection are parameterized by a set of
Partial-order process algebra
801
actions and a communication function. These parameters provide the flexibihty to define, for example, a total-order semantics and a step semantics for concurrent systems, as shown in Sections 5.3 and 5.4, respectively. Since Theorem 5.17 proven above is independent of the choice for the parameters AC and y, both the resulting process algebras are interleaving algebras. Thus, the semantics of Section 5.4 is an interleaving, partial-order process algebra.
5.3. A total-order semantics In this subsection, the equational theory of Section 5.1 and its model of Section 5.2 are turned into a total-order framework for reasoning about the behavior of concurrent systems. The approach is illustrated by means of a few examples. The essence of a total-order semantics for concurrent systems is that no two actions can occur simultaneously. Thus, in this subsection, it is assumed that actions are atomic. 5.20 (Total-order semantics). Let A be some set of atomic actions. Let } / : A x A - > A b e a communication function on atomic actions. The model A1 (A, y) defines a (branching-time, interleaving) total-order semantics for (ACP* + RN + RSP* + SC)(AC,x). DEHNITION
As explained before, a fundamental property of a total-order semantics is that it is impossible to distinguish concurrency and non-determinism. In the setting of the equational theory (ACP* + RN -f RSP* + SC) (AC, y), this means that a (closed) term containing a parallel composition of two component terms must have the same semantics as a term specifying a non-deterministic choice between all possible totally-ordered interleavings of these two component terms. 5.21. To illustrate that the semantics of Definition 5.20 is indeed a total-order semantics, assume that A is some set of atomic actions including the actions p\, pi.r, and s. Assume that y is the communication function that is undefined for all the elements in its domain. That is, there is no communication. Consider the following derivation. Since sequential composition is associative (Axiom A5), redundant brackets are omitted. EXAMPLE
r-{p\
=
{Axioms CMl,CM2(2x)} r'{p\
=
\\P2)'S
' Pi-^pi'
p\+
p\
\P2)-S
{Definition y; Axioms CF2, A6} r'{p\ • Pl-^pi' p\)'S.
This derivation shows that a term specifying the parallel composition of actions p\ and P2 is derivably equal to a term specifying a non-deterministic choice between two totallyordered alternatives. Theorem 5.13 (Soundness) implies that the two closed terms must
802
J.CM. Baeten, T Hasten
correspond to the same process in the semantics of Definition 5.20. Clearly, the semantics of both terms can be visualized by the process depicted in Figure 1(d), where dots correspond to closed terms. In the previous example, communication plays no role. The following example shows a typical use of the communication function in ACP-style process algebra. Communication is used to enforce synchronization between parallel components. EXAMPLE 5.22. Let A be some set of atomic actions that includes the actions ri, 1*2, ^2, Q, and 53. Let y be the function {((^2,5*2), Q ) , (fe, ^2), Q ) } - Informally, a process performing an action r/ with / G {1, 2} receives a message of its environment over some port /. If a process performs an action 5, with / G {2, 3}, it sends a message to its environment over port /. An action ci represents a communication over port 2, which is a synchronization of a send action and a receive action. A process B\ 2 that repeatedly receives a message over port 1 and then forwards this message over port 2, thus corresponding to a one-place buffer for messages, can be specified as follows: B\2 = {r\ • siY^. It follows from Axioms BKS\ and A6 that this specification represents a non-terminating iteration. Similarly, process ^2.3 = (^2 • '^3) *^ represents a one-place buffer for messages that receives messages over port 2 and sends messages over port 3. In a number of steps, it can be shown that the composition of the above two one-place buffers yields a two-place buffer that receives messages from its environment over port 1 and sends messages to its environment over port 3. The composition is a parallel composition with the restriction that the two buffers must communicate over port 2. The following auxiliary derivation shows how a non-terminating iteration can be unfolded one cycle:
B\,2 =
{Substitution} (n-^2)*5
=
{Axiom BKS1; substitution} (ri •52)-^i.2 + <5 = {Axioms A5, A6} r\
'S2'Bi2-
The next derivation shows how to calculate the first action of the abovementioned parallel composition of the two one-place buffers. To enforce communication over port 2, isolated occurrences of send and receive actions over port 2 must be encapsulated. Therefore, let H = [r2,S2). a//(B,.2||B2.3) = {Axiom CM 1} =
a//(^l,2 IL ^2,3 + ^2.3 IL ^1.2 -h ^1.2 I % 3 ) {Derivation above; Axiom CM3(2x); Axiom CM!)
Partial-order process algebra dH{r\ • (S2 • Bi2 II B23)-hr2
803
' to • B23 II ^1.2)
+ ( n k 2 ) • fe • ^1.211^3 • ^2.3))
=
{Axiom CF2; Axioms D3(2x), D4(3x), Dl(2x), D2}
n • a//fe • Bxa II B2.3) + ^ • a//(^i.2 II ^3 • ^2.3) + 5.a//(52-iBK2lh3-^2,3)
=
{Axioms A6, A7(both2x)} ri 'dH{s2'B\2
II ^2.3).
Similar derivations yield the following results. The receipt of a message over port 1 is followed by a communication action over port 2, after which, in any order, a new message may be received over port 1 and the first message may be send to the environment over port 3. ^H{S2'B\2\\B23)
=
C2'dH{Bx2\\s^-B23)
= C2 • ( n • dH{S2 ' Bx2 II ^3 • ^2.3) +^^3 ' ^H{B\^2
II ^2.3))
= C2 • (ri • 53 • ^H{S2 ' Bx2 II ^2.3) + ^3 • r\ • 3//to • ^1.2 II ^2,3)) = C2-(r\ -S3-\-S3,'r\)-dH(s2'
B\^2 II ^2.3).
Summarizing the results obtained so far yields the following two equations. dH(B\,2 II ^2.3) = n . dH{s2 • B\,2 II ^2.3) and ^H{S2 • B12 II ^2.3) = Q • (r, .53 -h^3 -^i) • 9//to • Bu2 II ^2.3). The second equation defines a non-terminating iteration, as can be shown by applying Axioms A 6 and/?5P*: 9//fe • Bi2 II ^2,3) = ( 0 • (n -53+53 • ri))*5. Substituting this result in the above equation for 9//(5i.2 II ^2,3) yields that dH(Bu2 II ^2,3) = n . ((c2 • (ri .53 +53 •r,))*5). Finally, as in the previous example, it can be shown that the choice in the last result corresponds to a parallel composition: r\ •53-f 53-ri
=
{Axiom A6} r\ 'S3-\- S3 -r\-{-8
=
{Axiom CF2; definition y} r\ •53-f 53-ri H-ri [53
=
{Axioms CM2(2x), CMl} r\ II 53.
804
J.CM. Baeten, T Basten 4.
A /i
n
53
r\[
53
(a)
(b)
Fig. 7. A two-place buffer in a total-order semantics:
Thus, the final result for the composition of the two one-place buffers is the following: a//(5l.2ll^2.3) = ri-((c2-(r, ||53))*5). It is not difficult to see that the right-hand side of the above equation specifies the behavior of a two-place buffer. Its semantics is depicted in Figure 7(a), where closed terms are represented by dots. Figure 7(b) shows the process that results from hiding the internal communication action Q . Clearly, this process exhibits the behavior that is intuitively expected from a two-place buffer. In the current algebraic framework, it is not possible to hide actions. The extension of ACP-style process algebra with an abstraction operator is described in [6,14,25]. It goes beyond the scope of this chapter to treat abstraction in detail.
5.4. A step semantics As in Sections 3 and 4, the basis of a step semantics is to assume that actions are bags of atomic actions. The occurrence of a bag of multiple atomic actions represents the simultaneous execution of its elements. The communication function can be used to specify which actions can be executed in parallel. DEFINITION 5.23 {Step semantics). Let A be some set of atomic actions. Let y : B(A) x B{A) -^ B{A) be some communication function. The model M{B{A),y) defines a (branching-time, interleaving) step semantics for (ACP* -h RN-hRSP* -h SC)(AC, y), provided that the communication function y allows that actions may be executed concurrently. EXAMPLE 5.24. The most straightforward definition for the communication function y in the semantics of Definition 5.23 is to define y as summation of bags: y = l±). Assume that A includes the atomic actions p\, pi.r, and s. Consider the processes specified by k ] • ([/^i] • [P2\ + [P2\ • [p\]) • [s] and [r] • ([pi] \\ [p.J) • [s]. In (ACP* + RN + RSP* + SC)(B(A), l±)), it is not possible to prove that these two terms are equal. The corresponding processes in the semantics of Definition 5.23 can be visualized as in Figure 2. As explained before, these two processes are not bisimilar.
A disadvantage of choosing bag summation for the communication function is that it is no longer possible to do derivations such as the ones in Example 5.22. Choosing bag
Partial-order process algebra
805
summation for the communication function means that any action may occur concurrently with any other action. Bag summation cannot be used to enforce communication between actions or to enforce a total ordering on the execution of certain actions that are in conflict with each other. The latter means that actions can neither communicate or happen concurrently. One solution to combine concurrency with communication and conflicts is to carefully define an appropriate communication function. 5.25. As in Example 5.22, let A be some set of atomic actions including f'\,r2,S2,C2, and S3. Recall that the indices of these actions correspond to port numbers. Informally, the communication function can be specified as follows. The only communication is the simultaneous execution of send action si and receive action r2, which results in the communication action ci- Any number of atomic actions that cannot communicate can occur in parallel as long as no two of these actions use the same port. Actions using the same port are in conflict and must, therefore, be totally ordered. To formalize the definition of the communication function, the auxiliary predicates conflict c B(A) and communication c B(A) are defined as follows. For any a e B(A), EXAMPLE
conflict(a) 4> (3a :a e A: [a'] ^ a) v [r2, C2] ^ a v [^2, Q ] ^ «
and
communication(a) 4> [^2,^*2]^ causing these two predicates, the communication function y is defined as follows. Note that a bag of atomic actions containing no conflicts can contain at most one pair of atomic actions ^2 and ^2. For any a, p e B{A), -^conflict{a l±) j6) A communication(a l+i ^) => y(a, fi) = (a ^ fi) — [s2, ^2] W [ o ] , -^conflict(a l±) j8) A -^communication(a \S P) =^ y{a, P) =a^P, and conflict(a l±) ^) => y{a, P) is undefined. It is not difficult to verify that this communication function is conmiutative and associative. In the framework of this example, the two one-place buffers of Example 5.22 can be specified as follows: B\ 2 = {[r\] • [5"2]) *8 and ^2.3 = ([n] • to!) *^- Also in the current setting, it is possible to show that the parallel composition of the two buffers while enforcing conmiunication corresponds to a two-place buffer. To enforce communication, actions that contain isolated send or receive actions over port 2 must be encapsulated. Therefore, let H C B(A) be defined as the set {a e B{A) \r2 eav S2 ^ot}- Calculations very similar to the ones in Example 5.22 lead to the following results: a//(^1.2 II ^2.3) = In] • dH([S2] • Bu2 II B2.3) a//([^2] • B12II ^2.3) = [C2] • a//(5i.2 II k3] • B2.3) = [c2]-([n]-a/y(M-^i.2llk3]-^2.3)
+ k3]-a//(^1.2ll^2.3) + [n,^3]-a//(k]-^1.2ll^2.3) ) = [C2] • ([n ] • [^3] + k3] • [ n ] + [ n , ^3]) •dH([S2]-Bi,2\\B23).
806
J. CM. Baeten, T. Basten
The main difference between the above results and the corresponding results in Example 5.22 is that, in the current setting, the actions r\ and 53 can occur concurrently, whereas this is not possible in Example 5.22. Example 5.22 shows how a parallel composition is rewritten into a non-deterministic choice of totally-ovdtYtd interleavings. In the current example, a parallel composition is rewritten into a non-deterministic choice of partiallyordered interleavings, namely the interleavings of all the steps that the parallel composition can perform. These observations conform to our remark made earlier that both the total-order framework of the previous subsection and the partial-order framework of this subsection are interleaving frameworks. Note that one of the above results is a recursive equation. Using RSP*, the axioms for the three merge operators, and the definition of the communication function, the following result can be derived. Again, the calculations are very similar to the ones in Example 5.22. a//(5K2 II ^2,3) = [n] • (([C2] • ([/-,] II fe]))*5). Figure 8(a) visualizes the semantics of the two-place buffer. Figure 8(b) shows the process that results from hiding the internal communication action [ Q ] . Observe that the approach of Example 5.25 can be adapted to obtain a total-order setting by specifying that any two atomic actions are in conflict unless they communicate. The result is that any process can only execute steps consisting of a single atomic action. The attentive reader might have noticed that in the calculations of Example 5.25 no conflicts between atomic actions occur, as specified by the auxiliary predicate conflict. Thus, for the above example, the communication function can be simplified. Nevertheless, the definition of conflicts can be meaningful, as the following example shows. EXAMPLE 5.26. Assume that the set of atomic actions A, the predicates conflict, communication c fi(A), the communication function y : B{A) x B{A) -^ B{A), and the set of actions H c B{A) are defined as in Example 5.25. Consider the following two processes: S = ([r\] • [^2] • k2])*^ and C = (([r\] \\ [r2]) • (fc] I ['ya])) *^. Process C, a calculator, models an iterative process of which a cycle starts by receiving two messages over ports 1 and 2. Ports could, for example, be metal wires and messages could be electrical signals. After C has received both signals, it simultaneously
[ri]l
\[S3]
In] I \ls3]
(a)
(b)
Fig. 8. A two-place buffer in a step semantics.
Partial-order process algebra
807
sends a result signal over port 3 and a confirmation signal over port 2 to indicate that both input signals have been read. Process 5 is a simple synchronized buffer that forwards a signal from port 1 to port 2; before it reads its next signal over port 1, it waits for a confirmation over port 2. Intuitively, the parallel composition of processes S and C, enforcing communication over port 2, should yield an iterative process that in each cycle reads two signals over port 1 and sends a result signal over port 3. Recall that the definition of the predicate conflict is such that no two atomic actions using the same port can occur simultaneously. The results below confirm that the composed process starts with a single r\, which is either performed by 5 or by C. It does not have the option to read its two inputs simultaneously. After the derivation of the first action, the calculations are very similar to the ones in the previous examples. dH{S\\C)
= [n ] • 9// ([^2] • [^2] • 5 II C) + [r, ] . a/y (5 II [rj] • (U2] I [^3]) • C) = (ki] • ([n ] • [ci] + [C2] • [r 1 ] + [r,, C2]) + [r, ] . [r 1 ] . [o]) 'dH{[r2]'S\\as2]\[s3])-C)
= [In] • ([ri] II [C2]) + [ r , ] . [ri]. [cij) • [ Q , 53] • dniS \\ C) = ([n]-[c2]||[ri]).[c2,^3]-a//(^l|C). Thus, it follows from /?5P* that dH(S II C) == (([ri] • [C2] II [r,]). [C2, ^3])*^. Ignoring communication actions C2, the result is indeed a process that, in each cycle, reads two signals over port 1 and sends a result signal over port 3. The approach to combining communication and concurrency, including conflicts, in the communication function can be generalized to larger examples. However, the resulting communication function may become complex and intuitively difficult to understand. Another solution to combine concurrency with communication in the current framework is to allow arbitrary concurrency between actions, as in Example 5.24, and to use renaming operators to make conflicts and communications explicit. This approach is very similar to the approach to combining concurrency and communication in ACP-style process algebra taken in [4]. 5.27. Let A be the set of atomic actions defined in Example 5.25. Assume that the communication function y on bags of atomic actions equals bag summation l±l. Using the auxiliary predicates conflict and communication of Example 5.25, the renaming functions c / , cm : (B(A) U {8}) -> (B(A) U {8}) are defined as follows. For any a e B(A), EXAMPLE
cf(8) = 8,
conflictia)^cf(a)
= 8,
and
-^conflict(a) =^ cf (a) = a
808
J.C.M. Baeten, T Basten
and cm{8) = (5, communication{a) =^ cm(a) = a — [s2, rj] W [ o ] , -^communication(a) =>- cm(a) = a.
and
Given these definitions, it is not difficult to obtain results similar to Examples 5.25 and 5.26. The basic idea is to start with the parallel composition of component processes, resolve conflicts according to the renaming function c / , and enforce communication by renaming actions according to renaming function cm and encapsulating actions with isolated atomic actions that should have participated in a communication. Let H c BiA) be the set {a e B(A) I r2 € a V 52 e Of}, as defined in Example 5.25. a//(pcm(Pc/(Bi.2 II ^2.3))) = In]' (([C2] • ([r,] II [53]))*5) dH{pcm{Pcf(S II C))) = (([r,]. [Q] II [r,]) • [0,53])*5,
and
where B\2 and B23 are the two one-place buffers defined in Example 5.25 and S and C are the synchronized buffer and the calculator of Example 5.26. Example 5.27 generalizes to larger examples in a rather straightforward way. In general, the definition of a renaming function removing all conflicts from a process term is not very complicated. The most straightforward way to obtain a renaming function handling an arbitrary number of communications is to define such a function as the composition of a number of auxiliary renaming functions that each rename a single pair of communicating atomic actions. Section 7 explains more about renamings and communication functions in a setting with steps. Finally, observe that, unlike the approach of Example 5.25, the approach of Example 5.27 cannot be adapted to obtain a total-order setting. In the approach of Example 5.25, conflicts and communications are defined in the communication function. Thus, the communication function can be used to enforce a total ordering of (steps of) single atomic actions. In the approach of Example 5.27, the communication function is fixed to bag summation. A total ordering of atomic actions can only be enforced explicitly by means of renaming.
5.5. Concluding remarks Summarizing the results of this section, it has been shown how to develop an algebraic framework for equational reasoning both in a total-order setting and in a partial-order setting. In addition, the notion of a (non-)interleaving algebraic theory has been formalized. It has been shown that standard ACP-style process algebra always leads to an interleaving framework. An interesting consequence is that the algebraic framework of Section 5.4 can be characterized as an interleaving partial-order theory. This observation conforms to our claim made in the introduction that interleaving versus non-interleaving and total-order versus partial-order are complementary characterizations of process-algebraic frameworks.
Partial-order process algebra
809
The basis of the step semantics for concurrent systems presented in Section 5.4 is the communication function of ACP. It can be used to specify which atomic actions are causally independent and, thus, may occur concurrently. Examples 5.25 and 5.26 show how to combine communication and concurrency in the definition of the communication function. Example 5.27 illustrates another approach that makes conflicts and communications explicit by means of renaming operators. The latter approach generalizes more easily to larger examples than the former. In the next section, a third approach to combining concurrency and communication is studied, which is inspired by the theory of P/T nets developed in Section 4. The basic idea is to use the communication function of ACP solely for the purpose of concurrency, as in Examples 5.24 and 5.27, and to introduce a new operator that can be used - to some extent - to resolve conflicts and to enforce (asynchronous) communication between parallel components. This new operator is inspired by the notion of transition firing in the framework of P/T nets.
6. The causal state operator In the P/T-net framework of Section 4, the behavior of a P/T net is determined by its marking. The order in which tokens in the marking are consumed and produced determines the order in which actions are executed. Thus, in the P/T-net framework, the mechanism of consuming and producing tokens is the basic mechanism for introducing causal relationships between actions. In this section, the equational theory of the previous section is extended with an algebraic operator, called the causal state operator, that is inspired by the idea of consuming and producing tokens. The causal state operator plays an important role in adopting the causality mechanism of Petri nets into process algebra. In ACPstyle process algebra, the standard means to enforce causal relationships between actions are sequential composition and communication. The causal state operator is sufficiently powerful to replace to some extent this standard causality mechanism, in particular, the standard communication mechanism. As a result, the communication function can be used to develop a framework with a step semantics, as explained in the previous section, thus combining the strength of communication and concurrency. An interesting application of the equational theory developed in this section is that it can be used to define an algebraic semantics for labeled P/T nets that conforms to the step semantics for labeled P/T nets defined in Section 4.
6.1. The equational theory The causal state operator is a specialization of the so-called state operator. The state operator is an operator which has a memory to explicitly describe the state of a process. For a detailed treatment of the state operator, the reader is referred to [3,5,6,25]. A variant of the causal state operator first appeared in [4]. Table 7 presents the Algebra of Communicating Processes with iteration and causal state operator, renaming, the Recursive Specification Principle for the binary Kleene star, and standard concurrency, abbreviated ACP* + RN 4- RSP* -h SC. It is parameterized by
810
J.C.M. Baeten, T Basten Table 7 The equational theory (ACP? + RN + RSP* + SC)(AC(C, A), y) (ACPJ -f RN + RSP'' + SC)(/1C(C, A), / ) (ACP* + RN + /?5P* + SC)(AC(C, A), y)
A:,y: P ;
X^^{S) = 6
C501
ca\I
C502
^m => Xljj(a) = a
ca[/^m
C503
=> A/„(a) = 5
A/„(t? • JC) = A/„(a) k^
r,, , . , ( A )
^mU + v) = X/„U)4-A/„(y)
C504 C505
a set of actions AC(C, A), which is itself parameterized, and a communication function y :AC(C, A) x AC(C, A) -^ AC(C, A). A detailed explanation is given below. In order to reason about places, tokens, token consumption, and token production in an equational way, it is necessary to introduce these notions in the equational theory. In a P/T net, the flow relation between places and transitions defines the token consumption and token production of a particular transition. The most straightforward way to introduce the notions of consumption and production in a process-algebraic setting is to include the information in the actions. The two parameters of the set of actions AC(C, A) correspond to a set of so-called causes and a set of atomic actions, respectively. Causes are the algebraic equivalent of places and tokens in the P/T-net framework. In the remainder of this section, an action is assumed to be a triple in B(C) x B(A) x B{C). That is, AC{C, A) = B{C) x B(A) X B(C). The second element of such a triple denotes the actual step of the action; the first element represents the consumption of causes of the step and the third element its production, similar to the notions of token consumption and token production in the P/Tnet framework. Three auxiliary functions on actions in AC{C, A), c, p:AC(C, A) -> B(C) and s :AC(C, A) -^ C(A), are defined. For any (7 = (c, a, p) in AC(C, A), ca = c, pa = /?, and sa=a. Note that the exact structure of actions is not really important as long as these auxiliary functions can be defined. The causal state operator is, in fact, not a single operator. Theory (ACP* + RN + RSP* -h SC)(AC(C, A), y) contains an entire class of causal state operators, namely one operator A.^ for each / c C and m € 6(7). Set / can be seen as a set specifying internal causes. Causes not in / are referred to as external causes. Note that m is defined to be a bag of internal causes. In the term X/„(x), where jc is a process term of sort P, bag m represents the current state of process JC, similar to a marking in P/T-net theory. For this reason, bag m is also referred to as the marking of x. The separation between internal and external causes provides the flexibility to distinguish between communication within a process and communication between the process and its environment. In standard P/T-net theory as introduced in Section 4, places and tokens are not divided into internal and external places and tokens. However, when a notion of modularity is introduced in P/T-net theory, as in
Partial-order process algebra
811
[8, Chapter 3], the separation between internal and external places and tokens becomes meaningful in the P/T-net framework. Section 8 treats this topic in more detail. The axioms for causal state operators in Table 7 are inspired by the notion of transition firing introduced in Section 4. Constant a ranges over AC(C, A). Axioms CS02, CS03, and CS04 are the most interesting ones. The other two should be clear without further explanation. Axiom CS02 states that an action may occur provided that its consumption of internal causes is available in the marking. Axiom CS03 says that if not enough causes are available, an action cannot be executed and results in a deadlock. Axiom CS04 states that the result of executing an action is that the consumption is removed from the marking, whereas the (internal) production is added to the marking. If the marking does not contain enough internal causes to execute the action, then the combination of Axioms CS03 and Al guarantees that the result is a deadlock. The axiomatization assumes that the environment of a process is responsible for consuming and producing external causes. The intuition behind verifications by means of the causal state operator is the following. Given a number of components, as before, the parallel composition of these components is the starting point. The communication function is defined in such a way that it allows arbitrary concurrency. Thus, the parallel composition defines the largest behavior that is possible when combining the basic components. A causal state operator is used to restrict the composition to those behaviors that are allowed in the initial state of the composition, as defined by the subscript of the state operator. Thus, the causal state operator enforces causal orderings between actions. As in the previous section, the expansion theorem of Theorem 5.2 can be used to simplify calculations with parallel compositions. It carries over to the theory (ACP* 4- RN-\-RSP* + SC)(AC(C, A), y). The proof is identical. The next theorem is a specific instance of the expansion theorem which is often useful in derivations following the above approach. 6.1 (Expansion of iterations). Let ao,..., a^ be actions in AC{C, A), where n is a positive natural number. Let I be the set {0,..., «}.
THEOREM
(ACP^ -h RN + RSP"" -h SC)(AC(C, A), y) h (11/ : / e / : a/ *5) = (+7 : 0 C y c / : (|y : y G y : aj) • (||/ -iel:
a, *5)).
PROOF. It is a straightforward consequence of Theorem 5.2 and the axioms of (ACP* + PIN + /?5P* + SC)(AC(C, A), y). D
6.2. Let C be a set of causes including the causes 1,2, 3,4, 5, and 6; let A be a set of atomic actions containing r, p\, p2, and s. The following are examples of actions in ACiC A): ([1], [r], [2, 3]), ([2], [/7,], [4]), ([3], [p.l [5]), and ([4,5], [si [6]). To better understand this example, it might be helpful to consider the P/T net in Figure 4. To improve readability, in the remainder of this example, square brackets of singleton bags are omitted. The communication function is used to specify concurrency. In principle, any action may occur in parallel with any other action. To formalize this communication function, the bagsum operator is overloaded to actions in AC{C, A) as follows: For any a, be ACiC, A), a\Sb = (ca \+)cb, sa ItlsZ?, pa^Spb). Thus, the communication function y on pairs of actions in AC{C, A) is defined as i±). EXAMPLE
812
J.CM. Baeten, T. Basten
Consider the parallel composition of the non-terminating iterations of the four actions introduced above: X = (1, r, [2,3])*(51| (2, p\, 4)*5 || (3, pi, 5)*5 || ([4, 5], 5,6)*(5. Parallel composition X specifies the process that may execute any (non-empty) subset of the four actions simultaneously an arbitrary number of times. As explained, the causal state operator can be used to restrict a general parallel composition such as X to all the behaviors allowed when starting from some given initial state. Assume that all relevant causes are internal. That is, / = {1, 2, 3,4,5,6}. Furthermore, assume that the initial state of the process contains a single cause 1. In the equational theory (ACP* + RN + RSP"" + SC)(v4C(C, A), W), the following results can be derived. Theorem 6.1 (Expansion of iterations) is used to simplify the calculations. Note that, according to this theorem, the parallel composition of four iterations can perform^/r^^n different initial actions. However, in the initial state of process X, only one of these fifteen actions can actually occur. X[{X) = (l,r,[2,3]).Af2.3j(X) = (l,r,[2,3]).((2,/7,,4).A^V4jW + (3,/^2,5).A(^5j(X) + ( [ 2 , 3 ] , [ / 7 I , / 7 2 ] , [ 4 , 5 ] ) . A ; 4 5J(X))
= (l,r,[2,3]).((2,/7i,4).(3,/72,5) + (3,/72,5).(2,/7,,4) + ([2,3],[/7,,/72],[4,5]))a^V3,(X) = (l,r,[2,3]).((2,/7i,4)||(3,;.2,5)).([4,5],^,6).A^(X) = (l,r,[2,3]).((2,/7i,4)||(3,p2,5)).([4,5],^,6).5. Note that the process A ( ( X ) executes each of the four actions introduced above only once, while the parallel composition X may execute each of the actions an arbitrary number of times. Another interesting observation is that X\ (X) ends in a deadlock. It does not terminate successfully. However, the attentive reader might notice the resemblance between this last result and the behavior of the P/T net of Figure 4 in the step semantics of Definition 4.13 (see Example 4.14). As explained in Section 4, the usual semantics of P/T nets does not distinguish deadlock and successful termination. In Section 6.3, an algebraic semantics for labeled P/T nets is defined in which the term X\ (X) forms the core of the semantics of the P/T net of Figure 4. In the final result of the derivation in the above example, consumptions and productions of causes are visible whereas the consumption and production of tokens is not visible in the semantics of labeled P/T nets. However, in the algebraic framework, causes are only needed to enforce a causal ordering between actions. In general, it is not necessary that causes are visible in the final result of derivations as in Example 6.2. Therefore, a new class of algebraic operators, the so-called cause-abstraction operators, is introduced. A cause-abstraction operator can be used to hide consumptions and productions of causes. It is a renaming operator, as introduced in Table 2. In order to gain flexibility, a set of (internal) cause identifiers specifies which consumptions and productions must
Partial-order process algebra
813
be hidden. For any set of cause identifiers / c C, the corresponding renaming function ca(I): {AC(C, A) U [8]) -^ {AC(C, A) U {8}) restricts the bags representing the consumption and the production of an action to those causes not in /. As required, ca(8) = 8. Furthermore, for any (c, a, p) E AC{C, A), ca(/)(c, a, p) = {c\{C\ / ) , a,p\{C\ /)). EXAMPLE 6.3. Let C, A, y, X, and / be defined as in Example 6.2. For the sake of readability, a triple (0, a, 0) G AC{C, A) is identified with its second element a. It is not difficult to verify that
Pca(/)(At'l]m) = [r].([/7,]||[/72]).[5]-5.
It is clear that the right-hand term is an appropriate algebraic expression for the behavior of the labeled P/T net of Figure 4. As mentioned in the introduction to this section, the causal state operator can be used to replace to some extent the standard communication mechanism in ACP-style process algebra. A good example illustrating the use of communication is the specification of a two-place buffer in terms of two one-place buffers (see Examples 5.22, 5.25, and 5.27). Thus, it is an interesting question how to specify a two-place buffer by means of a causal state operator. EXAMPLE 6.4. Consider Example 5.27. It is straightforward to adapt the specification of the two-place buffer given in that example to the current setting where actions include input and output causes. Recall that, in Example 5.27, explicit renaming operators are used to resolve conflicts and enforce communications, which has the advantage that the communication function can be used to create a partial-order framework. Hence, assume thatparametery of the equational theory (ACP*+RN + /?5P*+ SC) (A C(C, A), y) of this subsection equals bag summation W on actions in AC{C, A). Let A be some set of atomic actions that includes the actions ri, r2, 52, C2, and sy, let C be a set of causes including the causes 1,2, 3,4, and 5. Assume that a bag a e B{A) denotes the action (0, a, 0) in AC{C, A). Under this assumption, the two terms B\,2 = {[r\]-[s2\)*8 and B2.3 = ([r2] • [^3])*^ specify two oneplace buffers. In order to specify a two-place buffer, it is necessary to resolve conflicts and enforce communication. Since conflicts play no role in the behavior of the two-place buffer, it suffices to adapt the renaming function cm of Example 5.27 to the current setting where actions contain information about causes. This renaming function can be lifted to actions in AC{C, A) as follows. For any (c, a, p) e ACiC A), cm(c, a, p) = (c, cm{a), p). To enforce communication, actions containing isolated atomic actions that should communicate must be encapsulated. Therefore, let H c AC{C, A) be the set {(c, or, p) e AC(C, A) | r2 € aVS2Ea}. The two-place buffer can now be specified as follows:
a//(Pc/n(^1.2ll^2.3)).
(1)
814
J.C.M. Baeten, T Basten
It is not difficult to verify that it can be derived from the axioms of (ACP* -h RN -h RSP"" -h SC)(AC(C, A), l+i) that this term is equivalent to the following term: [n]-(([c2]-([n]||fe]))*^)-
(2)
It is also possible to specify a two-place buffer by means of a causal state operator. The specification follows the same approach as the one illustrated in Examples 6.2 and 6.3. Let / be the set of causes {1, 2, 3,4, 5}. Consider the following specification: />ca(/)(V,,2](([l' 2], [r,], [3])*5 II ([3], [C2], [4, 5])*5 ll([4],[n],[l])*5||([5],[53],[2])*5)).
(3)
Calculations similar to the calculations in Example 6.2 show that also this specification is derivably equal to term (2). Hence, the two specifications of a two-place buffer using (explicit) communication and a causal state operator, respectively, are equivalent. However, it is interesting to compare these two specifications. Considering term (2), which is clearly the most concrete representation of the behavior of a two-place buffer, specification (1) is in some sense more abstract than specification (3). Specification (1) is a modular specification that specifies the two-place buffer in terms of two one-place buffers. It contains actions that cannot occur in isolation, but must participate in a communication. Specification (3) emphasizes the causal ordering of actions. It contains only actions that also occur in term (2). The explanations concerning the behavior of the causal state operator given in this subsection, are based on an intuitive understanding of its operational semantics. The next subsection formalizes the semantics of the causal state operator.
6.2. A semantics As in Section 5.2, the basis of a semantics for the theory (ACP* -f RN -h /?SP* -h SC)(AC(C, A), y) is a process space. Let C{C, A) be the set of closed (ACP* + RN -f RSP"" + SC)(AC(C, A), y) terms. The set of processes of the process space is the set C(C, A) U [^}, where ^ is the special process that can perform no actions, but can only terminate successfully. The set AC{C, A) is the set of actions of the process space. The transition relation _ —^ _ c {C(C, A) U [J]) x AC{C. A) x {C{C, A) U {V}) is the smallest relation satisfying the derivation rules in Tables 6 and 8. The termination predicate is the singleton {^J). The process space {C(C,A) U (V), AC(C, A), ^ , {V}) can be turned into a model M{C, A, y) of the equational theory (ACPJ -h RN + /?5P* + SC)(AC(C, A), y) following the same approach as in Section 5.2. The following property is needed in the construction. 6.5 (Congruence). Bisimilarity, ^ , is a congruence for the operators of (ACP* + RN + RSP"" + SC)(AC(C, A), y).
PROPERTY
Partial-order process algebra
815
Table 8 The transition relation for the causal state operator a : AC{C, A); / : V(C); m : B{1)\ p, p': C{C, A)\ ( I f
a
p—>p K^^cal^P^ - ^ Ki^pa\l^P">
/
p—^ V K^^caU^P"^ " ^
^
PROOF. The property follows from the format of the derivation rules in Tables 6 and 8. For details, the reader is referred to [5] and [ 1 ], Chapter 3 of this Handbook. D
The following theorem formulates the important result of this subsection. The equational theory (ACP^ + RN + /?5P* -h SC)(AC(C, A), y) is a sound axiomatization of the model of closed terms modulo bisimilarity. THEOREM
6.6 (Soundness). For any closed terms p,q e C{C, A),
(ACP* + RN + RSP"" -f SC)(AC(C, A),Y)^p
= q^
X ( C , A, y) |= p = ^.
PROOF. Given Theorem 5.13 and Property 6.5, it suffices to show the validity of the Axioms CSO\ through CS05. It is not difficult to construct a bisimulation for each case. D EXAMPLE 6.7. Consider again Examples 6.2 and 6.3. Recall that the communication function y is defined as bag summation on AC{C, A). Omitting consumptions and productions of causes and representing closed terms by dots, the semantics of the term Pca(/)(>^fi](^)) in the model M{C,A, l+i) is visualized by the process in Figure 2(b) when removing the option to terminate successfully. The model M{C, A, l±)) defines a (branching-time, interleaving) step semantics for the equational theory (ACP* + RN -h /?SP* + SC)(AC(C,A),l±)). The model M{C, A, y) defined in this subsection can also be turned into a total-order semantics. Assume that ± is the communication function that is undefined for every pair of actions. Consider again the term Pca(/)(A/,|(X)). The semantics of this term in model M{C, A, _L) is visualized by the process in Figure 2(a) when, again, removing the option to terminate successfully.
6.3. An algebraic semantics for labeled P/Tnets The causal state operator is inspired by the notions of consumptions and productions of tokens in Petri-net theory. Therefore, it is interesting to study the relationship between the algebraic theory of the previous two subsections and labeled P/T nets as introduced in Section 4. The goal of this subsection is to define an algebraic semantics for labeled P/T nets that is consistent with the step semantics of labeled P/T nets given in Definition 4.13. Recall from Section 4 that U is some universe of identifiers, including place and token identifiers, and that L is some set of transition labels, which has been used to define steps
816
J.CM. Baeten, T Basten
in the P/T-net framework. The set of actions is defined as AC{U. L). That is, an action is a triple in B{U) x B{L) x B{U). To obtain an algebraic semantics for labeled P/T nets, each labeled P/T net is translated into a closed (ACP^ + RN + /?5P* + SC)(AC([/, L), y) term, where y is some communication function on AC{U, L). The communication function is a parameter of the algebraic semantics in order to gain flexibility. The standard choice for the communication function y is bag summation W as it is defined on actions in AC{U, L). This means that arbitrary concurrency between actions is allowed. The algebraic semantics of a labeled P/T net has a second parameter, namely a set of internal causes. As explained before, the distinction between internal and external causes is meaningful when distinguishing between communication within a process and communication between the process and its environment. The standard choice for this second parameter is the entire universe of identifiers U. This means that all causes are considered to be internal. Assuming the standard choices for the two parameters of the algebraic semantics for P/T nets, it can be shown that the closed term corresponding to a labeled P/T net has the same step semantics as the P/T net (Theorem 6.10 below). Section 8 shows an application of the framework developed in this subsection with different choices for the parameters. The basis of the algebraic semantics of a labeled P/T net is a closed term that corresponds to the unrestricted behavior of the P/T net, which is the behavior when every transition is always enabled. A causal state operator instantiated with the marking of the P/T net is applied to this term to restrict the behavior to all possible sequences of steps. A cause-abstraction operator, as introduced in Section 6.1, is used to hide consumptions and productions of causes. The unrestricted behavior of a single transition is the nonterminating iteration of its corresponding action in AC(U. L). The unrestricted behavior of an entire P/T net is the parallel composition of all its transitions. Recall that / and o are functions that assign to each node in a labeled P/T net its bag of input and output nodes, respectively. For a transition, the bag of its input places corresponds to its consumption upon firing and the bag of its output places corresponds to its production upon firing. The set of closed (ACP^ + RN -f RSP"" + SC)(AC(^, L), y) terms is abbreviated C{U, L). 6.8 (Algebraic semantics for labeled P/T nets). Let (N,m), with A^ = (P, T, F, W, £), be a marked, L-labeled P/T net in AT, as defined in Definition 4.4. Let y be some communication function. Assume that / c [/ is a subset of identifiers denoting internal causes. The algebraic semantics of (N, m), denoted |N, m|^, is a closed term in C(U, L) defined as follows: DEFINITION
lN^m%=Pcaii)Ki\\t-teT:{it.m^otr^)). EXAMPLE 6.9. Let (N, [1]) be the labeled P/T net of Figure 4. Consider again Examples 6.2 and 6.3. Assume that the set of causes C, the set of atomic actions A, the set of internal causes /, the closed term X, and the communication function y are defined as in Example 6.2. Assume that the set of labels L equals the set of atomic actions A. The algebraic semantics of the P/T net {N, [1]), \N, [1]!^, is the term Pcad) (Xf11 (X)) of Example 6.3. The semantics of this term in model M(C. A,^) of the previous subsection.
Partial-order process algebra
817
as discussed in Example 6.7, corresponds to the step semantics of the P/T net (A^, [1]) as defined in Definition 4.13 and explained in Example 4.14. The correspondence between the step semantics of a labeled P/T net and the step semantics of its algebraic representation, as observed in the above example, is formalized by the following theorem. It uses the standard choices for the two parameters of the algebraic semantics for labeled P/T nets. The theorem states that any step of a labeled P/T net can be simulated by its algebraic semantics and vice versa. Furthermore, since a labeled P/T net cannot terminate successfully, its algebraic semantics cannot terminate successfully either. This means that the algebraic semantics of a labeled P/T net cannot evolve into the special process ^. The symbol = denotes syntactical equivalence of terms. 6.10. For any labeled P/T nets (N, m), (A^, m') e Af, step a e B(L), closed term p € C(U, L), and action a € AC(U, L),
THEOREM
(i) {N. m) [otY (N, m') ^ |A^, m\^ ^ ^ : ^ {N. mX> (ii) [ A ^ , m \ ^ - U p=^ ( 3 m ^ a : m ' e B(U) Aae B{L): p = |A^, m'l^ A ^ = (0, a, 0) A (A^, m) [a)' (N, m')), and (iii) | A ^ , m ] ^ ^ V . PROOF. The proof consists of a straightforward but tedious analysis of the step firing rule of Definition 4.12 and the transition relation of Tables 6 and 8. The proof is almost identical to the proof of Theorem 3.4.8 in [8], where a similar result is proven in a total-order setting. Therefore, for more details, the reader is referred to [8]. D
Assuming that a triple (0, a, 0) e AC(U, L) is identified with its second element a, the correspondence between the step semantics of a labeled P/T net and its algebraic semantics can also be formulated as follows. In the process space that is defined as the (component-wise) union of the process spaces (A/*, B{L), [ >\ 0) of Definition 4.13 (Step semantics for labeled P/T nets) and (C(^, L) U [^),AC(U, L), —> , [y/]) underlying model M(U,L, l±)) of Section 6.2, a labeled P/T net in Af and its algebraic semantics in C(L^, L) are bisimilar. A consequence of Definition 6.8 is that the theory (ACP* + RN -h RSP* + SC) (AC(U, L), l±)) can be used to reason, in a purely equational way, about the equivalence of labeled P/T nets in a step semantics. 6.11. Consider again the marked, labeled P/T nets of Figures 4 and 5. Let (A^, [1]) be the net of Figure 4 and let {K, [1,7]) and (M, [1]) be the two P/T nets of Figure 5. A triple (0, a, 0) e AC(U, L) is identified with its second element a. It is derivable fromthe axioms of (ACP*+RN + /?5P*-hSC)(AC(^, L), l±)) that [A^, [1]1^ = k ] ( [ p i ] II [P2\)' ls\. 5. and that IK\ WJ\\l = |M, [l]]^^ = [r] • ([p,] • [p.] + [p:] • \P\\) • \s\ • 5. It is not possible to derive that [A^, [1]]^' equals [[/^, [1,7]]^' or |M, [1]!^. EXAMPLE
Given the definitions so far, it is straightforward to obtain an algebraic semantics for labeled P/T nets that corresponds to the total-order semantics of Definition 4.9. As in
818
J.C.M. Baeten, T. Basten
Example 6.7, let _L be the communication function that is undefined for every pair of actions. Analogously to Theorem 6.10, it is possible to prove that any labeled P/T net (A^, m) eAf and its algebraic semantics [TV, m J^ represent corresponding processes in the process spaces (A/*, L, [ )^ 0) of Definition 4.9 (Total-order semantics for labeled P/T nets) and (C(U, L) U [^},AC{U, L), -^, {V}) underlying model M(U,L, _L) of Section 6.2, respectively.
6.4. Concluding remarks Summarizing this section, it has been shown how to formalize the notion of transition firing known from Petri-net theory in ACP-style process algebra by means of the so-called causal state operator. The causal state operator can be used to some extent as a substitute for the standard communication mechanism of ACP. In this way, the standard communication mechanism can be used to obtain a partial-order framework. An interesting application of the theory of this section is that it can be used to reason in a purely equational (interleaving) way about labeled P/T nets with a step semantics. An interesting question is to what extent the causal state operator can replace the standard causality mechanism of ACP-style process algebra consisting of sequential composition and communication. In Sections 9 and 10, this topic is investigated in more detail.
7. Intermezzo on renaming and communication functions In standard process-algebraic theory as introduced in Section 5.1, actions do not have internal structure. Thus, communication functions and renaming functions are defined on actions without making assumptions about the structure that actions might have. However, in Section 5.4 and Section 6, we have seen several examples of actions that are structured and of communication and renaming functions using that structure of actions. This section summarizes several kinds of communication and renaming functions that use the structure of actions and that are of particular interest in the context of this chapter. It is assumed that the set of actions equals AC{C, A) as defined in Section 6.1, with C some set of causes and A some set of atomic actions. Recall from Section 5.1 that a renaming function f.AC(C, A) U {8} -> AC{C, A) U {8} is any function with the restriction that f(8) = 8. Renamings of atomic actions and causes. The first class of renaming functions that is of particular interest are those renaming functions that can be derived from renaming functions on atomic actions. Assume that / : A -> A is a (partial) renaming of atomic actions. It can be turned into a renaming function f:AC(C, A) U {8} -> AC{C, A) U {8} in a standard way. Let the auxiliary function / : A ^- A be a total function defined as follows. For any a e A, f(a) equals f{a) if f{a) is defined and a otherwise. Using this auxihary function, the renaming function / is defined as follows. As required, f(8) = 8. Furthermore, for any (c,a, p) G AC(C, A), /(c,Of, p) = (c, / ( a ) , p) where f{a) = (\Sa:aea: [(/(a))^^'^^]). Another class of renaming functions are those functions that can be derived from renamings of causes. Let / : C ^- C be such a (partial) renaming of causes. The renaming
Partial-order process algebra
819
function / :AC{C, A) U [8] -^ AC{C, A) U {5} is defined as follows: /(5) = 6 and, for any (c, a, p) e AC(C, A), f(c, a, p) = (fie), a, f{p)), where the auxiliary function / on bags of causes is defined in the same way as the corresponding function on bags of atomic actions above. Encapsulation operators. As explained in Section 5.1, encapsulation operators are an interesting kind of renaming operators. The basis of an encapsulation operator is a set of actions. Elements in this set are renamed to the inaction constant 5, whereas actions not in this set remain unchanged. It has also been explained how such a set can be transformed into a renaming function, thus showing that encapsulation operators belong to the class of renaming operators. Encapsulation operators can also be derived from sets of atomic actions. Let // c A be a set of atomic actions. The idea is that the corresponding encapsulation operator blocks actions that contain at least one atomic action of this set. Thus, assume that H = {{c, a, p) € AC{C, A) I Of f // 7^ 0}. The encapsulation operator dn has the desired effect. The set H can be turned into a renaming function €{H) \AC{C, A) U [S] -> AC{C, A) U {5} in the way explained in Section 5.1. Another set of encapsulation operators can be derived from sets of causes. For any set of causes ^ c C, the corresponding set H c AC{C, A) is defined as {(c, a, p) e AC(C, A) \ (c l±l /?) f// ^ 0}. The encapsulation operator 3// blocks any action that consumes or produces a cause in H. The corresponding renaming function eiH) :AC(C, A) U {8} -^ AC(C, A) U [S] is defined in the obvious way. Note that it is also straightforward to define encapsulation operators that encapsulate only actions that consume causes in H or only actions that produce causes in H. Communication functions. Yet another kind of interesting renaming functions are those renaming functions that can be interpreted as explicit communication functions (see Example 5.27). Any associative and commutative (partial) communication function on atomic actions cm:AxA->A can be turned into a renaming function cm .ACiC, A) U [8] -> AC(C,A) U {8} in a standard way. Let, for any a,b £ A, the auxihary function cm(a,b):B(A) -> B{A) be defined as follows: For any a e B(A), cm{a,b)(a) = a - [a",b"] l±l [cm(a,b)"] if cm(a,b) is defined, [a,b] ^ a, and n = a(a) min a(b); cm{a, b)(a) = a otherwise. Thus, in case the bag a contains at least one pair of atomic actions a and b, function cm{a, b) replaces any occurrence of that pair in a by the atomic action cm(a, b). Another auxiliary function cm: B(A) -^ B{A) is defined as the function composition of all functions cm(a,b) with a,b e A. Since cm is associative and commutative, the order of the composition is not important. Function cm is a function that renames all pairs of communicating atomic actions. Finally, the desired communication function cm can now be defined as follows: cm{8) = 8 and, for any (c, of, p) e AC(C, A), cm(c, a, p) = (c, cm(a), p). Of course, communication is not necessarily achieved by means of explicit renaming. On the contrary, as explained in Section 5, the standard approach to communication in ACPstyle process algebra is to define communications by means of a communication function Y :AC{C, A) X AC{C, A) -> AC{C, A). However, any associative and commutative (partial) communication function on atomic actions cm: Ax A^^ A can simply be turned into
820
J.C.M. Baeten, T Basten
a communication function y on actions by means of the renaming function cm defined above. For any «,Z7€AC(C, A), y(a,b) = cm(a ^b). Cause abstraction. The last class of renaming functions mentioned in this section is the class of renaming functions that forms the basis for the cause-abstraction operators introduced in Section 6.1. Clearly, also these renaming functions use the structure of actions in AC(C,A). Finally, observe that the definitions of the renaming functions that do not affect causes as well as the definition of the communication functions given in this section can easily be adapted to the simpler framework of Section 5.4, where actions are defined as bags of atomic actions. 8. Modular P/T nets The framework developed in Section 6 provides the basis for reasoning about the equivalence of labeled P/T nets in an equational way. However, the various examples show that it will be difficult to reason about the behavior of non-trivial P/T-net models of complex concurrent systems. A formalism for modeling and analyzing real-world concurrent systems must support compositional reasoning. A formalism is compositional if it allows the system designer to structure a formal model of a system into component models of subsystems in such a way that properties of the system as a whole can be derived from the properties of the components. The goal of this section is to illustrate by means of a few examples in what way compositionality can be achieved in the context developed so far. It is beyond the scope of this chapter to go into much detail. The interested reader is referred to [8, Chapter 3], which describes in detail a formalism supporting the compositional design of concurrent systems. The approach is similar to the one followed in Section 8.1. However, it is important to note that the formalism in [8, Chapter 3] is based on a total-order semantics. The basis of any compositional formalism based on P/T nets is always some notion of a modular P/T net with a mechanism to construct modular P/T nets from other modular P/T nets. The idea is that a modular P/T net models a system component that may interact with its environment via a well defined interface. There are several ways to modularize P/T nets based on how the interface of a modular P/T net is defined. In the remainder of this section, two approaches are illustrated. In one approach, the interface of a modular P/T net consists of places, whereas in the other approach, it consists of transitions. Figure 9 shows two modular-P/T-net models of a one-place buffer that are explained in more detail below. 8.1. Place fusion The most commonly used approach to modularizing Petri nets is the one where interfaces between modular nets are based on places. It appears in the Petri-net frameworks of, for example, [15,35,39], [8, Chapter 3], and [16], Chapter 14 of this Handbook. It is also supported by tools as Design/CPN [40], ExSpect [7], and PEP [18]. Figure 9(a) shows a labeled P/T net of which the set of places is partitioned into two sets by means of a dashed box. Places inside the box are internal places, whereas places outside
Partial-order process
821
algebra
I
(a)
C
(b)
Fig. 9. Modular-P/T-net models of a buffer.
the box are so-called pins. Pins are connectors between the system and its environment. Interaction between the system and its environment is established by exchanging tokens via these pins. A P/T net as shown in Figure 9(a) is a very simple example of a modular P/T net. The set of pins defines the interface of the modular net. The mechanism to construct new modular P/T nets from other modular nets is explained in more detail below. The behavior of a modular P/T net as shown in Figure 9(a) and an ordinary P/T net differs in one important aspect. When considering the behavior of a modular P/T net with an interface consisting of pins, the environment is responsible for consuming tokens from and producing tokens on the pins. If the behavior of the modular P/T net is described without the context of a specific environment, then it is assumed that the environment has always tokens available when they are needed by the modular P/T net; it is also assumed that the environment is always willing to receive any tokens that the modular P/T net might produce. If a modular P/T net is put into a specific context, typically defined by another modular P/T net, the approach followed in this subsection guarantees that the behavior of the modular P/T net is restricted to the behavior allowed by its context. EXAMPLE 8.1. Consider the modular P/T net of Figure 9(a). As mentioned, it models a one-place buffer. Pins 1 and 2 correspond to ports. The buffer receives messages of its environment over port 1; it sends messages to its environment over port 2. Place b models buffer storage. The number of tokens in place c determines the capacity of the buffer. In the example, the capacity is one. As explained, since no specific environment of the buffer has been given, it is assumed that the environment has always tokens available when they are needed by the buffer. Therefore, in the initial marking depicted in Figure 9(a), transition r is enabled. It has tokens on all its internal input places. Transition s is not enabled, because place b is not marked. Firing transition r leads to the marking with a single token in place b. In that marking, only transition s is enabled. Firing transition s, returns the modular P/T net to the state shown in Figure 9(a). The environment has received the token over port 2. Clearly, the behavior of the modular net corresponds to a one-place buffer. By adding tokens to place c, it is possible to increase the capacity of the buffer. It is not difficult to see that the modular P/T net of Figure 9(a) behaves as an «-place buffer when place c contains n tokens in the initial marking. Note that the modular P/T net is a very abstract model that abstracts from message contents and message ordering. The number of tokens in place b corresponds to the number of messages in the buffer; the tokens do not correspond to the messages themselves.
822
J.C.M. Baeten, T Basten
It is possible to formalize the behavior of modular P/T nets as illustrated in the above example by means of a (step) firing rule. However, it is also possible to formally define the behavior in the equational theory (ACP^ + RN + /?5F* + SC)(AC(^, L), W ), where U, L, and AC(U, L) are defined as in Section 6.3. EXAMPLE 8.2. Let / be the set of internal places [b, c]. Recall the algebraic semantics for labeled P/T nets given in Definition 6.8. The algebraic semantics of the modular P/T net of Figure 9(a) is the following closed term in C{U, L). Square brackets of singleton bags are omitted.
Pca(/)(A;(([l,c],r,Z7)*5||(Z7,5jc,2])*(5)). It is straightforward to prove that this term is equivalent to ((l,r,0).(0,^,2))*5. Note that only internal consumptions and productions are hidden. The reason for not hiding external consumptions and productions will become clear when we consider the construction of modular P/T nets from other modular P/T nets. It provides a way for restricting the behavior of a modular P/T net in a specific context. The algebraic semantics of the modular P/T net of Figure 9(a) with two tokens in place c is the term Pca(/)(A^,2](([l,d,r,^)*5||(^^,[c,2])*5)),
which can be proven equal to (1, r, 0 ) . ( ( ( l , r , 0)11(0,^, 2)) *5). This last result is the expected term for a two-place buffer. Finally, consider the variant of the modular P/T net of Figure 9(a) with three tokens in c. Its algebraic semantics is the term Pca(/)(^^',3j(([l,c],r,^)*5||(Z7,.,[c,2])*5)). Let X/, where 0 ^ / ^ 3, denote the closed term Pca{i)i>^L ^3-,^(([^^c],r,b)* 8 \\ {b, s, [c, 2])*5)). Thus, Xo = Pcaini^ls^m^cl r, by8 \\ (b, 5, [c, 2])*5)). The following results can be obtained: Xo = ( l , r , 0 ) . X , , Xi = (l,r,0)-X2 + (0,5,2)-Xo + (l,[r,5],2).Xi, X2 = ( l , r , 0 ) - X 3 - h ( 0 , 5 , 2 ) X i -h(l,[r,5],2)-X2, X3 = (0,5,2)-X2.
and
Partial-order process algebra
823
4-
(l,r,0)/
J(0,i,2)
(l,[r.s],2)Q}y (l.r.O)/
j(0.5,2)
(l,[r.i],2)Q> (l.r.O)/ Wo, 5, 2)
Fig. 10. A three-place buffer in a step semantics.
The semantics of term XQ is illustrated in Figure 10. Note that the final result for the rwo-place buffer above is a single closed term inC(U, L) that contains only the sequentialcomposition, merge, and binary-Kleene-star operators. In particular, it does not contain a causal state operator. There is no such term in C(U, L) that specifies a three-place buffer. That is, there is no closed term in C(U, L) that is equivalent to term XQ and that contains only the sequential-composition, merge, and binary-Kleene-star operators. The reason is that the binary Kleene star is not sufficiently expressive. More information about the expressiveness of the binary Kleene star can be found in [11] and [12], Chapter 5 of this Handbook. The above example shows how to obtain a modular-P/T-net model of a buffer with arbitrary capacity by varying the marking of the modular net. The examples in the algebraic framework of Section 5 suggest another way to construct buffers with arbitrary capacity, namely by composing a number of one-place buffers. This approach is also possible in the framework of modular P/T nets developed so far. EXAMPLE 8.3. Figure 11(a) shows two variants of the one-place buffer of Figure 9(a). The left P/T net models a buffer that receives messages of its environment over port 1 and sends messages over port 2. The right P/T net models a buffer communicating via ports 2 and 3. There is one important difference between the models of Figure 11(a) and the model of Figure 9(a). Consider the left P/T net of Figure 11(a). It models a buffer that receives messages via pin im\ while at the same time acknowledging the receipt to its environment via pin oa\. The buffer sends messages to the environment via pin om2\ however, it only sends a message when the environment acknowledges via pin iai that it is ready to receive the message. The two acknowledgment pins oa\ and iai are not present in the modular P/T net of Figure 9(a). They can be used to construct asynchronous communication channels with a finite message capacity between buffers. To illustrate the composition of modular P/T nets with interfaces consisting of pins, consider the modular P/T net of Figure 11(b). It consists of four components, namely the two one-place buffers of Figure 11(a), which are called subnets of the modular P/T net, and two new (internal) places m and «. Place a is marked with a single token. The modular P/T net of Figure 11(b) specifies a specific context for its subnets. It is constructed from
824
J. CM. Baeten, T. Basten
om2
imi 0 ^ 2 ^ 0 \
_^^^^
^^"3
m
oa2 O j ' ^ ' ^ ' ^ N s r ' ^ O ^"^3 (a)
(b) Fig. 11. The modular construction of a three-place buffer.
its four components by means of a so-caWtd place-fusion function. A place-fusion function is a (partial) mapping from the pins of the subnets of a modular P/T net onto the places of the modular P/T net. In the example of Figure 11(b), the place-fusion function / maps pins om2 and im2 onto place m and pins ia2 and oa2 onto place a. Informally, the modular P/T net of Figure 11(b) models the two one-place buffers of Figure 11(a) that are connected via port 2 which, in this example, is an asynchronous communication channel that can hold a single message. The channel is modeled by places m and a. Place m models the storage for messages and the number of tokens in place a models the storage capacity of the channel. Intuitively, the modular P/T net of Figure 11(b) should behave as a three-plact buffer. Messages can be stored in the two one-place buffers (the two places marked b) and in the channel (place m). The modular P/T net of Figure 11(b) is more concrete than the modular P/T net of Figure 9(a) with three tokens in place c that also models a three-place buffer. Recall that the modular net of Figure 9(a) abstracts from message contents and message ordering. Tokens in the three buffer places of the modular P/T net of Figure 11(b) can be seen as messages, which means that this modular net abstracts from message contents, but not from message ordering. At this point, the reason for the exchange of acknowledgments between the one-place buffers of Figure 11(a) and the environment should be clear. In the modular P/T net of Figure 11(b) without place a, there would be no upper bound to the number of tokens in place m. Such a modular P/T net conforms to a system where the communication channel between the two one-place buffers has infinite capacity. In a general framework of modular P/T nets, a modular P/T net may consist of subnets, transitions, places, and arcs between transitions and places. Places may be divided into internal places and pins. Internal places may contain an arbitrary number of tokens. Note that the P/T net of Figure 9(a) as well as the three P/T nets of Figure 11 all belong to this general class of modular P/T nets. In such a general framework of modular P/T nets, it is
Partial-order process algebra
825
possible to construct arbitrarily complex P/T-net models using only the simple mechanism of place fusion. Note that pins of the subnets of a modular P/T net may be fused with both its internal places and pins. The semantics of modular P/T nets as described above can be formalized by defining a process space based on a (step) firing rule. However, it is also possible to define the semantics indirectly via an algebraic semantics. EXAMPLE 8.4. Recall the algebraic semantics of the modular P/T net of Figure 9(a) given in Example 8.2. The algebraic semantics of the leftmost modular P/T net of Figure 11(a) is the following closed term in C{U, L). As before, square brackets of singleton bags are omitted. Let / be the set of causes {b, c}.
Pc«(/)(A,^(([/mi,c],r,,[o«i,Z7])*5||([Z7,/«2],^2,[c,om2])*5)). It is straightforward to prove that this term is equivalent to {(im\,r\,oa\)
• {ia2,S2,om2)Y^.
Let Ci ,2 be an abbreviation for this term. The algebraic semantics of the rightmost modular P/T net of Figure 11(a) is the term Pca(/)(A^.(([/m2,c],r2,[oa2,Z7])*5||([Z7,/a3],53,[c,om3])*5)), which is equivalent to ((/m2, r2yOa2) • (ia^, 53, 0^3)) * 5. Let C2.3 be an abbreviation for this term. Recall that the exchange of tokens between the modular P/T nets of Figure 11(a) and the environment is represented in the terms C1.2 and C2.3 explicitly via causes. It remains to define the algebraic semantics of the modular P/T net of Figure 11(b). Since the goal is to obtain a compositional formalism, it must be based on the terms C1.2 and C2,3 derived for the two one-place buffers of which it is composed. As explained in Example 8.3, the basis of the construction of this modular P/T net from its components is the place-fusion function / , which maps (some of the) pins of its subnets onto its places. To obtain an algebraic expression for the behavior of subnets in the context of a modular P/T net, it suffices to simply rename consumptions and productions of causes corresponding to pins of subnets according to the place-fusion function. Thus, the place-fusion function in the construction of a modular P/T net corresponds to a renaming operator in its algebraic semantics. Note that the place-fusion function / is simply a (partial) renaming of causes in U. Consequently, the place-fusion function / can be turned into a renaming function f\AC{U, L) U {(5} -^ AC{U, L) U {5} as explained in Section 7. Using the renaming function / , the behavior of the modular P/T nets of Figure 11(a) in the context of the modular net of Figure 11(b) is defined by the terms Pf(C 1,2) and P/(C'2.3), respectively. It follows from the axioms for renaming that PfiC\,2) = {(if^\, f\, oa\) • {a, S2, w))*(5
826
J.C.M. Baeten, T Basten
and that
The basis of the algebraic semantics of the modular P/T net in Figure 11(b) is the parallel composition of the behavior of its subnets in the context of the modular net. A causal state operator instantiated with the marking of the modular P/T net is applied to this term to restrict the behavior to all possible sequences of steps that are allowed in the specific context. The cause-abstraction operator is used to hide internal consumptions and productions of tokens. Thus, the modular P/T net of Figure 11(b) has the following algebraic semantics. Let J be the set of places {a,m}. Pca(J){)^i{pfiCu2)\\Pf{C23))). Let Xooo be an abbreviation for this term. The following equations can be derived from the axioms of (ACP* -h RN -h RSP"" + SC)(AC(U, L), l±)). ^000 =
iim\,r\,oa\)'X\oo.
^100 = (0,^2,0) -Xoio, Xoio = (im\,r\,oa\)'
Xwo-\-(0,r2,0)'Xoo\
+(im\, [ri, r2], o^i) • Xioi,
Xiio = (0,r2,0)-Xioi, Xooi = {im\,r\,oa\)-
X\o\ -{-{iai,,Si,,omi,)- Xooo
+ ([/mi, /«3], [r\, ^3], [oa\, omi,]) • Xioo, Xioi = (0,52,0) • Xoi 1 + (/«3, "^3. omi,) • Xoii = iim\,r\,oa\)'
XKX)
+ (/«3. [-^2, S3], omi,) •
XQIO,
X\\\ -^{ia3,S3,omi,)- Xo\o
-f ([im\, iai,], [r\, 53], [oa\, om3]) • X\ 10,
and
^111 = (ia3, S3, om3,)-X wo, where ^100 =
PcaiJ){^i{(a,S2.m)'PfiC\,2)\\pf(C23))),
^010 = PcaiJ){^i{pf(Ci.2)
II P / ( C 2 . 3 ) ) ) ,
^110 = pca{J){^i{(a,S2,m)
• pf(C\,2)
^001 = X\0\
W
Pf(C23)))^
PcaiJ){^ci{pfiC\,2)\\im,S3,.om3,)'Pf(C2j))).
= Pca{J){^i{(ci,S2,m)
^011 = PcaiJ){^i{pf(C\,2) ^111 = Pca(J){^i{(ci.S2.m)'
' Pf(C\,2)
W iia3.S3.om3,)
II iia3,S3.om3)-PfiC2.3))), Pf(C\^2)
II
'
pf(C23))).
and
iici3.S3.0m3)'pf(C2.3))).
As mentioned in Example 8.3, the modular P/T net of Figure 11(b) should behave as a three-place buffer. This means that the above set of equations for the terms XQOO through
Partial-order process
algebra
827
A'ooo
^
\r\.s^\ ^^
Fig. 12. The semantics of the modular P/T net of Figure 11(b).
X\\\ must also represent the behavior of a three-place buffer. Figure 12 illustrates the semantics of the term XQOO- For the sake of clarity, consumptions and productions are omitted. Recall that Figure 10 shows a process corresponding to a three-place buffer in a step semantics. Thus, it may be expected that the process in Figure 12 is similar to this process. The first impression might be that this is not the case. However, observe that the modular P/T net of Figure 11(b) contains two transitions that do not have any external effects, namely transitions si and ri. Hiding these transitions in the process of Figure 12 means that the process states Xioo, XQIO. and XQOI collapse into a single state. The same happens to the process states Xno, Xioi, and Xon. A consequence of these abstractions is that the process becomes identical - up to renaming of actions - to the process in Figure 10. Thus, the process of Figure 12 represents the behavior of a three-place buffer indeed. As mentioned earlier, it goes beyond the scope of this chapter to formalize the notion of abstraction. The examples given so far in this subsection illustrate the essentials of a compositional formalism based on modular P/T nets with interfaces consisting of places in a partialorder framework. The formalism is compositional in the sense that the behavior of a modular P/T net is defined as a closed term in the equational theory (ACP* -I- RN -h RSP'' -h SC)(AC(L^, L), l±)) that is itself defined in terms of the (parallel) composition of the algebraic semantics of the subnets of the modular P/T net. In [8, Chapter 3], it is explained how such a formalism can be used as the basis for a design method for concurrent systems. The basic idea of this design method is to specify crucial behavioral properties of a concurrent system in process-algebraic terms, model the system by means of a modular P/T net, and verify its behavioral properties via the algebraic semantics of the modularP/T-net model. The formalism in [8, Chapter 3] includes a formal definition of modular P/T nets. It also formalizes the operational semantics of modular P/T nets in terms of a firing rule. Several algebraic semantics of modular P/T nets are given and it is shown that these semantics correspond to the operational semantics of modular P/T nets as defined
828
J. CM. Baeten, T. Hasten
by the firing rule (cf. Theorem 6.10). In addition, the notion of abstraction is formalized both in the P/T-net framework and in the algebraic framework. Although the underlying semantics is a total-order semantics, the framework in [8, Chapter 3] can be adapted to the partial-order semantics of this subsection in a straightforward way. 8.2. Transition fusion As explained in the introduction to this section, there are two ways to modularize P/T nets. In the previous subsection, we have concentrated on modular P/T nets with interfaces consisting of places. Another approach is to define interfaces in terms of transitions. This approach is not very common in the Petri-net literature. However, it is closely related to the notion of synchronous communication known from process algebra, as the examples in the remainder of this subsection show. 8.5. Figure 13(a) shows two modular P/T nets that are simple variants of the modular P/T net of Figure 9(b). Consider for example the leftmost modular P/T net of Figure 13(a). It will not come as a surprise that it models a one-place buffer that receives messages of its environment over port 1 and sends messages to its environment over port 2. The number of tokens in place b models the number of messages in storage, whereas the number of tokens in place c models the capacity of the buffer. The rightmost modular P/T net of Figure 13(a) models a buffer that communicates with its environment via ports 2 and 3. In the P/T-net models of Figure 13(a), a dashed box divides the set of transitions of a modular net into internal transitions and transition pins. The modular P/T nets of Figure 13(a) do not have any internal transitions. Transition pins are connectors between a system and its environment. A modular P/T net with transition pins in isolation behaves in exactly the same way as a normal labeled P/T net. However, an environment can interact with a system via synchronous communication. The modular P/T net of Figure 13(b) illustrates one possible mechanism to obtain synchronization. Recall that the basic P/Tnet framework in this chapter is the class of labeled P/T nets. However, for the sake of simplicity, it is assumed that in the modular P/T nets of Figure 13 transition labels are identical to transition identifiers. The modular net of Figure 13(b) consists of three components, namely the two one-place buffers of Figure 13(a), called its subnets, and one new (internal) transition ci. SynchroEXAMPLE
ll ^\ I
ri \
•^2
b
'
r
^3
'
'"
(a)
b
|l
c
|i
slc2L 1
C
(b)
Fig. 13. The modular construction of a two-place buffer.
Partial-order process algebra
829
nization between the two one-place buffers is achieved by means of a transition-fusion function. A transition-fusion function is a (partial) mapping from the transition pins of the subnets of a modular P/T net to the transitions of the modular net. In the example, the transition-fusion function cm maps transition pins 52 and rj onto transition o . Intuitively, the modular P/T net of Figure 13(b) models a two-place buffer. The semantics of modular P/T nets with transition pins can be formalized via an algebraic semantics. EXAMPLE 8.6. As mentioned in Example 8.5, the behavior of the modular P/T nets of Figure 13(a) in isolation is identical to the behavior of normal labeled P/T nets. This means that the algebraic semantics for labeled P/T nets of Definition 6.8 can be used to define the semantics of the modular nets of Figure 13(a). Note that all the places in a modular P/T net with transition pins are internal. Furthermore, the goal is to obtain a step semantics. Thus, we instantiate the parameters / and y in Definition 6.8 with the universe of identifiers U and bag summation l±l, respectively. The algebraic semantics of the two modular P/T nets of Figure 13(a) are the closed terms PcaiU){^c{(^^n.br8\\ib,S2.cr8))
and Pca(^)(A,^((c,r2,Z7)*5||(^,53,c)*5))
in C(U, L), respectively. As before, square brackets of singleton bags are omitted. Furthermore, a triple (0, of, 0) in AC{U, L) is identified with its second element. It is straightforward to prove that the above two terms are equivalent to (n-^2)*5 and (^2-^3)*^.
It remains to define an algebraic semantics for the modular P/T net of Figure 13(b). The basis for the composition of the modular net of Figure 13(b) from its components is the transition-fusion function cm that maps transition pins ^2 and ri of the one-place buffers of Figure 13(a) onto transition ci. Note that this transition-fusion function can be seen as a (partial) communication function on atomic actions in L. Thus, the transitionfusion function can be turned into an algebraic renaming function cm :AC(U, L) U {5} -> ACiU, L) U [6] following the approach of Section 7. That renaming function can be used to define the algebraic semantics of the modular net of Figure 13(b) in terms of the algebraic expressions derived for the one-place buffers of Figure 13(a). Transition fusion in the framework of modular P/T nets with transition pins corresponds to the synchronous communication mechanism in ACP-style process algebra. Given this observation, the algebraic
830
J.CM. Baeten, T Basten
semantics of the modular P/T net of Figure 13(b) is straightforward. The idea is to take the parallel composition of the algebraic semantics of its subnets, rename actions according to the renaming function constructed from the transition-fusion function, and encapsulate isolated actions corresponding to firings of transition pins. The encapsulation operator that is needed to achieve the latter can be derived from the set of atomic actions H = [s2,r2\. Let H C AC{U, L) be the set of actions that is constructed from H following the approach of Section 7. The semantics of the modular P/T net of Figure 13(b) is the following closed terminC(L^, L): a//(pcm((n-52)*5||(r2-53)*5)).
It is not difficult to prove that this term is equivalent to the term n-((c2-(nlh3))*5), which is the expected expression for a two-place buffer with an internal communication action C2. Note that the definition of the algebraic semantics of the modular P/T net of Figure 13(b) does not use the causal state operator. However, in a general framework of modular P/T nets with transition pins, a modular P/T net may consist of subnets, transitions, and (internal) places. Transitions may be divided into internal transitions and transition pins and places may contain an arbitrary number of tokens. In such a framework, the basis of the algebraic semantics of the modular P/T net is still the parallel composition of the expressions for its subnets, but this composition is restricted to all possible sequences of steps by means of the causal state operator. Finally, note that the modular P/T nets in Example 8.5 are very simple. In a general framework of modular P/T nets with transition pins, the construction of communication functions from the transition-fusion function might not always be straightforward.
8.3. Concluding remarks In this section, we have seen examples of two approaches to modularize P/T nets. One approach is based on fusion of places, whereas the other one is based on fusion of transitions. Both techniques translate to renaming operators when defining the (step) semantics of such modular P/T nets in an algebraic way, where place fusion corresponds to the renaming of causes and where transition fusion corresponds to the notion of synchronous communication. Of course, it is possible to combine the two approaches into one general framework of modular P/T nets with interfaces consisting of (place) pins and transition pins. A formahsm of modular P/T nets and its algebraic semantics can be used as the basis for a compositional formalism for modeling and analyzing complex concurrent systems. In [8, Chapter 3], such a compositional formalism based on modular P/T nets with interfaces consisting of places is worked out in detail (in a total-order setting).
Partial-order process algebra
831
9. Cause addition The previous section illustrates two techniques to modularize P/T nets, namely place fusion and transition fusion. The two techniques are based on the addition of fresh places and transitions, respectively, in order to compose new (modular) P/T nets from other P/T nets. We have seen that the addition of fresh transitions by means of transition fusion corresponds to the notion of synchronous communication in ACP-style process algebra. The new action that results from a synchronous communication in an algebraic expression corresponds to the new transition. It is also possible to define a class of algebraic operators corresponding to the addition of fresh places in P/T nets. Such a class of operators is particularly interesting because places in P/T nets are the standard means to enforce a sequential ordering between actions. Thus, the new operators must be related to the standard sequential-composition operator in ACP-style process algebra. In the remainder of this section, we introduce the class of so-called cause-addition operators and investigate the relation between cause addition and sequential composition. The introduction of cause addition is another step in incorporating the causality mechanism of Petri nets in ACP-style process algebra. Cause addition was first studied in [4].
9.1. The equational theory Table 9 presents the Algebra of Communicating Processes with iteration, cause addition, the causal state operator, renaming, the Recursive Specification Principle for the binary Kleene star, and standard concurrency, abbreviated ACP*' + RN -f RSP* -h SC. It builds upon the equational theory introduced in Section 6. It is parameterized by a set of actions AC{C, A), with C a set of causes and A a set of atomic actions, and a communication function y :AC(C, A) x AC(C, A) -> AC(C. A). Recall from Section 6.1 the definitions of ACiC A) and the three auxiliary functions c, p:AC(C, A) -^ B(C) and s :AC(C, A) -^ B(A): AC(C, A) = B(C) x B(A) x B(C) and, for any a = (c, a, p) in AC(C, A), ca = c, pa — p, diVidsa =a.
Table 9 The equational theory (ACPt' + RN + RSP* + SC)(AC, y) _ ( A C P f +RN-f/?5P* +SC)(AC(C, A), y) (ACP* -h RN -h RSP"" + SC)(AC(C, 4), y) .,_ : P - > P ; x,y\P\ ''8 = 8 'a = (c«l±) [c],sa, pa) '{x -\- y) = 'x + ''v '(x • y) = ^x • V
ICI Id IC3 IC4
8'' = 8 a^ = {ca,sa, pa l±) [c]) (x + >•)'• = x'' + v'' (A- • >•)'• = X • y''
OCX 0C2 0C3 OCA
832
J.CM. Baeten, T Basten
For any cause ceC, the equational theory (ACP*' + RN + /?5F* + SC)(AC(C, A), y) contains two new operators when compared to (ACP* + RN + RSP"" + SC)(AC(C, A), y), namely input-cause addition ^_ and output-cause addition S. The idea is that, for any process term X, ^x is the process that behaves as x with the one difference that its initial action consumes an extra cause c; jc^ is the process that behaves as x but produces an extra cause c with its last action. Given this informal interpretation, the axiomatization of cause addition is straightforward. In Table 9, constant a ranges over AC(C, A). Axioms /CI and OCX state that the inaction constant 6 does not consume or produce causes. Axiom IC2 says that the addition of an input cause to an action means that it is added to the consumption of the action; Axiom OC2 states that the addition of an output cause to an action means that it is added to its production. Axioms /C3 and 0C3 say that both cause-addition operators distribute over choice. Finally, Axioms ICA and OCA state that the addition of an input cause to a sequential composition means that the cause is added to the left operand of the sequential composition, whereas the addition of an output cause to a sequential composition means that the cause is added to the right operand.
9.2. A semantics As in Sections 5.2 and 6.2, the basis of a semantics for theory (ACP*' -h RN + /?5P* -h SC)(AC(C, A), Y) is a process space. Let C{C, A) be the set of closed (ACP*' + RN -h /?SP* 4- SC)(AC(C, A), Y) terms. The set of processes of the process space is defined as the set C{C, A) U {^}. Process ^ is the special process that can perform no actions, but can only terminate successfully. The set AC(C, A) is the set of actions of the process space. The transition relation _ -=^ _ c (C(C, A) U {y/}) x AC{C, A) x (C(C, A,) U {y/]) is the smallest relation satisfying the derivation rules in Tables 6, 8, and 10. The termination predicate is the singleton {^]. The process space (C(C, A) U {yJ],AC{C, A), -^, {y/]) can be turned into a model M(C, A, Y) of the theory (ACP*' + RN + /?SP* + SC)(AC(C, A), Y) following the approach of Section 5.2. The following congruence property is needed in the construction. 9.1 (Congruence). Bisimilarity, ^ , is a congruence for the operators of (ACP*^ -h RN -hRSP"" + SC)(AC(C, A), y).
PROPERTY
The desired property follows from the format of the derivation rules in Tables 6, 8, and 10. (See [5] and [1], Chapter 3 of this Handbook, for details.) D
PROOF.
Table 10 The transition relation for cause addition a : AC{C, A); c: C',p,p':
CiC A);
p—> p ,. (-p
ica\i}[c],sa,pa)
p—^ V ^ p>,
,. Cp
(ca\i)\c\.sa.pa)
p—> p ^ ^ .
p„ c JL^ ^p „'<•
p—^ V pC.. {ca.sci.piM\c\)
y ^.
Partial-order process algebra
833
The following theorem states that the equational theory (ACP*' + RN + RSP* + SC)(AC(C, A), y) is a sound axiomatization of the model of closed terms modulo bisimilarity. THEOREM
9.2 (Soundness). For any closed terms p,q e C(C, A),
(ACFl' -^RN ^ RSP"" -\-SC){AC{C. A),y)\-
p = q =^ M(C, A,y) \= p = q.
PROOF. Given Theorem 6.6 and Property 9.1, it suffices to show the validity of the Axioms /CI through IC4 and 0C\ through 0C4. It is straightforward to construct a bisimulation for each case. D
9.3. Buffers The use of cause addition can be best illustrated by means of a few examples. Since the cause-addition operators are inspired by Petri-net theory, (variants of) P/T-net models given earlier are a good source of examples. EXAMPLE 9.3. Consider the P/T-net model of Figure 14(a). It is a variant of the (modular) P/T net of Figure 9(b) that models a three-place buffer. Definition 6.8 defines the algebraic semantics of such a P/T net as a closed term in the theory (ACP* -h RN + RSP* + SC)(AC(U. L), y) where U and L are as defined in Section 4 and where y :AC{U, L) x AC{U, L) -^ AC{U, L) is a parameter that can be used to define a step semantics or a total-order semantics. The standard choice l±l for this parameter yields a step semantics. In the algebraic semantics of Definition 6.8, the information about the consumption and production of transitions is already included in the actions. However, in the current setting, cause-addition operators can be used to make this information explicit. The step semantics of the P/T net of Figure 14(a) can also be formalized by the following closed (ACP*^ + RN + RSP"" -f SC)(AC((/, L), W) term. As before, a triple (0, a, 0) in AC{U, L) is identified with its second element and square brackets of singleton bags are omitted.
2 r
4
6
^y^^-^'^^^2 ^ / ^ 0 \ ^ C 3 ^^^^^-^\^ s
1
3 (b)
Fig. 14. Two P/T-net models of three-place buffers.
5
834
J.C.M. Baeten, T Basten
Let X/, where 0 ^ / < 3, denote the closed term /Oca(^)(>^[^3-, u]^^^^^^ ^ ^"^^ *^^^- ^ ^ ^ ' Xo equals the algebraic semantics of the P/T net of Figure 14(a). The following results can be obtained: Xo = r - X i , Xi = r - X 2 + 5 - X o + [r,5]-Xi, X2 = r • X3 + 5 • Xi -h [r, ^] • X2,
and
X3 = ^•X2. Figure 10 visualizes the semantics of XQ when ignoring consumptions and productions. EXAMPLE 9.4. Figure 14(b) shows another P/T-net model of a three-place buffer. It can be obtained by combining three one-place buffers by means of transition fusion. As a result, the internal communication actions ci and C3 are explicit in the model. For the P/T net of Figure 14(b), cause-addition operators can be used to define the following alternative algebraic semantics:
Pcami^hA''-^*^ II '('^2')" *& II \Wt*&
II V*5)).
Let Xijk, where O^i, j,k ^ 1, denote the closed term
The following results can be obtained from the axioms of (ACP*^ + RN -h RSP* -\SC)(AC(^,L),l±i). ^000 =
f -^100,
^100 = Xoio = ^110 = Xooi = X\o\ = Xoi 1 = Xiii =
Q • ^010, r • Xi 10 + C3 • Xooi + k, C3] • Xioi, C3 • Xioi, r ' Xioi + s ' Xooo 4- [r, s] • Xioo, Q • ^01 \-^s ' Xioo + [c2,5] • Xoio, r • Xi 11 + 5 • Xoio + k, '^1 • X\ 10, and s • Xiio.
Figure 12 visualizes the semantics of term Xooo when assuming that ri, 5-2, o , and 5^3 are replaced by r, C2, C3, and 5, respectively. As explained in the introduction to this section, cause addition is related to sequential composition. EXAMPLE 9.5. Consider again the P/T-net model of Figure 14(b). The ordering between transitions r and C2 is enforced by places 1 and 2. In the algebraic semantics of this P/T net
Partial-order process algebra
835
given in the previous example, these two places translate to cause-addition operators. It is possible to replace these cause-addition operators with a sequential composition. Similarly, it is possible to replace the cause-addition operators corresponding to places 5 and 6. The result of these replacements is an alternative closed term in C{U, L) defining the behavior of a three-place buffer, namely the term
where X and Y are abbreviations for the closed terms
(r-V)*5
and (V-^)*5.
In the P/T-net model of Figure 14(b), the above replacements correspond to internalizing the places 1,2, 5, and 6. The result is a modular P/T net with a structure that is very similar to the structure of the modular P/T net of Figure 11(b). It remains to substantiate our claim that term PcaiU)(^3 (^ II ^)) is an alternative expression for the three-place buffer of the previous example. Assuming that Xooo is an abbreviation for the term PcaiU)(^2 (^ II ^)) and assuming that Xioo through X\\i are defined as below, exactly the same equations can be derived from the axioms of (ACP*'' -h RN + RSP* + SC)(AC(U, L), l±)) as the equations for the corresponding terms in Example 9.4. As a consequence, term A'ooo of this example has the same semantics as the term XQOO of Example 9.4. ^100 = Xo\0 = XU0
=
XOOI = ^101 =
Pca(U){^^(C2'X\\Y)), PcaiU){>^4(X\\Y))^ Pca(U){^^(C2'X\\Y)), PcaiU){^^(X\\s-Y))^ Pca(U){^3(^2'X\\s-Y)).
^011 = PcaiU){^4(X\\s'Y))^ ^111 =
and
Pca(U)i^4(^2-X\\S'Y)).
Note the structural similarity between the terms Xooo through X111 as defined in this example and those defined in Example 8.4. Another interesting observation is that the term Xooo of Example 9.4 has three causes in the marking of the state operator and six different cause-addition operators. Term Xooo of this example has two causes and four causeaddition operators fewer, but it has two sequential-composition operators instead (in the auxiliary terms X and Y). A final observation is that it appears to be impossible to derive the equality of the terms Xooo of this example and Xooo of Example 9.4 from the axioms oftheequational theory (ACPl'^RN + RSP*-\-SC)(AC(U, L), l±)). Since these two terms have the same semantics in the model of the previous subsection, this observation means that the equational theory is not complete for this model. It appears that the generalization of RSP* to the general recursive specification principle RSP, as defined in for example [5, 6,25], is necessary to obtain the desired equality.
836
J.C.M. Baeten, T Basten
Examples 9.4 and 9.5 show that cause-addition operators and sequential-composition operators can replace each other. The relation between cause addition and sequential composition is studied in more detail in the next subsection.
9.4. Cause addition and sequential composition The most straightforward way to specify a causal ordering between two processes in a process-algebraic setting is the sequential-composition operator. In an equational theory with causal state operators and cause addition, causes provide an alternative. In this subsection, it is shown that cause addition and sequential composition are exchangeable notions. The main result is a theorem stating that any sequential-composition operator in a process term can be replaced by a pair of cause-addition operators. This theorem can be seen as a formalization of the statement by Milner in [45] that sequential composition is not necessary as a basic operator in a process-algebraic theory. The main objective of this subsection is to illustrate the conceptual relation between cause addition and sequential composition. Therefore, to facilitate reasoning, we consider an equational theory without iteration. This simplification means that it is only possible to specify processes with bounded behavior. Assume that C is a set of causes and A a set of atomic actions. Let y \AC{C, A) x AC{C, A) -> AC(C, A) be some communication function. The equational theory considered in this subsection is the theory (ACP^ + RN)(AC(C, A), y). The basis of this equational theory is the theory (ACP -h RN)(AC(C, A), y) of Table 2. This basic theory is extended with the causal state operator of Section 6.1 and cause addition of Section 9.1, yielding the Algebra of Communicating Processes with cause addition, causal state operator, and renaming. Let C(C, A) be the set of closed (ACP^ +RN)(AC(C, A), y) terms. It is possible to construct a model of the equational theory (ACF^^ -h RN)(AC(C, A), y) following the same approach as in earlier sections. However, all the results in this subsection are proven in terms of the equational theory without referring to a particular model. Therefore, the construction of a model is left to the reader. The main advantage of restricting our attention to processes with bounded behavior is that each process can be expressed in terms of the inaction constant, actions, choice, and action prefix. The latter is a restricted form of sequential composition (also present in, for example, CCS [44,45]) where the left operand is required to be an action. A closed process term that contains only the aforementioned constants and operators is called a basic term. Formally, the set of basic terms is defined as follows. DERNITION 9.6 {Basic terms). The set of basic terms over the signature of (ACP^ -fRN)(AC(C, A), y), denoted /3(C, A), is inductively defined as follows. The inaction constant is an element of B(C, A). The set of actions AC{C, A) is contained in B(C, A). Furthermore, for any a € AC{C, A) and basic terms s, t e B(C, A), also a • t and s + t art elements of B(C, A).
Note the similarity between basic terms and terms in head normal form, as defined in Definition 5.4. Clearly, any basic term is in head normal form. The converse is not true.
Partial-order process algebra
837
The following theorem states that any closed process term is derivably equal to a basic term. 9.7 (EHmination). For any closed term p e C(C, A), there exists a basic term t e B(C, A) such that (ACP^^ + RN)(AC(C, A), y)h p = t.
THEOREM
PROOF. The proof uses the strategy based on term-rewriting techniques explained in [5]. Consider the rewriting system obtained when interpreting Axioms A3 through A7, C3, CFl and CF2, and CM 1 through CM9 of Table 1, RNl through RN3 of Table 2, C501 through CS05 of Table 7, and /CI through IC4 and OCl through 0C4 of Table 9 as rewrite rules from left to right. Assuming that this rewriting system is strongly normalizing, it is not difficult to see that each closed term in C{C, A) has a normal form that is a derivablyequivalent basic term. To prove that the rewriting system is strongly normalizing, the so-called method of the recursive path ordering can be applied. The basis of the proof is a well-founded ordering on the constants and operators of (ACP^ -h RN)(AC(C, A),y). The required ordering is inspired by very similar orderings that are given in [5]. To define the ordering, it is necessary to rank the causal state operators, the merge, the left merge, and the communication merge as explained in [5]. For any / c C, m G S ( / ) , and n eN with /? > 0, A/„ ,, denotes the causal state operator A,/„ with rank «; for any n eN with M > 1, ||„, y_„, and |„ denote the merge, left merge, and communication merge with rank n, respectively. The required ordering can now be defined as the transitive closure of the relation < specified as follows: -h < •; for any n eN with M > 1, • < U_„ < ||„ < IL„-|.i and • < ! , / < ||;; < |/j+i; for all a e AC{C, A),8 0, >./„,, < XJ^ ^^_^,. Given this ordering, the details of the proof are straightforward and, hence, omitted. D
Note that Theorem 9.7 implies that any cause-addition operator in a closed term can be eliminated. Thus, cause addition does not add expressive power to an equational theory with choice and sequential composition. However, it is well known that in an interleaving framework choice and sequential composition are sufficient to specify processes with bounded behavior. A more interesting result is the fact that an equational theory with parallel composition, cause addition, causal state operators, and cause abstraction is sufficiently expressive to eliminate sequential composition. EXAMPLE 9.8. Let r and s be two actions in AC{C, A). Consider the simple sequential process r - s. This example shows how to eliminate the occurrence of the sequentialcomposition operator in this simple process. The idea is to replace the sequentialcomposition operator with a parallel-composition operator while using two additional causes and a causal state operator to restrict the parallel composition in such a way that it behaves as a sequential composition. Cause abstraction is used to hide the new causes and, thus, to obtain the original sequential process. It is assumed that the communication
838
J.C.M. Baeten, T Basten
function equals l+l. Let c be a cause in C that does not occur in the consumption or production of r and s. Consider the term Pca([c])i'^^^\r^ II ^s)). It specifies that action r produces an extra output cause c, whereas s requires an extra input cause c. As a consequence, the state operator X\^ enforces a sequential ordering between r and s:
= Pca{{c]) (^o''^ ((cr, 5r, pr l±) [c]) • {cs W [c], ss, ps) + (C5 W [c], 55, p5) • (cr, sr, pr l±J [c]) + {cr l±) C5 l±) [c], sr W ss, pr^ps^
[c])
)) = r • Pcfl({c}) ( A | ' ] ((C5 W [C], 55, P5))) + 5 + 5 = r s.
Note that two assumptions are essential in the above derivation. First, cause c must be a new cause not already occurring in the consumption or production of r and s. If this assumption is not satisfied, the causal state operator XQ might disturb the desired behavior. Second, the communication function may not specify any actual communications that affect the new cause c, because such communications can also disturb the desired result. The assumption that the communication function equals l+l, which means that a partial-order framework is obtained, satisfies this restriction. Also any communication function that can be derived from a communication function on atomic actions, as explained in Section 7, is an allowed choice. Yet another possibility is to choose the communication function that is undefined for any pair of actions, which implies a total-order setting. The remainder of this subsection is devoted to proving that the approach to eliminating a sequential-composition operator illustrated in Example 9.8 can be generalized to arbitrary closed terms in C(C, A). The reason for introducing the notion of a basic term and proving the elimination result of Theorem 9.7 is not only to illustrate that cause addition can be eliminated from closed terms. An important consequence of Theorem 9.7 is that properties formulated in terms of closed terms can be rephrased in terms of basic terms without losing generality. Properties on basic terms can often be proved by means of structural induction, which is the technique also used in Section 5. Structural induction is also used to prove the main result of this subsection. In reasoning about cause addition, it is convenient to know the set of causes that occur in a closed term. For this purpose, the causes function is introduced. The causes function yields for each closed term in C(C, A) the set of causes that the corresponding process in the model obtained by following the approach of Section 5.2 consumes or produces during any of its execution paths. The causes function is defined inductively using the structure of basic terms, under the assumption that two terms that are derivably equal have the same set of causes. In combination with the elimination result of Theorem 9.7, this assumption means that it is possible to calculate the causes of arbitrary closed terms in C(C, A).
Partial-order process algebra
839
DEnNlTlON9.9 {Causes function). The causes function causes\C{C, A) -^ V(C) is a function such that, for any closed terms p and q in C(C, A), ((ACP;" +RN)(AC(C, A), y) h p = q) =^causes(p) = causes(q). For any a eACiC, A)sindp,q 6 C(C, A),causes(8) = 0, causes(a) = {c \ c e ca^S pa], causes(a • p) = causes{a) U causes(p), causes{p -\-q) = causes(p) U causes{q). Note that it should be verified that the definition of the causes function is consistent with the axioms of set theory. Inconsistencies arise when the combination of the requirement that derivably equal terms have the same set of causes and the inductive definition allows the derivation of an equality between sets that is not derivable from set theory. It is beyond the scope of this chapter to prove that Definition 9.9 is consistent with set theory. The definitions given so far are sufficient to formalize the main result of this subsection, namely the elimination of sequential composition by means of cause addition. The proof uses a number of auxiliary properties that are given below. Note that, for the sake of simplicity, the communication function is assumed to be l±). However, any communication function that does not affect causes is allowed. THEOREM 9.10 (Elimination of sequential composition). Let p,q be closed terms in C(C, A) and c a cause in C; let I = {c].
c ^ causes{p) U causes{q) =>• (ACP$; +RN)(AC(C, A), l±)) h
p • ^ = pcaini^oip' V'q)) = Pcaini^oip' II 'g))' The proof is by induction on the structure of basic terms. Recall that = denotes structural equivalence of terms. It follows from Theorem 9.7 that there exists a basic term t e B(C, A) such that (ACF;; + RN)(AC(C, A), l±i) h p = r. Thus, it suffices to show that (ACP^ + RN)(AC(C, A), W) h r • ^ = PcaiDi^oit' I 'q)) = Pcaini^oU' II 'g))- It follows from Definition 9.9 (Causes function) that causes(t) = causesip) and, thus, that c ^ causes{t). (i) Assume that r = 5. It is straightforward to prove from the axioms of (ACP^ -I- RN) (AC(C, A), l±l) that PROOF.
PcauMiii^ 0
=
I q))
=
PcaiDV-is^^l
q))
=
Pca(/)(^o(^))
=
t -q,
which completes the first part of the proof for the case that r = 5. In addition, using the above result, the following derivation can be obtained. Po«(/,(xi(5'- II '•?)) '''"='''
PcauMl^iS'-
Vq+'-^l&
+ S\ ''9))
'''''='''
840
J. CM. Baeten, T. Basten
which completes the proof for the case / = 5. (ii) Assume that t = a, for some action a € AC{C, A). The second step in the following derivation uses the fact that c ^ causes{t)\ the third step uses that c ^ causes(q). Pca(i){^o(a'' Vq)) =
^ ^^^'^
Pca{i){^o{(ca,sa,pa\±)lc])''q))
a'Pca{I){)^[c\(q))
=
^•^•
Using this result, the following derivation can be obtained. Pcaini^ia^
II 'q)) ''= Pcaini^i^ia'- V'q + 'q la^' + «^ I 'q)) ^ ' ' ' = ' ' ' ' '
PcauM^"
Vq))
+ Pcaini^oCq
la'))
+ Pcai!){^o(^'' I ' ^ ) )
9.14,9.15,/?A^1,A6
tq. which completes the proof for this case, (iii) Assume that r = a • 5, for some action a e AC{C, A) and basic term s e B(C, A). The second step in the following derivation uses the fact that c ^ causes(t). (^K^
^c „ c W OC4.CM3
Pcaii){K{(^'^y Vq))
=
.. / /
, ,- ,, ,- ,xx CS04.CS02.RN3.RN\
Pca(iMo{^-(s W q)))
/'•\ / / f II c x\ Induction a ' pcaU)[^o(^ W q)) = Ci'Sq
t=as = t q .
Using this result, the following derivation can be made.
Pca(n{K{(^'^y W q)) PcailMia-sf
=
Vq))^PcaU)Mq
lici ^ sf))
^ Pcail){4{(^
' sf
I 'q))
9.14,9.15,/?A^1.A6
tq. (iv) Assume that r = M + u, for basic terms u,v e B(C, A). /W//
.
^c ,1 c W OC3,CM4
Pca(/)WU" + *^) Vq)) / W / c II c x\ ,
=
/, / ,
,. ,, c
,
CMC ^^
Pca(/)(H(" Vq-^v' IL q))
CS05.RN2
=
/ W / CMC . \ Induction(2x)
Pcfl(/)W(" Vq))-^pcaii){^o(u Vq))
=
A4,/=«+i'
u -q -\-v -q
=
t -q.
In addition, A///
.
\c l i e \ \ CM1,CS05,/?A^2
Pca(/) W ( ( " + VY V'q)) + Pca(/) W C ' ^ IL (" + ^y))
+ Pca(/) W((W + l^)^" I 'q))
9.14,9.15,/?A^1,A6
which completes the proof.
D
Partial-order process algebra
841
The above proof uses a number of auxiliary properties that are given below. Example 9.8 can be used to better understand these properties. All the properties are proven by means of structural induction. However, since the proofs are much simpler than the proof of Theorem 9.10, the details are omitted. Note that three of the four properties can be proven for arbitrary communication functions. Only for Property 9.12, it is required that the communication function does not affect causes. PROPERTY 9A\.
Let p,q be closed terms in C(C, A), I £ C a set of causes, and c a
cause in I. (ACPI + RN)(AC(C, A), y) h X^Cp lq) = 8. It follows from Theorem 9.7 that there exists a basic term t e B(C, A) such that (ACP{ + RN)(AC(C, A), y) h p = t. It suffices to show that (ACP^; -f RN)(AC(C, A), y) h A^(^r [[ ^) = 5. The proof is by induction on the structure of basic term t. n PROOF.
PROPERTY
9.12. Let p,q be closed terms in C(C, A), / C C « set of causes, and c a
cause in /. (ACP$; + RN)(AC(C, A), l±)) h X(^(p \ 'q) = 8. PROOF. It follows from Theorem 9.7 that there exist basic terms s, t e B(C, A) such that (ACP^ -h RN)(AC(C, A),\S) h p = s A q = t. It suffices to show that (ACF^ -h RN)(AC(C, A), W) h- Xj^is I 't) = 8. The proof is by induction on the structure of basic term s. The first three cases are proven by induction on the structure of basic term /. The proofs of the second and third case use the fact that the communication function equals l±). D PROPERTY 9.13. Let p be a closed term in C(C, A), I £C a set of causes, and m a bag of internal causes in B{I),
causes(p) H / = 0 => (ACP^;; + RN)(AC(C, A), y) h Pcaii){^L(P)) = PIt follows from Theorem 9.7 that there exists a basic term t e B{C,A) such that (ACP$; + RN)(AC(C, A), y) h /? = r. It suffices to show that (ACF^ + RN)(AC(C, A), y) h Pca{i)i^!n(0) = I' The proof is by induction on the structure of basic term t. D PROOF.
PROPERTY
9.14. Let p be a closed term in C(C, A), / c C « set of causes, and c a cause
inL causes(p) H / = 0 =» (ACP^^; -h RN)(AC(C, A), y) h PcaU){^[c\C'P)) = P-
842
J.C.M. Baeten, T Basten
It follows from Theorem 9.7 that there exists a basic term / € B{C, A) such that (ACP^ + RN)(AC(C, A), y) h /? = /. It suffices to show that (ACP$; + RN)(AC(C, A), y) f- pca{i){^[c]i^t)) = t. The proof is by induction on the structure of basic term t. The proof of the third case uses Property 9.13. D PROOF.
9.S. Concluding remarks In this section, it has been shown how cause-addition operators can be used to specify causal orderings between actions in an algebraic expression. The cause-addition operators are inspired by the causality mechanism known from Petri nets. In labeled P/T nets as defined in Section 4, causal relationships are enforced via places. An occurrence of a specific (input or output) cause-addition operator in an algebraic expression corresponds to a place and an accompanying (input or output) arc in a labeled P/T net. In the algebraic framework of Section 6, information about input and output causes of steps is implicit in actions. Cause addition can be used to make causality information explicit. It can be used to adapt the algebraic semantics of labeled P/T nets, as defined in Definition 6.8, accordingly. Theorem 9.10 shows that the combination of the causal state operator and cause addition can replace sequential composition. It substantiates the statement by Milner in [45] that sequential composition is not necessarily needed as a primitive operator in a processalgebraic theory. Note that Theorem 9.10 is formulated for processes with bounded behavior only. However, we claim that it can be generalized to a setting with iteration and even to a framework allowing general recursion.
10. A non-interleaving process algebra As mentioned before, Petri-net theory is one of the most well-known examples of a partialorder theory for specifying and analyzing concurrent systems. In Section 5, it has been shown how standard ACP-style process algebra can be turned into a partial-order framework. In Sections 6 and 9, two extensions of the standard process-algebraic framework have been introduced that are inspired by concepts from Petri-net theory, namely the causal state operator and cause addition. Thus, it is possible to give algebraic specifications in the style of Petri-net theory. The basis of such a specification is a parallel composition of component specifications. Causal relationships are specified by means of cause-addition operators. A causal state operator is used to restrict the parallel composition with respect to a specific initial marking of causes and, thus, to enforce an actual ordering of actions. However, several aspects of the algebraic framework developed so far have no equivalent in Petri-net theory. First, as already mentioned in Section 4, standard Petri-net theory does not distinguish between successful termination and deadlock, whereas such a distinction is made in ACP-style process algebra. Second, the communication-merge operator has no straightforward interpretation in the Petri-net framework of Section 4. Consider, for example, the specification of process C in Example 5.26. It is not possible to specify this process by means of a labeled P/T net as defined in Definition 4.1. Finally, all the equational theories and their models that have been considered so far are interleaving theories
Partial-order process algebra
843
and algebras, which means that each parallel composition can be written as a so-called head normal form. The notion of a head normal form is another notion that does not have a straightforward counterpart in Petri-net theory. In Section 10.1, we develop an algebra of so-called non-terminating serializable processes. The domain of this algebra contains only processes that cannot terminate successfully. Moreover, the signature of this algebra does not contain a communication merge. It turns out that this algebra of non-terminating serializable processes is a non-interleaving process algebra. Thus, the algebra has several important characteristics of a Petri-net framework. Section 10.2 contains a brief discussion on causahty in process algebra, in particular, non-interleaving process algebra. In Section 10.3, it is shown that all nonterminating serializable processes with bounded behavior can be specified without using choice, sequential composition, or communication. Thus, in the context of non-terminating serializable processes with bounded behavior, the causality mechanism borrowed from Petri-net theory in the form of the causal state operator and cause addition is sufficiently powerful to replace the standard algebraic operators and, thus, the standard causality mechanism in ACP-style process algebra.
10.1. The algebra of non-terminating serializable processes The basis of the algebra of non-terminating serializable processes is the process algebra M(C,A, y) of Section 9.2, where C is a set of causes, A a set of atomic actions, and y a communication function on the set of actions AC(C, A) = B{C) x B{A) x B{C). In order to obtain a partial-order theory, it is assumed that the communication function equals i±). The goal is to restrict the domain of M{C, A, i±i) in such a way that the resulting set of processes contains only processes that have an intuitive interpretation in terms of labeled P/T nets. The notion of a non-terminating serializable process is defined in the context of a process space as defined in Definition 3.1. Therefore, let {V, .4, ->, i ) be some process space. Let = ^ C p X P be the reachability relation in this process space as defined in Definition 3.2. A process is said to be non-terminating if and only if it cannot terminate successfully. That is, a process is non-terminating if and only if it terminates in a deadlock or it does not terminate because its behavior is unbounded. DEnNlTiON 10.1 (Non-terminating process). Let p be a process in V. Process p has the option to terminate, denoted J| /?, if and only if there is a process p' in V such that p = ^ p' and I p\ Process p is non-terminating if and only if -• >|| /?. The notion of serializability is only meaningful if processes can perform some kind of steps. Therefore, assume that the set of actions in the process space A equals AC{C, A). The basic idea of serializability is as follows. Assume that a process can perform a step that consists of several atomic actions. The process is serializable only if it can perform all the atomic actions in the step in isolation and in any order. The bags of input and output causes of the step may be distributed over the atomic actions in some arbitrary way.
844
J.CM. Baeten, T. Bast en
10.2 {Serializable process). Let /? be a process in V. Process p is serializable if and only if, for any p\ p" eV,a e AC(C, A), and a i , Qf2 € B(A) \ {0} such that p = ^ p^ and sa =a\ l±Ja2, DEHNITION
P
/ a
ff
^
> P =^ (dp ,a\,a2: p" eV Aa\,a2 eACiC P
>P
A) Asa\ =a\ Asa2=(X2 Aa = a\ l±J«2 ^
>P
). EXAMPLE 10.3. Let /?, p\, p2, n and s be atomic actions in A; let 1, 2, 3,4,5, and 6 be causes in C Figure 15 shows two simple processes (that are variants of processes depicted in Figures 1 and 2). Square brackets of singleton bags are omitted. Clearly, both processes are non-terminating. The process shown in Figure 15(a) corresponds to an unbounded iteration, whereas the process shown in Figure 15(b) terminates in a deadlock. Process (a) is serializable for the simple reason that it cannot perform a step consisting of more than one atomic action. Process (b) is not serializable. After its initial action, it can perform a step [p\, Pi] or it can perform the sequence of the two steps [p\] and [p2]' However, it cannot perform the sequence [p2] followed by [pi].
In the introduction to this section, it is implicitly claimed that labeled P/T nets as defined in Section 4 correspond to non-terminating serializable processes. Note that Definition 10.2 (Serializability) can be easily adapted to a setting where actions do not contain causes. Consider the step semantics of marked, labeled P/T nets defined in Definition 4.13. Clearly, marked, labeled P/T nets cannot terminate successfully. In addition, it follows from Definition 4.12 (Step firing rule) that all marked, labeled P/T nets define serializable processes. If several transitions in a labeled P/T net are enabled simultaneously, then each of these transitions is also enabled separately and firing one of these transitions does not disable any of the other transitions.
(l,r,2)/
,(3,5,1)
(2, p , 3)
(1 r. 2.3]) (2, P\ (3, P2
V
([2.3],[/>i.p2].[4.5])
>K
([4.5] , 5 , 6 )
(a)
(b)
Fig. 15. A non-terminating serializable process (a) and a non-terminating process that is not serializable (b).
Partial-order process algebra
845
EXAMPLE 10.4. Consider the marked, labeled P/T net of Figure 4 and its step semantics discussed in Example 4.14. It is not difficult to see that the P/T net of Figure 4 defines a serializable process. It is interesting to compare this process to the process depicted in Figure 15(b).
Let us return to the process algebra M{C, A,^). This algebra is a model of the equational theory (ACP*^ + RN + RSP* + SC)(AC(C, A), l±l) of Section 9.1. Let C{C, A) be the set of closed (ACP*' + RN -f RSP"" + SC)(AC(C, A), i±l) terms. Let {C{C, A) U {>/},v4C(C, A), ->, {^}) be the process space defined in Section 9.2, underlying the algebra M{C, A, (±1), with reachability relation = ^ C (C(C, A) U {^}) x {C{C, A) U {^]). The following result is a direct corollary of Definition 10.1. COROLLARY
10.5. For any closed term p in C(C, A), ^ p O p = ^ y/.
As required by Definition 10.2, the set of actions in the process space (C(C, A) U (V),i4C(C, A), ->, {y/}) corresponds to /4C(C, A). The set of all non-terminating serializable processes in this process space is denoted Cns(C, A). 10.6. Consider again Example 10.3. The process depicted in Figure 15(a) is specified by the term (V^ • ^p^ •^s^)*8, where a triple (0, a, 0) G AC(C, A) is identified with its second element and square brackets of singleton bags are omitted. Another term representing the same process is k\^'^'^\^r^*8 \\ ^p^*8 \\ ^s^*8). The process of Figure 15(b) is specified by, for example, term (V')-^ • (Vi"^ • ^P2^ + V i ^ I ^2^) • ^(^s^) • <5. Another example of a non-terminating serializable process is the term (^r^)^ • (^pi"^ \\ ^P2^) ' ^(^s^) • 8. Equivalent terms, thus representing the same process, can be found in Example 6.2. Two other examples of (non-terminating) processes that are not serializable are \^[p\, Pl]^)^ ' ^ and pfi^p^ • 8) where / is the renaming function that renames action (2, /?, 3) into action ([2, 3], [p\, pi], [4, 5]). Finally, term C as defined in Example 5.26 corresponds to a (terminating) process that is not serializable (provided the definition of serializability is adapted to the setting without causes). EXAMPLE
The next step is to turn the set of non-terminating serializable processes into an algebra. For this purpose, it is necessary to define a signature for the algebra containing a number of meaningful functions on non-terminating serializable processes. The signature of (ACP*^ H- RN -f RSP* -h SC)(AC(C, A), (±i) might appear to be a suitable starting point. However, not all constants and operators in this signature are useful. The domain of an algebra must be closed under function application. In other words, a constant in the signature of the algebra of non-terminating serializable processes must, of course, be a non-terminating serializable process; an operator applied to non-terminating serializable processes must yield a non-terminating serializable process again. The consequences of these observations become clear when considering the following. First, the actions in AC(C, A) correspond to processes that can terminate successfully. Thus, these actions are not suitable as constants in our algebra. Second, as illustrated in Example 10.6, processes that can perform isolated actions of which the step contains more than one atomic
846
J.C.M. Baeten, T Basten
action are not serializable. Third, the communication merge often yields processes that are not seriaHzable. Finally, some renaming functions, such as the one given in Example 10.6, may yield processes that are not serializable even if they are applied to a serializable process. The above observations identify a number of constants and operators that cause technical problems. However, in addition, several of the operators in the signature of (ACP^^ -}RN + Z^^P* + SC)(AC(C, A), l±i) are not very meaningful in the context of non-terminating processes. The standard ACP-style sequential-composition operator, for example, is not very useful when its left operand is a non-terminating process. The same is true for the binary Kleene star. In addition, also output-cause addition is not very meaningful for nonterminating processes. Many of the problems can be solved by replacing the sequential-composition operator by a set of action-prefix operators in the style of CCS [44,45] and the binary Kleene star by a class of prefix-iteration operators (see [24] and [12], Chapter 5 of this Handbook). It is important to define a suitable class of actions that can form the basis for these prefix operators. The following definition is inspired by the notion of a transition in a P/T net. A Petri element can be seen as the algebraic equivalent of a transition combined with its bags of input and output places. DEFINITION 10.7 {Petri elements). The set of Petri elements over the sets of causes C and atomic actions A, denoted PE(C, A), is inductively defined as follows. For each atomic action a in A, (0, [a], 0) is an element of PEiC, A). For each Petri element e in PE{C, A) and cause c in C, ^e and e^' are elements of PE(C, A).
Note that each Petri element in PE(C, A) is derivably equal to an action in AC(C, A) with a step consisting of only a single atomic action. The converse is also true. For each Petri element e in PE(C, A), the operator ^ • _ is an action-prefix operator and ^ * _ is a prefix-iteration operator. The semantics of action-prefix and prefix-iteration operators follows immediately from the semantics of actions, input-cause addition, outputcause addition, sequential composition, and the binary Kleene star. Most of the problems identified above are solved if the action constants, the sequentialcomposition operator, the binary Kleene star, and the output-cause-addition operators are replaced by the above prefix operators. Two problems remain, namely the communication merge and the renaming operators. The solution to the first problem is simply to remove the communication merge from the signature of our algebra. To solve the second problem, recall the subset of renaming functions defined in Section 7. All these renaming functions are derived either from a renaming function or a communication function on atomic actions or from a renaming function on causes. That is, they are all defined in terms of the structure of actions. All these renaming functions using the structure of actions can be used as the basis for a renaming operator in the signature of our algebra. Observe that the renaming function in Example 10.6 is not defined in terms of the structure of actions. Recall from Section 5.1 that RF denotes the set of all renaming functions. Let SRF c RF be the subset of renaming functions that consists of all the renaming functions introduced in Section 7. At this point, we have obtained a signature of meaningful operators. It contains the inaction constant 5, the standard ACP operators choice, merge, left merge, and a whole
Partial-order process algebra
847
class of renaming operators, including encapsulation operators, explicit communication operators, and cause-abstraction operators, as well as a notion of sequential composition, a notion of iteration, the causal state operator, and input-cause addition. Let E denote the signature containing constant 5, the operators +, ||, and [[, for each / e SRF, the operator p / , for each e G PE(C, A), the operators e • and ^ *, for each / c C and m G B ( / ) , the operator A^, and, for each c G C, the operator' _. EXAMPLE 10.8. Consider again Example 10.6. The iteration in the term ^r^-^p^-^s^ys is not a prefix iteration. However, the equivalent term x\^''^'^\^r^ * 8 \\ -p^ * 8 \\^s^ * 8) only contains prefix iterations. The term Cr^)^ • (-pi^^ \\ ^pi^) • ^{^s^) • 8 contains two Petri elements outside the context of an action prefix and one general sequential composition. Thus, it is not in the restricted signature E defined above. It is an interesting exercise to construct an equivalent term that only uses operators of the restricted signature (see also Example 6.2). Finally, it is not difficult to verify that none of the terms in Example 10.6 corresponding to a process that is not serializable is in the restricted signature Z.
10.9. The set of non-terminating serializable processes CnsCC, A) is closed under the operators in signature E.
THEOREM
The proof consists of a tedious, but rather straightforward, analysis of the transition relation defined by the derivation rules in Tables 6, 8, and 10. Let p and q be two closed terms (C,A). (i) It must be shown that p -\- q is SLU element of Cns(C, A). First, it must be proven that -^ii^p -{-q. This follows immediately from the observation that p -^ q can only perform an action if either p or q can perform that action and the fact that -• J| p and -- J| ^ • Second, it must be shown that p + q is serializable. The desired result follows from again the observation that p-{-q can only perform an action if either p or q can perform that action and the fact that both p and q are serializable. (ii) It must be shown that p \\ q is an element of Cns(C, A). First, it follows immediately from the derivation rules in Table 6 that ]}. p \\ q if and only if both 4 P and J|<7. Hence, ->ii^p \\q. Second, assume that r is a closed term in CiC A) such that p II q =^ r. It follows from the fact that both -• J| p and -»JJ. <7 that r must be of the form /?' || q' with p\ q' G C{C, A) such that p = ^ p' and q = ^ q . Let a be an action in AC(C, A) and let a\ and a: be two non-empty bags in B{A) \ {0} such that sa=a\ l±) Qf2 and r can perform the action a. Three cases can be distinguished. First, there exists a closed term p" G C{C, A) such that p' -^ p'\ which means that r = p'\\q' - % p" \\q'. Since p is serializable, there exist a closed term p'" G C{C, A) and actions ax.ai G AC(C, A) such that sa\ = a\, sa2 = a2, a = a\ ^ ai, and p' J^ p'" ^ p"^ Hence, p' \\ q' - ^ p'" \\ q' ^ ^ p" \\ q\ which means that p \\ q satisfies the serializability requirement in this case. Second, there exists a closed term q" G C{C, A) such that q' - ^ q\ which means that r = p'\\q'-^ p' \\ q". The argument proving that p \\ q satisfies the serializability requirement in this case is identical to the previous case. Third, there exist closed terms p\q" £C{C, A) and actions b,c e AC(C, A) such that a = y{b, c) = b\^c, p' - ^ p'\ and q' -^ q'\ PROOF.
848
J.C.M. Baeten, T Basten
which means that r = p' \\ q' - ^ p" \\ q". Since sa = ot\^ oci, it follows that there are bags Ofp Ofp 0^2, ^2 ^ ^ ( ^ ) such that ofi =a^l±)Qfpa2 =Qf2 ^ ^ 2 . *^ = Q?^'^^2, and sc = a\\S a\. We only consider the case that oi\, cy^, OL\, and a\ are all nonempty. The serializability of p and q yields that there exist p"\q"' € C(C,A) and actions Z?!, Z?2, ci, C2 € AC(C, A) such that sb\ = ofp sb2 = otj, b = b\ ^ bj, p' _ ^ p'" _ ^ ^-^ sex = a;, 5C2 = a^, c = c, W o , and ^' ^ ^ ^'^^ ^ ^ ^ ^ It easily follows that r = p'\\ q' - ^ i ^ p'" \\ q'" - ^ ^ ^ p" \\ q" with s{bx Wcj) = ofj, s(Z72 W Q ) = 0^2, and a = (^i 1+) ci) l±J (Z72 W Q ) . which means that also in this case p II q satisfies the serializability requirement. (iii) It must be shown that/7 ^q is an element of Cns(C, A). The proof is almost identical to the proof for the merge operator. (iv) It must be shown that pf{p) with / G SRF is an element of Cns(C, A). Clearly, "-^>l|p/(/7), because -^^p. To proof that pf{p) is serializable, assume that r is a closed term in C(C, A) such that Pf{p) = > r. It follows from the fact that -^^p that A* must be ofthe form p/(/7') with p' eC(C, A) such that 77=^/7'.Furthermore, assume that/a is an action in AC{C, A) and that a\ and aj are two non-empty bags in B(A) \ {0} such that sfa = a\ l±) cyi and r can perform the action/«. For all the renaming functions in SRF, it follows from the fact that p is serializable that there are actions a, a\,a2e AC(C, A) and closed terms p'\ p'" e C(C, A) such that (1) f(a) =fa, p' ^^ p\ and r ^ pf{p"), (2) a=a\\Sa2 and p' - ^ p'" - ^ p\ and (3) s{f{ax)) = ax, s{f{a2)) = a2 Ja = f(ax)^ / t e ) , and
(v)
(vi)
(vii)
(viii)
r > pf{p ) > Pfip )• As a result, pf (p) is serializable. It must be shown that e • p with e e PE(C, A) is an element of Cns(C, A). It follows from Definition 10.7 (Petri elements) that there exist unique bags of causes c,d e B(C) and a unique atomic action a e A such that e • p ^' ^^ ' S p. Process e • p cannot perform any other action. Thus, it follows easily from the fact that -- J| /? that also -^ J|^ • /?. In addition, since the first action of e - p consists of a single atomic action and p is serializable, e • p satisfies the serializability requirement, It must be shown that e* p with e e PE{C, A) is an element of Cns(C, A). First, since -^i^p, also ->i^e*p. Second, assume that r is a closed term in C{C, A) such that e*p = ^ r. It follows from the fact that ^ is a Petri element and that -'ijrp that either r must be equal to e* p and all actions executed to reach r from e* p correspond to ^ or r must be of the form p' with p' e C(C, A) such that p = ^ p'. Thus, serializability of e*p follows easily from the fact that ^ is a Petri element and that p is serializable. It must be shown that A/^,(p) with / C C and m e B(I) is an element of Cns(C, A). Clearly, --JIX^^C/?), because -"Jlp. The fact that A/„(/7) is serializable follows from the serializability of p and the observation that, for any two actions ^i, ^2 ^ AC(C, A), c(ax W a2) = cax W ca2. Finally, it must be shown that ^p with c G C is an element of Cns(C, A). Again, -141 ^p, because -^41/7. The fact that ^p is serializable follows from the serializability
Partial-order process algebra
849
of p and the observation that the input-cause addition operator ^ _ only affects the consumption of the first action performed by p. D The final step in the construction of the algebra of non-terminating serializable processes is to restrict the set of closed terms in Cns(C, A) to closed terms over the restricted signature r . The set of all non-terminating serializable processes over signature E is denoted C~^(C, A). The following result is a direct consequence of Theorem 10.9. COROLLARY 10.10. The set C~^{C, A) of all non-terminating serializable processes over signature E is closed under the operators in E.
Based on this result, the set of non-terminating serializable processes over signature E can be turned into a process algebra following the approach of Section 5.2. DEFINITION 10.11 {The algebra of non-terminating serializable processes). The process algebra .4ns(C, A) of non-terminating serializable processes is defined as follows. The domain of ^ns(C, A) consists of equivalence classes of closed terms in C~^{C, A) modulo bisimilarity. The signature of An^C, A) contains, for each function ® in X", a function 0 which is function 0 lifted to equivalence classes of closed terms. The process algebra AsCC, A) is a subalgebra of the algebra M{C,A, lil) given in Section 9.2. The algebra AnAC, A) incorporates several important features of the Petrinet formaUsm. An interesting aspect of An^{C, A) is that it is a (branching-time) noninterleaving, partial-order process algebra. To prove this claim, it is necessary to slightly adapt the framework developed in Section 5.2. Definition 5.15 (Head normal form) is based on the assumption that the signature of an algebra contains a set of action constants and a general sequential-composition operator, which is not the case for AnAC, A). However, it is straightforward to adapt the definition of a head normal form to the current setting as follows. 10.12 {Head normal form). The set of processes over the signature of the algebra An^{C, A) in head normal form, denoted Wns(C, A), is inductively defined as follows. First, I is an element of Wns(C, A). Second, for any Petri element e in PE{C, A) and process d in the domain of ^ns(C, A), the process e'- d is an element of Wns(C, A). Finally, for any processes u and v in Hns(C, A), process w + u is an element of 7ins(C, A). DEHNITION
THEOREM 10.13. The process algebra Ans{C,A) is a non-interleaving, partial-order process algebra.
prove the theorem, consider the closed term e -5 \\ f -8, where e = (0, [a], 0) and / = (0, [b], 0), for a,b e A, are two Petri elements in PE{C, A). Ignoring consumptions and productions. Figure 16 visualizes this process. Clearly, this process is nonterminating and serializable, which means that it is an element of C~^{C, A). The corresponding process in the algebra AnsiC, A) is e~- 8 \\ f -8. Since the process can perform an action (0, [a, b], 0), A s ( C , A) is a partial-order algebra. In addition, the process is not PROOF. TO
850
J,C.M. Baeten, T Basten
ly [fe]\. ./[a]
a = [a, b]
Fig. 16. The visualization of a process in v4ns(C, A) that can perform two atomic actions simultaneously and is not in head normal form.
an element of Hns(C, A), as defined in Definition 10.12, which means that it is not in head normal form. The process cannot be written in head normal form, because action (0, [a,b], 0) is not a Petri element and because | is not an element of signature iJ. As a consequence, according to Definition 5.16 (Interleaving process algebra), An^C, A) is a non-interleaving process algebra. D The process algebra Am{C, A) is not obtained directly as a model of an equational theory, but indirectly as a subalgebra of a model of an equational theory, namely the theory (ACP*^ -h RN + RSP* + SC)(AC(C, A), l±i). An interesting consequence is that this equational theory can be used to reason about the equivalence of processes in the algebra Ans(C, A). The following theorem states that an equation of two closed terms in C~^{C, A) that can be derived from the equational theory (ACP*^ + RN + RSP* + SC)(AC(C] A), l±l) is valid in the algebra AndC, A). That is, the two closed terms specify the same process in the domain of the algebra. (Note that it is straightforward to adapt the notion of validity to the current setting.) THEOREM
10.14 (Soundness). For any closed terms p,q eC~^{C, A),
(ACP*^' + RN + /?5P* + SC)(AC(C, A),\±})\-p = q => A s ( C A)\=p = q. PROOF. It is a direct consequence of Theorem 9.2 that states that A1(C, A,l±i) is a model for (ACP*^ + RN -h RSP* -f SC)(AC(C, A), W) and Definition 10.11 that defines A s (C, A). D EXAMPLE 10.15. Consider the closed term e -8 \\8, where e = (0, [a],0), for « G A, is a Petri element in PE(C, A). Clearly, this term is an element of C~(C, A). The following derivation shows that it is equivalent to term e • 8 which is also an element of C~^(C, A). The interesting aspect of the derivation is that the intermediate term is not an element of C-(C,A).
e'8\\8 =
{CM1,CM3,CM5} e'(8'8-\-8'8 + 8\8)^8'e'8-\-ie\8)'8 {A6,A7,C1,C3} e'8.
Partial-order process algebra
851
It is not difficult to see that the first and last terms of the above derivation correspond to the same process in the algebra A s ( C , A). It is interesting to study a slightly larger example. EXAMPLE 10.16. Let us return to Example 6.4. This example describes two specifications of a two-place buffer, one specification using the standard communication mechanism of ACP-style process algebra and one specification using the state operator. It is straightforward to adapt the latter specification in such a way that the result is a term in C~^(C, A). Let A be some set of atomic actions that includes the actions ri, r2,52, C2, and 53; let C be a set of causes including the causes 1,2, 3,4, and 5. Let / be the set of causes {1, 2, 3,4,5}.
Pcain{^iu2]{'(WrS\\{Wf*8\\W''S\\W-'S)).
(1)
The other specification in Example 6.4 is a modular specification. Two terms B\2 and B23 specify two one-place buffers. Clearly, these terms are not terms over the restricted signature Z. Therefore, in this example, ^1.2 and ^2.3 are defined as follows: Bu2 = Pca({i.2})(M^'-Vn^*5||-52'*5))
B2J =
and
Pcai{2M^^2'^kW'S\\W'S)).
It is not difficult to verify that the encapsulation operator 9// and the renaming operator Pcm defined in Example 6.4 satisfy the requirements explained in Section 7, which means that they are elements of signature Z". As a consequence, the two-place buffer can be specified by the following term in C~^(C, A): dH{pcm(Bi,2\\B23))^
(2)
By now, it should no longer be a problem to verify by means of the equational theory (ACP*^ -f RN H- RSP* + SC)(AC(C, A), l±)) that both specifications (1) and (2) are equivalent to the following term (see also Example 6.4): n-((c2'(nlh3))*5).
(3)
Clearly, this term is not an element of C~^{C, A) (although it is an element of Cns(C, A)). Summarizing, closed terms (1) and (2) have direct interpretations in the algebra Ans(C, A). The equivalence of these two terms can be proven via an intermediate term (3), which has no direct interpretation in ^ns(C, A). So far, it has been explained how to construct an algebra of non-terminating serializable processes. It has been shown that this algebra is a non-interleaving partial-order process algebra. In that sense, it has the same characteristics as the P/T-net framework of Section 4. It allows algebraic specifications in the style of labeled P/T nets (using parallel compositions, cause addition, and causal state operators as the main operators). In addition, it has
852
J.C.M. Baeten, T Basten
been shown that the (interleaving) equational theory of Section 9.1 can be used to reason about processes in the non-interleaving algebra. Example 10.16 illustrates another interesting aspect of the algebra of non-terminating serializable processes. It incorporates both the standard causality mechanism known from process algebra (consisting of sequential composition and communication) and the causality mechanism adopted from Petri nets (consisting of the causal state operator and cause addition). It is interesting to study these two mechanisms in more detail.
10.2. A brief discussion on causality In an interleaving process algebra, each parallel composition can be written equivalently in head normal form. In standard ACP-style process algebra, this means that sequential composition is sufficient to express any causal relationships. That is, communication is not necessary as a primitive causality mechanism. However, in a non-interleaving process algebra, it is no longer possible to express each parallel composition by means of a head normal form. In the algebra w4ns(C, A) developed in the previous subsection, it is not possible to specify the two-place buffer of Example 10.16 without either communication or a causal state operator. However, the reason is the restricted expressivity of the prefix-iteration operators. In [4], a non-interleaving, partial-order algebra of (possibly terminating) serializable processes is defined in a way very similar to the definition of the non-interleaving algebra of the previous subsection. The algebra in [4] contains the standard algebraic operators, including general sequential composition, plus the causal state operator and cause addition. In addition, the algebra incorporates linear recursion. As a result, in that algebra, it is possible to specify a two-place buffer without communication or a causal state operator. However, it is shown that it is not possible to specify a three-plsicc buffer without communication or a causal state operator. The consequence of this last observation becomes clear when we observe that the technique to construct a non-interleaving process algebra can also be applied to standard ACP-style process algebras. Consider, for example, the standard theory (ACP* + RN -}RSP* + SC)(S(A), l±l) as introduced in Section 5, where A is some set of atomic actions. Its model M(B(A), l±)) of Section 5.2 can be reduced to a non-interleaving process algebra following the approach of the previous subsection. The communication merge and the action constants other than the singleton bags are removed from the signature of theory (ACP* + RN -i- RSP"" + SC)(S(A), l±l). This restricted signature and the set of serializable processes over this signature form the basis of a non-interleaving process algebra that is defined in the same way as in Definition 10.11. The interesting aspect is that the signature of the resulting non-interleaving process algebra does not contain causal state operators or cause-addition operators. That is, it only contains the standard process-algebraic causality mechanism consisting of sequential composition and (explicit) communication. Thus, the consequence of the abovementioned result of [4] is that, in a non-interleaving process algebra derived from a standard ACP-style process algebra including linear recursion, it is not possible to specify even a relatively simple process as a three-place buffer without (explicit) communication. That is, in such a non-interleaving process algebra, sequential composition is no longer sufficient to express causal relationships.
Partial-order process algebra
853
The question remains to what extent the causaHty mechanism adopted from Petri-net theory consisting of cause addition and the causal state operator is sufficiently powerful to replace sequential composition and communication. It is difficult to answer this question for a general algebraic theory including some form of recursion. In [4], it is claimed that the causal state operator and cause addition are sufficiently powerful to replace both communication and sequential composition in a very general setting of (not necessarily serializable) processes with bounded behavior. In the next subsection, we prove a theorem formalizing this claim for non-terminating serializable processes with bounded behavior.
10.3. Elimination of choice, sequential composition, and communication As explained, the aim of this subsection is to prove that, in a process algebra of nonterminating seriahzable processes with bounded behavior, the ACP-style causality mechanism consisting of communication and sequential composition can be replaced by a causality mechanism consisting of the causal state operator and cause addition. In fact, it is possible to prove even a slightly stronger result: In the proposed setting, the standard AC? operators choice, sequential composition, and (explicit) communication can be eliminated from any process specification. That is, also the choice operator is no longer needed as a primitive operator. Let C be some set of causes and A some set of atomic actions. Consider the equational theory (ACP^ -h RN -f SC)(AC(C, A), y), the Algebra of Communicating Processes with cause addition, causal state operator, renaming, and standard concurrency, where y4C(C, A) is the standard set of actions defined before and where y is some communication function. Theory (ACP^ + RN -f SC)(AC(C, A), y) extends the equational theory of Section 9.4, (ACP^ -h RN)(AC(C, A), y), with the standard-concurrency axioms of Table 5. As before, it is assumed that the communication function equals W. Let C{C, A) be the set of closed (ACP^ -f RN + SC)(AC(C, A), l±l) terms. Following the approach of Section 5.2, it is possible to construct a model M{C, A, W) of the equational theory with the underlying process space {C{C, A) U {^),AC{C, A), ^ , {^]). Note that this model is an interleaving, partial-order process algebra with a domain that contains only processes with bounded behavior. The set of non-terminating serializable processes in C{C, A), as defined in Definitions 10.1 (Non-terminating process) and 10.2 (SeriaHzability), is denoted Cbns(C', A). This set of non-terminating serializable processes can be turned into a non-interleaving, partial-order process algebra Ahn^^iC, A) following the approach explained in Section 10.1. Recall that SRF c RF is the subset of renaming functions that consists of all the renaming functions introduced in Section 7 and that PE{C, A) is the set of Petri elements over C and A as defined in Definition 10.7. The signature of (ACP^ -h RN -f SC)(AC(C, A), l±)) is restricted to the signature Tb containing inaction constant 5, the operators -h, ||, and |[, for each / G SRF, the operator p / , for each e € PE{C, A), the action-prefix operator ^ •, for each / c C and m e B(I), the operator A,^, and, for each c G C, the operator '^_. Note that the signature i7b differs from the signature Z introduced in Section 10.1 only with respect to prefix-iteration operators. It follows from (the proof of) Theorem 10.9 that the set of non-terminating serializable processes Cbns(C, A) (as well as the set of non-terminating serializable processes over the restricted
854
J.C.M. Baeten, T Basten
signature Tb) is closed under the operators in E\^. Thus, the algebra Ans(C, A) can be defined as explained in Definition 10.11 (Process algebra A s ( C , A)). In addition, it is possible to prove that equational theory (ACP^ + RN -f- SC)(AC(C, A), y) can be used to reason about the equivalence of processes in ^bns(C, A), similar to Theorem 10.14 for the algebra w4ns(C, A). Observe that ^bns(C, A) is a subalgebra of AnsiC, A)\ its signature is contained in the signature of v4ns(C, A) and it contains all processes in the domain of AnsiC, A) with a bounded behavior and no other processes. EXAMPLE 10.17. Let p\,p2,r, and s be atomic actions in A\ let 1,2,3,4,5, and 6 be causes in C. As before, assume that an action in AC(C, A) with empty consumption and empty production is identified with its second element and that square brackets of singleton bags are omitted. Consider the term r • (p\ \\ pi) - s • 8. It is not difficult to verify that it specifies a non-terminating serializable process with bounded behavior. That is, it is an element of Cbns(C, A) (although it is not a term over the restricted signature i7b)- Let / = {1,2,3,4,5,6}. It is possible to derive from the axioms of (ACP^ H- RN -h SC)(AC(C, A), l±)) that the above term is equivalent to term Pcain(^\(Cr^)^ ' S II Vi"^ • ^ II ^P2^ ' S II '^(h^)' 8)). The latter is a term over the restricted signature iJb- Furthermore, observe that it does not contain any choice operators or (explicit) communication operators. In addition, it only contains very specific occurrences of action-prefix operators; each occurrence of an action-prefix operator has operand 8.
The main theorem of this subsection (Theorem 10.25 given below) generalizes Example 10.17. That is, it shows that any non-terminating serializable process in CbnsiC, A) is derivably equal to a term over the restricted signature Tb that does not contain any occurrences of the choice operator, any explicit communication operator, or any action-prefix operator applied to another term than the inaction constant 8. Note that, for any Petri element e e PE{C, A), the action prefix e • 8 can be seen as a constant, specifying a process that can perform a single action before terminating in a deadlock. In the remainder, we refer to such specific action prefixes as action-prefix constants in order to emphasize that such an action prefix should not be seen as a sequential composition. Theorem 10.25 proves that any term in CbnsCC, A) is derivably equivalent to a parallel composition of action-prefix constants that is restricted by means of a causal state operator and where any newly-added causes used to enforce causal orderings are hidden by means of a cause-abstraction operator. Interpreting this result in the algebras Ans(C, A) and A s ( C , A), it means that all processes in the domain of Ahn^iC, A) and, thus, all processes with a bounded behavior in ^ns(C, A) can be specified without choice, sequential composition, or communication. Theorem 10.25 strengthens our claim that the algebra ^ns(C, A) of Section 10.1 incorporates some of the most important characteristics of Petri-net theory. As explained in Section 9.4, an advantage of considering only processes with bounded behavior is that each process can be specified by means of a so-called basic term. Note that the signature of theory (ACP^ + RN -h SC)(AC(C, >^), l±l) is identical to the signature of theory (ACP^ -hRN)(AC(C, A), l±l) of Section 9.4. As a result. Definition 9.6 (Basic terms) carries over to the setting of this subsection. The following theorem states the elimination result for theory (ACPJ^ + RN -f SC)(AC(C, A), l±l).
Partial-order process algebra
855
10.18 (Elimination). For any closed term p G C{C, A), there exists a basic term t e B(C, A) such that (ACF^; -h RN + SC)(AC(C, A),\S)\- p = t.
THEOREM
PROOF.
The proof is identical to the proof of Theorem 9.7 (Elimination) of Section 9.4. D
The proof of Theorem 10.25 uses induction on the structure of basic terms. Five auxiliary properties are needed in the proof. The next property is not used in the proof of Theorem 10.25, but in the proof of the first auxiliary result. It is a simple property of bisimilar processes in some arbitrary process space. PROPERTY 10.19. Assume that (V, ^ , ^•, 4) is some process space as defined in Definition 3.1. Furthermore, assume that => ^V x V is the reachability relation of Definition 3.2. Let p and q be two processes in V\letlZbe a bisimulation between p and q as defined in Definition 3.6. For any p\q^ eV, (i) p^^p' ^(3q' \q' eV'.q^^q' rKp'nq')and (ii) q^^q' ^{3p' : p' eV : p^^ p' Ap'lZq'). PROOF. The two properties can be proven by means of straightforward induction on the number of actions needed to reach p' from p and q' from q, respectively. D
Property 10.19 can be used to prove the following result, which is the first auxihary property needed in the proof of Theorem 10.25. Consider two derivably equivalent closed terms p and q in C{C, A). Process p is (non-)terminating if and only if process q is (non-)terminating; in addition, p is serializable if and only if q is serializable. 10.20. For any closed terms p.q e C(C, A) such that (ACF^ + RN + SC)(AC(C,A),\S)\- p = q, (i) ]j.p^^=:^]^q and (ii) p serializable ^<=> q serializable. PROPERTY
PROOF. The two properties follow immediately from the fact that A^(C,A,l±)), with underlying process space (C(C, A) U {^},AC(C, A), -^, (7)), is a model of (ACF^ + RN + SC)(AC(C, A), l±J), Property 10.19, and Definitions 3.6 (Bisimilarity), 10.1 (Nonterminating process), and 10.2 (Serializability). D
The second auxiliary property states that any closed term specifying a non-terminating process is derivably equivalent to the sequential composition of a closed term and the inaction constant 8. PROPERTY
10.21. For any closed term p
^]j^p.^=^(3g:g^
eC(CM),
C(C, A) : (ACP^;; + RN + SC) {AC(C, A),\±))\-p = q • 8).
856
J.C.M. Baeten, T. Basten
PROOF. First, assume that -^]^p.\i follows from Theorem 10.18 (Elimination) that there exists a basic term t e S(C, A) such that (ACF^ + RN + SC)(AC(C, A),h))\-p = t. Property 10.20(i) implies that ->i}.t. Thus, it suffices to prove for any basic term t e S(C, A) that - ^ / implies {3q:g e C{C, A): (ACP;; + RN + SC)(AC(C, A), l±)) h / = ^ • 8). The proof is by induction on the structure of t. The details are straightforward and left to the reader. Second, assume that (3q:qe C(C, A): (ACP'^ + RN + SC)(AC(C, A), ^)\- p = q-8). It must be shown that -• 4 P- The desired result follows immediately from Property 10.20(i) and the observation that ->i).q 8 for any q G CiC, A). D
The last three auxiliary properties needed to prove Theorem 10.25 are simple properties concerning the merge, the communication merge, action-prefix constants, and the inaction constant. The proof of Property 10.24 uses Theorem 5.2 (Expansion) which carries over to the current setting. PROPERTY
10.22. For any closed term p eC{C, A),
(ACP^ + RN + SC)(AC(C, A),\S)\- p\\8 = p'8. PROOF. It follows from Theorem 10.18 (Elimination) that it suffices to prove the property for basic terms. The proof by induction on the structure of basic terms is straightforward and left to the reader. D PROPERTY
10.23. For any non-empty,finiteset of Petri elements E C.PE(C, A),
(ACP^ + RNH-SC)(AC(C, A),^) h (\e : e e E : e -8) = (\e : e e E : e) - 8. PROOF.
(\e:e€E:e'8) = {Definition 10.7 (Petri elements), CMl} (\e:eeE:e)'(\\e:eeE:8) {Property 10.22, A7} (\e:eeE:e)-8. PROPERTY
D
10.24. For any non-empty,finiteset of Petri elements E <^PE{C, A),
(ACP^ -h RN + SC)(AC(C, A),\S)^
{\\e \ e e E : e ' 8) = {\\e : e e E : e)' 8.
PROOF. The proof is by means of natural induction on the size of set EAf E contains only a single element, the property is trivial, because both sides of the equality reduce to the same term. Assume that E contains at least two elements. In the following derivation, applications of axioms of the equational theory (ACP"^ + RN + SC)(AC(C, A), l±)) are not explicitly mentioned.
{\\e:eeE:e-8)
Partial-order process algebra
=
857
{Expansion} (+Z) :(AcDcE:{\d:deD\d'S)l
{\\e
:eeE\D:e-8))
{\\e
:eeE\D:e)'8)
-^{\e\eeE:e-8) =
{Property 10.23, induction} (+Z) :0cDcE:(\d:deD:d)'8l -i-{\e:eeE:e)-8
=
{Definition 10.7 (Petri elements). Property 10.22} (-hD :&cDcE:(\d:deD:d)\l
{\\e
:eeE\D:e))'8
-]-{\e\eeE:e)'8 =
{Expansion} (\\e:eeE:e)'8.
^
At this point, it is possible to prove the main theorem of this subsection. It gives a canonical form for each process term in Cbns(C, A). This canonical term consists of a parallel composition of action-prefix constants restricted by means of a causal state operator. Causes that do not occur in the original term but are added in the parallel composition to enforce the necessary orderings are hidden by means of a cause-abstraction operator. In the construction of the parallel composition of action-prefix constants, a continuous supply of fresh causes for specifying causal orderings is needed. Therefore, assume that the set of causes C is infinite. Note that Definition 9.9 (Causes function) carries over to the current setting. 10.25 (Elimination of choice, sequential composition, and communication). For any closed term p e Cbns(C, A), there are I C.C,m e B(I), n eN, and ^ o , . . . , e„ e PE(C, A) such that THEOREM
(ACF^ + RN + SC)(AC(C, A), \S)\-p = Pca(i){^L(\\ i'-0^i^n:ei-
8)).
PROOF. It follows from Property 10.21 that there exists a closed term q e C(C, A) such that (ACF^; + RN + SC)(AC(C, A),\S) h p = q - 8. Property 10.20(ii) implies that q • 8 is seriaUzable. It follows from the derivation rules in Table 6 that also q is serializable. Theorem 10.18 (Elimination) and, again. Property 10.20(ii) yield that there is a basic term t e B(C, A) such that (ACF^^ + RN -h SC)(AC(C, A), l±)) h ^ = r and r is serializable. Thus, to prove the theorem, it suffices to prove the following property: For any serializable basic term / G B(C, A), there are I
/ n causes(t) = 0 A (ACP^^; + RN -h SC)(AC(C, A), l±)) h t'8 =
Pcain{x!A\\i-0^1^11:^-8)).
858
J. CM. Baeten, T Basten
The extra requirement concerning the set of causes / is needed in the proof. Let t be a serializable basic term in B{C,A). The proof is by induction on the structure of r. (i) Assume t = 8. Let c be an arbitrary cause in C and e an arbitrary Petri element in PE{C, A), It easily follows that [c] H causes(t) = 0 and that (ACF;; -f RN + SC)(AC(C, A), l±l) h Pca{[c})(^o\''e • 8)) =8 • 8 = t - 8, which completes the proof in this case. (ii) Assume t = a, for some action a e AC{C, A). It follows from the fact that t is seriahzable, the derivation rules in Table 6, and Definition 10.2 (Serializability) that sa must be a singleton bag. Consequently, it follows from Definition 10.7 (Petri elements) that there is a Petri element e e PE(C, A) such that (ACF;; + RN + SC) (AC(C, A),\S)\-a = e, It is not difficult to prove that (ACPI + RN + SC)(AC(C, A), l±)) h Pca(0)(^o(^ ' ^^^ = a '8 = t '8, which completes the proof also in this case. (iii) Assume t = a - s.fov some action a e AC(C, A) and basic term s e B(C, A). Since t is serializable, it follows from Definition 10.2 (Serializability) that sa is a singleton bag and that also s is seriahzable. Consequently, Definition 10.7 (Petri elements) implies that there is a Petri element e e PE(C, A) such that (ACF; + RN + SC)(AC(C, A), l±l) h ^ = ^. In addition, by induction, it follows that there are / c C, m G B ( / ) , n G N , and eo,..., e,j e PE(C, A) such that / n causes{s) = 0 A (ACP^ + RN + SC)(AC(C, A), l±l) h S'S = Pcaii){^!n(\\ i:OKi^n:ei'8)).
(1)
Clearly, since C is infinite, it is possible to choose / in such a way that / fl causes{a) = 0 and, hence, / fl causes{t) = 0. Let Co,..., c„ € C be new, distinct causes not in / U causes(t). Assume that A^ = {/ | 0 ^ / ^ n}. Let r = IU {c/ | / e N}; let m' = m\±) [c/ | / e A^]; let d = (...(^^») )'". Note that (ACF^; + RN + SC)(AC(C, A), i±)) h J = (ca, sa, pa l±l [c/ | / G A^]).
(2)
Furthermore, for all 7 c A^ with 7 7^ 0, there is some action b e AC(C, A) such that (ACP^; -h RN -f SC)(AC(C, A), l±l) h (\j :j eJ :ej) = bA (\j:jeJ:
'^ej) = ([c, \ j e J]\S cb, sb, pb).
(3)
The remainder of this part of the proof is devoted to showing that t • 8 is equivalent to the following term: Pca(n{^!n{^'SU\\i:ieN-/'ei-8))).
(4)
859
Partial-order process algebra
(Note the correspondence between this term and the construction of Theorem 9.10 (Elimination of sequential composition).) The next derivation shows that the only initial action of term (4) is the action a. Applications of axioms of the equational theory (ACF^ + RN + SC)(AC(C, A), W) are not explicitly mentioned in the derivation unless no other results are used in a step. PcaU'){^'m{d-^\\(\\i-i^N:"ei-&))) {CM\] Pca{rM',i,{d -^liWi-JeN: +
'V,- • 5) + (|| / : / e ;V : ''a
•&)ld-&
d-&\{\\i:i&N:''ei-8)))
{Expansion}
PcaU')K{d•^U\\i••ieN•^^er8))) + ( + / : 0 C y C iV : Pca(/')(^,'„(((l; -J^J-
''ej • &) I (11/ •.i&N\J:
+ PcaU'){^'m{<
Id•&))
{+J:0CJcN •• Pca(nK{d
• & I {(\J -J^J-
"'ej • 8) I (\\i : / e yv \ / : ^'ei • S)))))
+ Pca(/')(^m(^-5|(|/:/€N:'V,-5))) {Property 10.23, (2), (3)} Pca(/')(^™(rf-(5||(||<:«eiV:'V,-5)))) + ( + 7 : 0 C y C A^ : Pca(n{^'„,{(\J -J^J+ Pca(nK{{\i +
--ieN:'V,)
''^i) • (^ II (II' : '• e TV \ y : ''e, •&)\\d.
S))))
-(SWd-S)))
{+J:0CJcN •• Pca(n{^'„,{{d I i\J -J^J
+ Pcaini^Uid {(2), (3)}
• ''ej)) • (5 II (II' -.ieNXJ:
'•£,• • 8)))))
I (I' : '• e A': ''e;))" (^ II ^)))
a-pca(r){)^'J,iS\\(\\i:ieN:''ei-S))) {Properties 10.22 and 10.24}
The next step is to show the following result: (ACP^ + RN + SC)(AC(C, A), w) h Pc«(/')(^™'(ll i:ieN:
''e,- • S)) = Pca(/)(^,',(II
i:ieN:ei-8)).
(5)
860
J.CM. Baeten, T. Basten
That is, the extra input causes in the merge quantification in term (4) do not prevent the occurrence of any action of this quantification after the execution of the action corresponding to Petri element d has added the necessary causes to marking m resulting in marking m^ Recall that A^ = {/ | 0 ^ / < n}. It is straightforward to show the desired result if n equals zero, because under this assumption the two quantifications in (5) reduce to single action-prefix constants ^^e^) • 8 and eo-S, respectively. For n greater than zero, the property is proven by means of (strong) natural induction on n. The proof uses the following auxiliary property, which is an immediate corollary of property (3) above. For all 7 c A^ with
(ACP^ + RN + SC)(AC(C, A), l±)) h Pca(i'){^ii,'(\ J-JeJ:
'Jej)) = Pcaii){^L(\ J J ^ J - ^j))-
(6)
Assume that n > 0. To prove property (5) in this case, the following auxiliary notations are needed. Based on Definition 10.7 (Petri element), it is possible to lift the consumption and production functions c_ and /?_ from actions to Petri elements. For any J Q N, m(J) == m- (\Sj : j e J : cej) \S (\±} j : j e J : pej) and m'{J) = m' - Q±}j : j e J : cej) W QS j : j e J \ pej) - [Cj I j G 7]. Note that m(0) = m and m'(0) = m'. Assume that, for any J with J C N, E(J) denotes the following equality:
Clearly, property (5) conforms to (ACP$; + RN + SC)(AC(C, A), l±j) h £(0).
(7)
The basis of the inductive proof is the following property. For all / G A^, (ACP^ + RN + SC)(AC(C, A), l±)) h E(N \ {/}).
(8)
Property (8) is easily proven, because in each case the quantifications in the desired equality reduce to single action-prefix constants. The induction hypothesis is as follows. For all J with 0 C 7 C N, (ACP^ + RN + SC)(AC(C, A), l±l) h E(J).
(9)
The following derivation shows that (ACP^^; -f RN + SC)(AC(C, A), l±l) h £(0): Pcain{^U\\i:ieN'/'ei-8)) = {Property 10.24, expansion, (3)} ( + 7 : 0 C y C N : Pcain{^!n'(\J J^J-
''^^j))
•/>-(/')(A/,.(y)((||/:/GyV\y:^''^/)-5))) ^Pca(n{^!n'(\i'i^^''''^i))'^
Partial-order process algebra
=
861
{Property 10.24, (6), (9)} (+y : 0 C 7 C A^: PcainKdJ
=
J^J'
O))
{(3), expansion, Property 10.24} />cfl(/)(^^(lh':''€7V:e/-^)).
This derivation proves property (7) and, thus, completes the proof of property (5). Using property (5), the following derivation can be made:
{(5)} a- Pca{i){>-lM^ 'i GiV:6/ -8)) {(1)} a-(s'8) {t = a-s} t'8. Hence, combining the results obtained so far shows that f n causes{t) = 0 A (ACP^ + RN -h SC){AC{C. A), l±)) h r 5 = PcainK[d
• 5 II (II / : 0 ^ / < M : ''ei • 5))),
which completes the proof in this case. (iv) Assume r = M + f, for some basic terms u,v e B(C, A). Since t is seriahzable, it follows that u and v are both serializable. By induction, it follows that there are /«, 7^, c C, rriu G BUu). my e Bih). riu.ny e N, and euo. • • •, ^/m„, ^lO, • • •, e^n, ^ PE(C, A) such that In n causes{u) = 0 A (ACP^ + RN + SC)(AC(C, A), w) h U'8 = PcaiiMSW
i-.O^i^n,:
e,i • 8))
(1)
and ly n c«M5^5(i;) = 0 A
(ACP^ + RN + SC){ACiC A), l±l) h V'S = Pcaii,,){kJl(\\j:0^j^n,:e,j'8)).
(2)
Since the set of causes C is infinite, it is possible to choose In and Iv in such a way that lu n ly = 0, /w n c^M^^^(i;) = 0, and Iv H causes(u) = 0. As a result, (/„ U /i,) fl
862
J.CM. Baeten, T Basten
causes{t) = 0. Let AT^ = {/ | 0 ^ / ^ tin} and A^r = {7 | 0 ^ y ^ Wi,}. Assume that, for any / € Nil and j e Ny, Cjj e C is a new cause not in In U I^ U causes(t) U {cu \k e Nu AI e A^i; A (A: / / V / ^ 7)}. Let I' = Iu^ Iv U {c,y | / € Nu Aje Nv} and m' = m,, l±) m^; l±) [c,y | i € Nu A j e Ny], Finally, let, for any / e Nu, dui = ''"( C'"^^///) ) and, for any j e Ny, dyj = ^^J(-(^""Jeyj)...). The remainder of the proof shows that r • 5 is equivalent to the following term: Pcain{^!i,i(\\ i'i^
^u : dui' S) II (II j:je
Ny: dyj • 8))).
(3)
Informally, the idea of the proof is as follows. New causes are added to each Petri element eui with i e Nu, namely one cause Cjj for all j e Ny, resulting in Petri element dui; similarly, for all / G Nu one cause c,y with j e Ny is added to Petri element eyj. This construction has two important consequences. First, no two Petri elements dui and duk, with /, k e Nu such that / ^ k, share any of the newly added causes. The same is true for any two Petri elements dyj and dyi, with 7, / e Ny such that j ^L Asa consequence, the newly added causes do not restrict the occurrence of actions within any of the two merge quantifications in term (3). Second, any two Petri elements dui and dyj with / e Nu and j e Ny share exactly one input cause c/,. Thus, assuming the initial marking w', it is not possible that actions of the two quantifications occur simultaneously. In addition, the occurrence of any action in one of the merge quantifications in term (3) effectively disables all actions in the other quantification, thus enforcing a true choice between the two quantifications. The main fine of the proof that term (3) equals r • 5 is as follows. The second step in the derivation uses four properties that are given below. These properties formalize the claims made above. Pca(/')(^;L'((II ^'^^ ^u : dui • S) II (II j:je Ny : dyj • 8))) {Axioms of (ACP^;; + RN + SC)(AC(C, A), w)} Pca(/') (^i'((ll i'i^
Nu : dui • 8) I (II j:j€
Ny : dyj • 8))) +
Pca(n{^!iA(\\ J'-J^ Nv : dyj • 8) IL (II / : / e Nu : dui • S))) + Pcain i^!^' ((I / : / € Nu : dui '8)\(\j:jeNy:
dyj • 8)))
{(6), (7), Property 10.23, (4), (5)}
Pcaiu{^!;;^S\\^'^^Nu:eui'8)) + Pca(hM^\\j'JeNy:eyj-8))-^ 8 {(1X(2)} u '8 -\-v '8 =
{t = u-{-v] t'8.
Properties (4) and (5) needed in the above derivation follow immediately from the definitions given earlier. For all K c A^^^ with A' 7^ 0, there is some action a G AC{C, A) such
Partial-order process algebra
863
that (ACP^ + RN + SC)(AC(C, A), l±l) h
(\k:keK (\k:keK
:euk)=aA : duk) = ([ckj \k£K
Aj e N,] l±i ca, sa, pa).
(4)
Furthermore, for all L c. Nv with L~^0, there is some action b e AC(C, A) such that (ACP^ + R N + SC)(AC(C, A), w) h (\l:leL:e,i)=bA (\l:leL:
d^i) = ([c,/ \i e N,, AI e L]\±) cb, sb, pb).
(5)
The combination of properties (4) and (5) implies that, in the initial marking m\ actions from the two merge quantifications in term (3) cannot occur simultaneously, which means that the third alternative in the second expression of the above derivation can be reduced to the inaction constant 8. It remains to prove the following two properties. They formalize the claims that the newly added causes do not restrict the occurrence of actions within one of the quantifications in term (3) and that the occurrence of an action within one quantification disables any actions from the other quantification. (ACP^ -hRN + SC)(AC(C, A), l±)) h Pcfl(/o(^,C'((ll i'i^
^u : d,i • 8) I (II j:je
N,: d,j • 8))) =
PcaiiMA\\i'-ieN,:eui-8))
(6)
and (ACP^ + RN + SC)(AC(C, A), l±l) h Pca(/')«'((ll J'J^ Nv : d,j. 8) I (II i:ie PcaiiM,(\\J:jeN,:e,j-8))^
N, : J,/ • 8))) = (7)
For reasons of symmetry, it suffices to prove only property (6). The proof is similar to the proof of property (5) in part (iii) of the proof of this theorem. The following auxiliary notation is needed. For any K ^ Nu, rriuiK) =mu — (\i)k : k e K : ccuk) ^ {^k:k e K : peuk) and m\K) = m' - (1±1A: :k e K : cduk) W (WA: :k e K : pduk)- Using this notation, the following auxihary property can be formulated: (ACP^ + RN + SC)(AC(C, A), w) h PcaU')K'iN^^\\ J'je
N, : d,j . 8)) = 8.
The proof is straightforward and left to the reader.
(8)
864
J. CM. Baeten, T Basten
Recall that A^^ = {/ | 0 < / ^ n^}. For Uu = 0, property (6) follows rather directly from property (8). Let Uu > 0. The basis of the proof is an inductive argument. Assume that, for any K C Nu, E(K) denotes the following equality. Pca(rMiK){(\\
i'-ieN,\K:
d,, • 5) [L (|| j:je
N, : d,j • 8))) =
Clearly, property (6) reduces to the following property: (ACP^+RN + SC)(AC(C,A),w)l-£'(0).
(9)
The basis of the inductive proof is the following property, which easily follows from property (8) above. For all i e Nu, (ACP^ + RN + SC)(AC(C, A), w) h E(N,, \ {i}).
(10)
The induction hypothesis is as follows. For all K C N„ with A^ / 0, (ACP^+RN-t-SC)(AC(C, A), l±))h £ ( / : ) .
(11)
The proof needs one more auxiliary property. For all K c N„ with K ^9i, (ACP^ + RN + SC)(AC(C, A), w) h Pca(nK'{\k
-.keK: 4*)) -PcauA^mA\k -keK:e„k)).
(12)
Consider the following derivation: Pcaa'){^'n,'{i\\ i : '• e iV„ : d,.i • 6) (L (|| j : j € N,: d,j • S))) = {Property 10.24, expansion} PcaU')i^m'{ {{+K •.0cKcN,:(\k:keK: d^k) \Li\\i: / € M< \ -^ : dud) + (\i lieNu-. dui) )-&l{\\j:jeN,:d,j-S))) = {(4), Properties 10.22 and 10.24} {+K -.QcKcNu ••Pca(i'){>^','„'i\k:keK:duk)) • Pca(n{^i'^K){(\\i
••i^N,.\K:
d,, • S) [L (II j : j e N,: d,j • 5))))
+ PcaU'M'm-^V •• i e A^„ : 4,,)) • Pcaa'){>^'m'(N.,^\\ J'-J^ {(12), (11), (8)}
{+K:0cKcNu
^ " • ^vj ' ^))
Partial-order process algebra
• PcauA^I;;^, (\k:keK: =
e,,,)) • PcaiiA^!;i(K)^\\^ 'i^^u\K:
865
e,, • 5)))
{Property 10.24, (4), expansion}
This derivation proves property (9) and, hence, property (6) for the case that riu > 0. As mentioned, property (7) can be proven by means of a symmetrical argument. Finally, it suffices to combine the results to prove that f n causesit) = 0 A (ACP$; + RN + SC)(AC(C, A), l±l) h
which completes the proof of the theorem.
D
10.4. Concluding remarks In this section, it has been shown how to obtain a (branching-time) non-interleaving, partial-order process algebra that incorporates several important characteristics of the Petrinet formalism of Section 4. The algebra consists of non-terminating serializable processes and contains two causality mechanisms, one based on sequential composition and communication and one based on the causal state operator and cause addition. It has been shown that all non-terminating serializable processes with bounded behavior can be specified using only the latter causality mechanism (Theorem 10.25). That is, each such process has an algebraic specification in the style of Petri-net theory. It is interesting to look briefly at the generalization of Theorem 10.25 to a setting with a simple form of recursion, namely iteration. It appears that it is possible to generalize Theorem 10.25 to some extent. This generalization is inspired by Definition 6.8 (Algebraic semantics for labeled P/T nets) and Theorem 6.10. Definition 6.8 gives an algebraic expression for any labeled P/T net. Theorem 6.10 proves that the (step) semantics of a labeled P/T net and its algebraic semantics are identical. It is interesting to observe the similarity between the algebraic term in Definition 6.8 and the canonical term in Theorem 10.25. Assuming that cause-addition operators are used to make causes explicit in the expression of Definition 6.8, the only difference between the two terms is that the action-prefix constants in the term in Theorem 10.25 are replaced by prefix-iterations in the term in Definition 6.8. It is our claim that any non-terminating serializable process in set Cns(C, A) of Section 10.1 is step bisimilar to a canonical term consisting of a parallel composition of prefix-iterations and restricted by means of a causal state operator where causes added to enforce orderings are hidden. However, it is still an open problem whether any closed term in Cns(C, A) is also derivably equivalent to such a term in canonical form, which is a more general result. Recall that Theorem 10.25 is proven by means of induction on the structure of basic terms. This technique does not carry over to a setting with iteration.
866
J.C.M. Baeten, T Basten
A few final remarks are in order. First, it appears to be possible to prove results very similar to Theorem 10.25 for theories concerning processes with bounded behavior that are not necessarily non-terminating and serializable. The interested reader is referred to [4] for more details. Second, it remains an interesting topic for future study to investigate to what extent Theorem 10.25 can be generalized to a setting with linear or even general recursion. Third, an interesting topic for future research is to study axiomatizations of noninterleaving, partial-order process algebras in the style proposed in this section. 11. Conclusions Concluding remarks. In this chapter, we have studied two major themes. The first theme is the development of a partial-order ACP-style algebraic theory. It has been shown that the standard ACP-style algebraic framework is sufficiently flexible to develop a partialorder theory based on the semantic equivalence of step bisimilarity. The communication mechanism of AC? can be used to specify which actions are causally independent and can, thus, occur concurrently. In addition, the notions of a (non-)interleaving equational theory and a (non-)interleaving process algebra have been formalized. It has been argued that the characterizations interleaving versus non-interleaving and total-order versus partialorder for process-algebraic theories are orthogonal. In particular, it has been shown that the partial-order theory developed in Section 5 is an interleaving theory. The second major theme is the study of concepts known from Petri-net theory, one of the most well-known approaches to modeling and analyzing concurrent systems by means of partial orders, in a process-algebraic framework. In particular, the causality mechanism of Petri-net theory has been adopted in the partial-order framework of Section 5. The resulting algebraic theory allows for specifications in the style of Petri-net theory. It has been shown that the theory can be used to reason in a purely equational way about the equivalence of labeled P/T nets. In addition, the relation between the causality mechanism adopted from Petri-net theory and the standard algebraic causality mechanism has been investigated. It has been shown that the Petri-net mechanism can replace the standard algebraic mechanism to some extent. The main contribution of this chapter is that it improves our understanding of some of the most important concepts that play a role in describing and analyzing the behavior of concurrent systems, namely communication and causality. Related work. The literature on concurrency theory contains several approaches to combining some Petri-net formalism with some process-algebraic theory. One line of research is concerned with the translation of process-algebraic terms into Petri nets. The aim of such an approach is to provide the algebraic theory via a Petri-net semantics with a partial-order semantics. The most well-known example of this approach is the Petri Box Calculus of [15] and [16], Chapter 14 of this Handbook. Other examples of this line of research are [19,21,30,31,46,50,60]. In this chapter, the converse approach is pursued. In particular, in Section 6.3, a translation from labeled P/T nets into algebraic terms is given. Other examples of this approach are [20,22]. The main difference between the approach taken in this chapter and other approaches is that this chapter emphasizes equational reasoning, whereas other approaches often emphasize the semantic framework.
Partial-order process algebra
867
Some other authors have taken an approach to modeling and analyzing concurrent systems based on an explicit representation of concurrent-system behavior in terms of partial orders. Examples of such frameworks can be found in [26,32,38,55]. Other well-known partial-order based theories are trace theory as described in [42] and the theory of event structures presented in [48,61]. Future research. Several topics for future study have already been mentioned earlier in this chapter. At this point, we mention two other general directions for future research. First, it is interesting to study the topics addressed in this chapter in a framework based on some other partial-order semantics. There are partial-order semantics that capture causalities more accurately than the step semantics used in this chapter (see, for example, [54], for more details). Second, it would be interesting to investigate the application of the concepts studied in this chapter in the development and analysis of complex concurrent systems. Such applications require the extension of the framework developed in this chapter with, at least, an abstraction mechanism and a way to reason about data. Abstraction can be included following the approach of [8, Chapter 3]. Extensions of Petri-net theory with data can be found in, for example, [35,39]. An extension of ACP-style process algebra with data is the theory /xCRL described in [33] and [34], Chapter 17 of this Handbook.
References [1] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [2] J.C.M. Baeten, The total order assumption. First North American Process Algebra Workshop, Proceedings, Workshops in Computing, Stony Brook, New York, USA, August 1992, S. Purushothaman and A. Zwarico, eds. Springer, Berlin (1993), 231-240. [3] J.C.M. Baeten and J.A. Bergstra, Global renaming operators in concrete process algebra. Inform, and Comput. 78 (3) (1988), 205-245. [4] J.C.M. Baeten and J.A. Bergstra, Non interleaving process algebra, CONCUR '93, Proc. 4th International Conference on Concurrency Theory, Proceedings, Hildesheim, Germany, August 1993, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer, Berlin (1993), 308-323. [5] J.C.M. Baeten and C. Verhoef, Concrete process algebra. Handbook of Logic in Computer Science, Vol. 4, Semantic Modelling, S. Abramsky, D.M. Gabbay and T.S.E. Maibaum, eds, Oxford University Press, Oxford (1995), 149-268. [6] J.C.M. Baeten and W.P. Weijiand, Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 18, Cambridge University Press, Cambridge (1990). [7] Bakkenist Management Consultants, ExSpect 6 user manual (1997). Information available at http://www. exspect.com/. [8] T. Basten, In terms of nets: System design with Petri nets and process algebra, Ph.D. Thesis, Eindhoven University of Technology, Department of Mathematics and Computing Science, Eindhoven, The Netherlands (December 1998). [9] T. Basten and M. Voorhoeve, An algebraic semantics for hierarchical PIT nets. Computing Science Report 95/35, Eindhoven University of Technology, Department of Mathematics and Computing Science, Eindhoven, The Netherlands (December 1995). An extended abstract appeared as [10]. [10] T. Basten and M. Voorhoeve, An algebraic semantics for hierarchical P/T nets (extended abstract). Application and Theory of Petri Nets 1995, Proc. 16th International Conference, Torino, Italy, June 1995, Lecture Notes in Comput. Sci. 935, G. De Michehs and M. Diaz, eds. Springer, Beriin (1995), 45-65. [11] J.A. Bergstra, I. Bethke and A. Ponse, Process algebra with iteration and nesting, Comput. J. 37 (4) (1994), 241-258.
868
J.C.M. Baeten, T Basten
[12] J. A. Bergstra, W.J. Fokkink and A. Ponse, Process algebra with recursive operations. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 333-389. [ 13] J.A. Bergstra and J.W. Klop, Process algebra for synchronous communication. Inform, and Control 60 (1-3) (1984), 109-137. [14] J.A. Bergstra and J.W. Klop, Algebra of communicating processes with abstraction, Theoret. Comput. Sci. 37(1) (1985), 77-121. [15] E. Best, R. Devillers and J.G. Hall, The box calculus: A new causal algebra with multi-label communication. Advances in Petri Nets 1992, Lecture Notes in Comput. Sci. 609, G. Rozenberg, ed.. Springer, Berlin (1992), 21-69. [16] E. Best, R. Devillers and M. Koutny, A unified model for nets and process algebras. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 873-944. [17] E. Best and C. Fernandez, Nonsequential processes: A Petri net view, EATCS Monographs on Theoret. Comput. Sci. 13, Springer, Berlin (1988). [18] E. Best and B. Grahlmann, PEP: Documentation and user guide, Universitat Hildesheim, Institut fiir Informatik (1995). Information available at http://theoretica.informatik.uni-oldenburg.de/-pep. [19] G. Boudol and I. Castellani, Flow models of distributed computations: Three equivalent semantics for CCS, Inform, and Comput. 114 (2) (1994), 247-314. [20] G. Boudol, G. Roucairol and R. de Simone, Petri nets and algebraic calculi of processes. Advances in Petri Nets 1985, Lecture Notes in Comput. Sci. 222 , G. Rozenberg, ed.. Springer, Berlin (1985), 41-58. [21] P. Degano, R. De Nicola and U. Montanari, A distributed operational semantics for CCS based on condition/event systems. Acta Informatica 26 (1/2) (1988), 59-91. [22] C. Dietz and G. Schreiber, A term representation of P/T systems. Application and Theory of Petri Nets 1994, Proc. 15th International Conference, Lecture Notes in Comput. Sci. 815, Zaragoza, Spain, June 1994, R. Valette, ed.. Springer, Berlin (1994), 239-257. [23] E.W. Dijkstra and C.S. Scholten, Predicate Calculus and Program Semantics, Springer, Berlin (1990). [24] W.J. Fokkink, A complete equational axiomatization for prefix iteration. Inform. Proc. Lett. 52 (6) (1994), 333-337. [25] W.J. Fokkink, Introduction to Process Algebra, Texts in Theoret. Comput. Sci.: An EATCS Series, Springer, Berlin (2000). [26] J.L. Gischer, The equational theory ofpomsets, Theoret. Comput. Sci. 61 (2,3) (1988), 199-224. [27] R.J. van Glabbeek, The linear time - branching time spectrum /. The semantics of concrete, sequential processes. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 3-99. [28] R.J. van Glabbeek, The linear time - branching time spectrum, CONCUR '90, Proc. Theories of Concurrency: Unification and Extension, Amsterdam, The Netherlands, August 1990, Lecture Notes in Comput. Sci. 458, J.C.M. Baeten and J.W. Klop, eds. Springer, Berlin (1990), 278-297. [29] R.J. van Glabbeek, The linear time - branching time spectrum II: The semantics of sequential systems with silent moves (extended abstract), CONCUR '93, Proc. 4th International Conference on Concurrency Theory, Hildesheim, Germany, August 1993, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer, Berlin (1993), 66-81. [30] R.J. van Glabbeek and F. W Vaandrager, Petri net models for algebraic theories of concurrency, PARLE Parallel Architectures and Languages Europe, Vol. II, Parallel Architectures, Eindhoven, The Netherlands, June 1987, Lecture Notes in Comput. Sci. 259, J.W. de Bakker, A.J. Nijman and PC. Treleaven, eds. Springer, Berlin (1987), 224-242. [31] U. Goltz, CCS and Petri nets. Semantics of Systems of Concurrent Processes, Proc. LITP Spring School on Theoretical Computer Science, La Roche Posay, France, April 1990, Lecture Notes in Comput. Sci. 469, I. Guessarian, ed.. Springer, Beriin (1990), 334-357. [32] J. Grabowski, On partial languages, Fundamenta Informaticae 4 (2) (1981), 427-^98. [33] J.F. Groote and A. Ponse, The syntax and semantics of fxCRL, Algebra of Communicating Processes 1994, Workshops in Computing, Utrecht, The Netheriands, May 1994, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Springer, Beriin (1995), 26-62. [34] J.F. Groote and M.A. Reniers, Algebraic process verification. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 1151-1208.
Partial-order process algebra
869
[35] K.M. van Hee, Information Systems Engineering: A Formal Approach, Cambridge University Press, Cambridge (1994). [36] C.A.R. Hoare, Communicating Sequential Processes, Prentice-Hall International, London (1985). [37] T.W. Hungerford, Algebra, Holt, Rinehart and Winston Inc., New York (1974). [38] W.P.M. Janssen, Layered design of parallel systems, Ph.D. Thesis, University of Twente, Department of Computer Science, Enschede (1994). [39] K. Jensen, Coloured Petri Nets. Basic Concepts, Analysis Methods and Practical Use, Vol 1, Basic Concepts, EATCS Monographs on Theoret. Comput. Sci., Springer, Berhn (1992). [40] K. Jensen, S. Christensen, P. Huber and M. Holla, DesignJCPN: A reference manual, Meta Software Corporation (1991). Information available at http://www.daimi.au.dk/designCPN. [41] S.C. Kleene, Representation of events in nerve nets and finite automata. Automata Studies, Annals of Mathematics Studies 34, C.E. Shannon and J. McCarthy, eds, Princeton University Press, Princeton, NJ (1956), 3-41. [42] A. Mazurkiewicz, Trace theory, Petri Nets: Applications and Relationships to Other Models of Concurrency, Advances in Petri Nets 1986, Part II, Proceedings of an Advanced Course, Lecture Notes in Comput. Sci. 255, Bad Honnef, Germany, September 1986, W. Brauer, W. Reisig and G. Rozenberg, eds. Springer, Berlin (1987), 279-324. [43] A.R. Meyer, Report on the 5th International Workshop on the Semantics of Programming Languages in Bad Honnef Bulletin of the EATCS, No. 27, European Association for Theoret. Comput. Sci. (1985), 83-84. [44] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer, Berlin (1980). [45] R. Milner, Communication and Concurrency, Prentice-Hall International, London (1989). [46] U. Montanari and D. Yankelevich, Combining CCS and Petri nets via structural axioms, Fundamenta Informaticae 20 (1-3) (1994), 193-229. [47] T. Murata, Petri nets: Properties, analysis and applications, Proc. IEEE 77 (4) (1989), 541-580. [48] M. Nielsen, G. Plotkin and G. Winskel, Petri nets, event structures and domains, part I, Theoret. Comput. Sci. 13(1) (1981), 85-108. [49] M. Nielsen and PS. Thiagarajan, Degrees of non-determinism and concurrency: A Petri net view. Foundations of Software Technology and Theoretical Computer Science, Proc. 4th Conference, FST&TCS4, Bangalore, India, December 1984, Lecture Notes in Comput. Sci. 181, M. Joseph and R. Shyamasundar, eds. Springer, Berlin (1984), 89-117. [50] E.-R. Olderog, Nets, Terms and Formulas, Cambridge Tracts in Theoret. Comput. Sci. 23, Cambridge University Press, Cambridge (1991). [51] D. Park, Concurrency and automata on infinite sequences, Theoret. Comput. Sci., Proc. 5th Gl-Conference, Karlsruhe, Germany, March 1981, Lecture Notes in Comput. Sci. 104, P. Deussen, ed.. Springer, Beriin (1981), 167-183. [52] J.L. Peterson, Petri Net Theory and the Modeling of Systems, Prentice-Hall, Englewood Cliffs, NJ (1981). [53] C.A. Petri, Kommunikation mit Automaten, Ph.D. Thesis, Institut fiir instrumentelle Mathematik, Bonn, Germany (1962). In German. [54] L. Pomello, G. Rozenberg and C. Simone, A sur\'ey of equivalence notions for net based systems. Advances in Petri Nets 1992, Lecmre Notes in Comput. Sci. 609, G. Rozenberg, ed.. Springer, Berlin (1992), 410-472. [55] V.R. Pratt, Modeling concurrency with partial orders, Intemat. J. Parallel Programming 15 (1) (1986), 3371. [56] W. Reisig, Petri Nets: An Introduction, EATCS Monographs on Theoret. Comput. Sci. 4, Springer, Berlin (1985). [57] W. Reisig and G. Rozenberg, eds. Lectures on Petri Nets I: Basic Models, Advances in Petri Nets, Lecture Notes in Comput. Sci. 1491, Springer, Beriin (1998). [58] W. Reisig and G. Rozenberg, eds. Lectures on Petri Nets II: Applications, Advances in Petri Nets, Lecture Notes in Comput. Sci. 1492, Springer, Beriin (1998). [59] P. Sewell, Nonaxiomatisability of equivalences over finite state processes, Ann. Pure Appl. Logic 90 (1-3) (1997), 163-191. [60] D. Taubner, Representing CCS programs by finite predicate/transition nets. Acta Inform. 27 (6) (1990), 533-565.
870
J.C.M. Baeten, T. Bast en
[61] G. Winskel, An introduction to event structures. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Noordwijkerhout, The Netherlands, May/June 1988, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.P. de Roever and G. Rozenberg, eds. Springer, Berlin (1989), 364-397.
Subject index ACP, 783, 784 ACP + RN,786 ACP* + RN, 786 ACP*+RN + /?5P*,787 ACP* + RN + RSP* + SC, 788, 852 ACPJ + RN, 836 ACPj+RN-f SC,853 ACPJ + RN + RSP* + SC, 810 ACPJ^ + RN + /?5P* + SC, 831, 850 action prefix, 836, 846, 854 action-prefix constants, 854 actions, 774, 775 - atomic, 775 - multi-, 775 algebra, 793, 797 - of non-terminating serializable processes, 843, 845,849-851,854 - of non-terminating serializable processes with bounded behavior, 854 algebraic semantics - for modular P/T nets, 822, 825-827, 829, 830 - for P/T nets, 815-817, 833, 865 atomic actions, 775 axiomatization - complete, 797 - sound, 793 bags, 773 basic terms, 836-838, 854 binary Kleene star, 786, 846 bisimilarity, 772, 777 - step, 772, 778 bisimulation, 777 branching-time semantics, 771, 778 causal state operator, 809-815, 853 causality, 771, 809, 831, 842, 843, 852, 853, 865, 866 cause abstraction, 812, 820 cause addition, 831-837, 839, 853 - input-, 832 - output-, 832, 846 causes, 810, 812 -external, 810, 811 -internal, 810, 811 causes function, 838, 839
choice, 784, 853 communication, 771, 866 - between modular P/T nets, 823, 824, 828, 829 - between structured actions, 818 - explicit, 807 - in ACP, 785, 802, 809, 813, 814, 829, 852 - in non-interleaving process algebra, 852, 853 - in a partial-order framework, 804, 807, 808 communication merge, 785, 842, 846 comparative concurrency semantics, 771, 772 completeness - of ACP* -h RN -h RSP* -H SC, 797 - of ACP*; -h RN -h RSP* + SC, 835 compositionality, 820, 827 concurrency, 771, 776, 778 - i n P/T nets, 781 concurrent systems, 771 conflicts, 805-808 consumption, 780, 810 -ofcauses, 810, 812 deadlock, 775, 842 - in ACP, 784 - o f Petri nets, 781 derivability, 785 elimination, 837, 838, 855 - of choice, sequential composition, and communication, 853,857 - of sequential composition, 839 equational theory, 783 - interleaving, 790 expansion, 772, 788, 792 - of iterations, 811 firing rule, 780 - step, 782 - total-order, 780 handshaking axiom, 789 head normal form, 790, 798-800, 836, 843, 849 interleaving process algebra, 771, 772, 797-799 interleaving semantics, 771, 772, 800 interleaving theory, 772, 789, 790, 792, 800
Partial-order process interleavings, 792 -partially-ordered, 806 - totally-ordered, 806 iteration, 786, 865 labeled P/T nets, 779 labeled transition systems, 774 linear-time semantics, 771 markings, 780, 810 merge, 771,784 - communication, 785, 842, 846 model, 793 - o f ACP* -hRN + /?5F* +SC, 794, 795, 798, 801, 804,852 - o f ACP'^+RN + SC,853 - of ACP* -f RN + /?5P* + SC, 814 - of ACP*^ -F RN -h /?SF* + SC, 832, 850 modular P/T nets, 820, 824, 828, 830 multi-actions, 775 multi-sets, 773 non-determinism, 771, 776, 778 non-interleaving process algebra, 771, 772, 842, 849,851,852,865 non-interleaving semantics, 772 non-interleaving theory, 772 P/T nets, 779, 815,844 - marked, 780 -modular, 820, 824, 828, 830 parallel composition, 771, 784, 837 partial-order process algebra, 771, 772 partial-order semantics, 771, 772, 775 - for a process-algebraic theory, 772, 866, 867 -for P/T nets, 782 Petri elements, 846 Petri nets, 771, 772, 778, 866 Petri-net semantics, 781 place fusion, 820, 824, 825, 831 prefix iteration, 846 process algebra, 793, 797 - interleaving, 771, 772, 797-799 - interleaving partial-order, 808 - non-interleaving, 771, 772, 842, 849, 851, 852, 865 - of non-terminating serializable processes, 843, 849 -partial-order, 771, 772 - total-order, 772 process space, 775 processes, 771, 775, 794 - non-terminating, 843, 844, 846, 855
algebra
871
- non-terminating serializable, 844, 845, 847, 849, 865 - non-terminating serializable, with bounded behavior, 853,865 - serializable, 844, 855 - terminating, 855 - with bounded behavior, 836 production, 780, 810 -ofcauses, 810, 812 quantifiers, 774 Recursive Specification Principle - for the binary Kleene star {RSP*\ 787 renaming, 786, 846 - of structured actions, 818, 846 semantic equivalence, 771 semantics, 771 - for ACP* -h RN -I- /?5P* + SC, 793 - for ACP* -h RN -f /?5P* -h SC, 814 - for ACP*; -h RN + /?5P* + SC, 832 - branching-time, 771, 778 - for modular P/T nets, 822, 825, 829 - for P/T nets, 781, 782, 815, 816 -interleaving, 771,772, 800 - linear-time, 771 - non-interleaving, 772 - partial-order, 771, 772, 775, 866, 867 - step, 775, 776, 778 - total-order, 771, 772, 775, 776 - true-concurrency, 771 sequential composition, 784, 809, 831, 834-837, 839,852 - in non-interleaving process algebra, 852, 853 - of non-terminating processes, 846 serializability, 843, 844 soundness - of ACP* -f RN -h /?5P* -h SC, 795 - of ACP? -h RN + RSP* -h SC, 815 - of ACP*^ + RN -f /?5P* + SC, 833 standard concurrency, 788, 793 state operator, 809 -causal, 809-814 step bisimilarity, 772, 778 step semantics, 775, 776, 778 - for ACP* -h RN -h /?5P* -h SC, 804 - for ACP? -f RN -h RSP* -f- SC, 815 - for modular P/T nets, 830 -forP/Tnets, 782, 815, 817 steps, 775, 843 - of algebraic terms, 806, 810 - o f P/T nets, 782 structural induction, 838
872 successful termination, 775, 842 - in process algebra, 794 -ofPetri nets, 781 synchronization - in ACP, 785, 789 tick, 794 tokens, 779, 809, 810, 812 total-order process algebra, 772
J. CM. Baeten, T. Basten total-order semantics, 771, 772, 775, 776 - for ACP* + RN + RSP"" + SC, 801 - for ACP* -h RN + RSP* + SC, 815 - for P/T nets, 781, 817 transition fusion, 828-830 transition systems, 774 true concurrency, 771 validity, 793
CHAPTER 14
A Unified Model for Nets and Process Algebras Eike Best^ Raymond Devillers^, Maciej Koutny^ ' Fachbereich Informatik, Carl von Ossietzky Universitdt, D-26111 Oldenburg, Germany E-mail: Eike.Best@ informatik. uni-oldenburg.de " Departement d'Informatique, Universite Libre de Bruxelles, B-1050 Bruxelles, Belgium E-mail: [email protected] ^ Department of Computing Science, University of Newcastle, Newcastle upon Tyne NEl 7RU, UK E-mail: Maciej. Koutny @ ncl. ac. uk
Contents 1. Introduction 2. Informal introduction to nets, CCS and PBC 2.1. Structure and behaviour 2.2. CCS and PBC 3. Elements of an algebra of Petri nets 3.1. Place and transition labellings 3.2. Labelled nets and their semantics 3.3. Equivalence notions 3.4. Plain boxes 4. Net refinement 4.1. Operator boxes 4.2. Place and transition names of operator and plain boxes 4.3. Formal definition of net refinement X2(Z) 5. Recursive equations on boxes 5.1. Solving a recursive equation 5.2. Further recursion examples 6. An algebra of nets 6.1. Sos-operator boxes 6.2. Structural operational semantics of composite boxes 6.3. Further restrictions on the application domain 7. A generic process algebra and its two consistent semantics 7.1. Syntax 7.2. Denotational semantics 7.3. Structural operational semantics 7.4. Partial order semantics of box expressions 7.5. Consistency results HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
873
875 877 877 880 884 884 885 889 892 893 894 894 896 898 899 903 905 906 908 910 912 912 914 916 920 921
874
E. Best et al.
8. Examples and applications 8.1. PBC 8.2. The two semantics of PBC 8.3. Equivalence properties 8.4. Some applications of SOS rules 8.5. CCS, TCSP and COSY 8.6. Modelling a concurrent programming language 9. Conclusions Acknowledgements References Subject index
923 923 926 928 930 933 935 937 939 939 941
Abstract This chapter addresses a range of issues that arise when process algebras and Petri nets are combined; in particular, it focusses on compositionality of structure and behaviour, on refinement, and on equivalence notions. A generic algebra of nets and process expressions is defined and equipped with two types of semantics: a Petri net semantics based on step sequences and causal partial orders, and a structural operational semantics based on a system of derivation rules. The main result states that these two semantics are equivalent. A concrete example of this algebraic framework is the Petri Box Calculus (PBC) which is used to convey the basic ideas contained in this chapter.
A unified model for nets and process algebras
875
1. Introduction Motivation and goals of this chapter. This chapter is about combining and unifying two well studied theories of concurrency: process algebras and Petri nets. Among the advantages of process algebras, we may identify the following: - They allow the study of connectives directly related to real programming languages. - They are compositional by definition, i.e., they enable one to compose larger systems from smaller ones in a structured way. - They come with a variety of concomitant and derived logics which may facilitate reasoning about important properties of systems. - They support a variety of algebraic laws which may be used to manipulate systems, either to refine them or to prove them correct with respect to some specification. The advantages of Petri nets, on the other hand, include the following: - They sharply distinguish between states and activities (the latter being defined as changes of state), through the distinction made between places (local states) and transitions (local activities). - Global states and global activities are not basic notions, but are derived from their local counterparts, which, in particular, suits the description of concurrent behaviour by partial orders. - While being formal, Petri nets also come with a graphical representation which is easy to comprehend and has therefore a wide appeal for practitioners. - By their representation as bipartite graphs, Petri nets have useful links both to graph theory and to linear algebra, which can be exploited for the verification of systems. By combining the two models and making this combination as strong and uniform as possible, one may hope to gain added value by retaining their respective advantages, which is, in a nutshell, the goal of this chapter. The syntax of a process algebra may be viewed as consisting of a set of process constants (basic building blocks), a set of process variables (useful for expressing hierarchy and recursion) and a set of process operators (useful for composing complicated process expressions out of simpler ones). Such a syntax is usually accompanied by a structural operational semantics (SOS [45]) specifying, by syntactic induction, the possible executions of a (composite) expression. More specifically, then, the main goal of this chapter is to impose on the class of (safe) Petri nets an algebraic structure which conforms with the process-algebraic framework just sketched. We will achieve this to the following extent: - A class of safe labelled Petri nets will be identified (called plain boxes) which correspond to (closed) process expressions, and in particular, to process constants {constant boxes). - Process variables correspond one-to-one to net variables. - Another class of safe labelled Petri nets will be identified (called operator boxes) which correspond to process operators in the following way: the arity n of an operator op equals the number of transitions of the corresponding operator box ^ , and the operation of applying op to n arguments corresponds to simultaneously refining the transitions of ^ by n (plain) boxes corresponding to the arguments.
876
E. Best et al
- Under some general circumstances, the two semantics linked in this way (namely, the net-independent SOS rules and the usual net-indigenous semantics) are not just comparable but even fully isomorphic; that is, process expressions and their SOS rules lead to transition systems which are isomorphic to the ones obtained from their Petri net equivalents. We will show that in order to achieve this isomorphism, a property called factorizability is instrumental. The class of operator boxes satisfying this property will be called sos-operator boxes. All the usual concrete process-algebraic operators are factorizable. Thus, the process algebra we will ultimately be interested in - the box algebra - is generic, in the sense that any operator (not just the usual concrete ones) that can be described by an sos-operator box is guaranteed to have SOS rules which are equivalent with its Petri net semantics. A historical perspective. This chapter is in the tradition of a long line of research with the theme of giving Petri net semantics to process algebras. This idea was presumably first expressed for path expressions in 1974 [38], and in this context has eventually led to the development of COSY [33]. In our opinion, COSY does qualify as a process algebra in the above sense, though it uses iteration (the unary version of the 'Kleene star') instead of recursion. In other seminal work, process algebras whose definition has been given independently of any Petri net semantics, have often been provided with translations into nets. In [27], Goltz and Mycroft were the first to translate Milner's Calculus of Communicating Systems (CCS [41,42]) into Petri nets. Other translations from process algebras to Petri nets include [6,14,19,25,26,44,48] and many other works. A more complete historical review can be found elsewhere in this Handbook [17]. Also, in [2], a converse approach can be found, namely that of translating elements from Petri nets into a process algebra. A specific point of departure for the work described in the present chapter has been a concrete process algebra called the Petri Box Calculus (PBC [9]). This is a variant of CCS designed with the twin aims of allowing a compositional Petri net semantics [10,16,2022,30,31,34,35,37], and providing a formal underpinning of a concurrent programming notation [7,12,39]. Structure of this chapter Before being able to formalize the desired equivalence between process algebras and nets, we need to sort out some issues about static structure and behaviour in both models. This is explained in Section 2, where also some other distinctions between CCS and PBC are listed. In Section 3, a Petri net framework is presented. This section also contains the definition of plain boxes as the basic elements of a suitable Petri net algebra. A general notion of net refinement, which meets the requirements stated above, is defined in Section 4. This section also contains the definition of operator boxes as the Petri net counterparts of process-algebraic operators. Section 5 describes a fixpoint theory developed in order to solve equations on nets (using net refinement). In Section 6, we identify conditions under which operator application does not lead outside the domain of the algebra, and under which an equivalence between SOS rules and net semantics is possible. This section also contains the definition of sos-operator boxes.
A unified model for nets and process algebras
877
In Section 7, we define the box algebra, a generic process-algebraic syntax based on constant boxes, box variables, and sos-operator boxes. We give it both indigenous SOS rules and a box semantics and state the main isomorphism results. In Section 8, finally, we show that this generic algebra has several concrete incarnations, including the PBC, CCS, TCSP [32] and COSY. Section 8 also contains a brief explanation why the box algebra can readily yield a compositional semantics for an imperative concurrent programming language. In this chapter, all proofs are omitted. The reader is referred to [11] where they can be found. Moreover, the theory presented in [11] is more general, allowing, for instance, infinitary operators, whereas here we restrict our attention to finitary ones.
2. Informal introduction to nets, CCS and PBC 2.1. Structure and behaviour An example. The graph of a Petri net A^ describes the structure of a dynamic system. The behaviour of such a system is defined with respect to a given starting marking (global state) of the graph, called the initial marking. In general, a marking M of A^ is a function from the set of places of A^ (local states) to the set of natural numbers N = {0, 1,2,...}; if M{s) = n then we say that s contains n tokens. A transition t (representing some activity) is enabled by M if each input place of t contains at least one token. If an enabled transition occurs, then this is tantamount to the following change of marking: a token is subtracted from each input place of r; a token is added to each output place of t; and no other places are affected. We use the notation M —^ M' (or (A^, M) —^ (A^, A/'), to emphasize A^) in order to express that M enables t and M' arises out of M according to the rule just described; M' is then said to be directly reachable from A/, and the reflexive and transitive closure of this relation gives the overall reachability relation. A marking is called safe if no place contains more than one token, and a marked net is called safe if every marking reachable from the initial marking is safe. Figure 1 shows an unmarked Petri net, N, and two marked Petri nets, (A^, Mo) and (N,M\). Notice that the underlying net (graph) is the same in all cases, only the markings are different. Moreover, the unmarked net could as well be interpreted as a marked net, namely as one which has the 'empty' marking assigning zero tokens to each place. Formally, the net A^ of Figure 1 is a triple (S, T, W) where S is the set of its places, 5 = {51, ^2, -yB}, T' is the set of its transitions, T = {a,b}, and W assigns a number (in this case, only 0 or 1) to pairs (s, t) and (/, s), where s e S and / e 7, depending on whether an arrow leads from 5 to r or from t to s, respectively. For instance, W{s\,a) = \ and W{b,S2) = 0 (i.e., 1 stands for 'arrow' and 0 stands for 'no arrow'). The marking Mo shown is a function satisfying Mo(s\) ~ 1, Moisi) — 0 and Mo(53) = 0, while M\ is a function satisfying M\{s\) = 0, Mxisi) = 1 and Mi(53) = 0. The marking Mo enables transition a which may occur; if it does, the resulting marking is Mi. Thus, (A^, Mo) - ^ (A^,Mi).
878
E.Bestetal.
N 5i
a
S2
b
(A'. Mo)
S3
Si
a
s-i
b
S3
{N.Mi)
Fig. 1. A Petri net, and the same net with markings A/Q and M\.
N describes a sequence of two transitions, a and b, and it is therefore related to the CCS expression a.(b.n\\). But which of the three systems should correspond to the semantics of a.(Z?.nil)? The answer is clear: (A^, A/Q). The reason is that only this one has the same behaviour as a.(b.n\\). The net A^ by itself has the empty behaviour, and in (N, M\), b can occur as the first action, but not a as required by a.ib.nW). Consider now what happens when the action a is executed in either model. In CCS, the expression ^.(Z?.nil) is transformed into b.nW. In the net domain, the marked net (A^, MQ) is transformed into the net (A^, Ml) with the same underlying unmarked net N. But if we were to define a Petri net corresponding to the expression ^.nil, then we would not even think of taking the net (A^, Ml); rather, a natural choice would be (A^, Mi) after deleting ^i and a. This example shows that the ways of generating behaviour in net theory and in CCS do not directly correspond to each other. In the latter, the structure of an expression may change, while in the former, only markings change but the structure of a net remains the same through any execution. The difference is a fundamental one, and stems from the underlying ideas of modelling systems. In a net, when a transition has occurred, we may still recover its presence from the static structure of the system, even though it may never again be executed. In a CCS expression, when an action has occurred, we may forget it (unless it is in a loop), precisely because it may never be executed, and hence we may safely change the structure of the expression (expressions with loops may also be changed, for instance by making them longer). Static and dynamic expressions; structural similarity. PBC respects the division between static and dynamic aspects that can be found in Petri net theory. The basic idea will be to introduce into the syntax of expressions a device that models markings. We distinguish expressions 'without markings' (called static expressions) and expressions 'with markings' (called dynamic expressions): static expressions correspond to unmarked nets, while dynamic expressions correspond to marked nets. Below, E and F will denote static expressions, and G and H will denote dynamic expressions. For example, £ = a; Z? is a static PBC expression corresponding to the unmarked net A^ in Figure 1. Making expressions dynamic consists of overbarring or underbarring (parts of) them. For instance, £" = «; Z? is a dynamic expression which corresponds to the same net as £", but with a marking that lets E be executed from its beginning, i.e., to the 'initial marking' of E. The net corresponding to E is (A^, Mo). We will also allow dynamic PBC expressions such as G = a; Z?. It corresponds to the same underlying expression £ , but in
A unified model for nets and process algebras
879
a state in which its first action a has just been executed, i.e., it shows the instant at which the final state of a has just been produced. Such a G corresponds to (A^, M\). This syntactic device of overbarring and underbarring introduces what could, at first glance, be seen as a difficulty. For consider E = a, b in a state in which its second part, b, is just about to be executed, G' = a\ b. Which marked net should this dynamic expression correspond to? There is only one reasonable answer to this question, namely the net (A^, M\) in Figure 1 which, as already observed, corresponds to G = ^; b. Thus, in general, we may have a many-to-one relationship between dynamic expressions and marked nets. Let us use the symbol = to relate dynamic expressions which are not necessarily syntactically equal, but are in the same relationship as G and G\ Then G = G' can be viewed as expressing that 'the state in which the first component of a sequence has terminated is the same as the state in which the second component may begin its execution'. As another example, we observe that E = a\b also has a dynamic expression which is equivalent but not syntactically equal, namely H = a;b. And E = H can be viewed as saying that 'the initial state of a sequence is the initial state of its first component'. We do not see this many-to-one relationship as merely incidental, to be overcome, perhaps, by a better syntactic device than that of overbarring and underbarring subexpressions. Instead, we view it as evidence of a fundamental difference between Petri nets and process algebras: expressions of the latter come with in-built structure, while Petri nets do not. For instance, E = a;b is immediately recognized as a sequence of a and b. In the example of Figure 1, one may also recognize the structure to be a sequence. However, this is entirely due to the simplicity of the net. For the graph of an arbitrary net it is far from obvious how it may be seen as constructed from smaller parts, while it is always clear, for any wellformed expression in any process algebra, how it is made up from subexpressions. The fact that an expression of a process algebra always reveals its syntactic structure, has some highly desirable consequences. For example, it is often possible to conduct an argument 'by syntactic induction'; one may build proof systems 'by syntactic definition' around such an algebra; and the availability of operators for the modular construction of systems is usually appreciated by practitioners. On the other hand, one of the disadvantages of such a syntactic view is that some effort has to be invested into the definition of the behaviour of expressions. While this can usually be done inductively, it is still necessary to go through all operators one by one. A non-structured model such a Petri nets has an advantage in this respect; its behaviour (with respect to a marking) is defined by a single rule, namely the transition occurrence rule, which covers all the cases. In this spectrum, the box algebra covers a middle position, and its expressions come with an in-built structure. On the other hand, the behavioural rules of (dynamic) expressions are, in fact, the Petri net transition rule in disguise. The necessity to consider equivalences, such as the structural similarity =, can be viewed as being the price that has to be paid for being able to combine advantages of both Petri nets and process algebras. Notations. We use the standard mathematical notation throughout. Some particular notations are recalled below. A partial order is a pair (X, R) where X is a set and /? c X x X is a reflexive (idx ^ R). transitive (R o R
880
E. Best et al.
A multiset over a set .4 is a function m: y4 -^ N. m is finite if the set of all a e A such that rr\(a) > 0 is finite. The cardinality of a finite m is the number |m| = X!^^^^ m(a). The operations of sum, (nonnegative) difference and scalar multiplication for the multisets over A are defined so that, for alia e A and « € N, Sum: Difference: MultipHcation:
(m 4- mO(^) = m(^) -f m'(^) (m - m')(a) = max(rr\(a) — m'((3),0) (/im)(a) = n • n\{a).
Note that if m and m' are finite then so are m + m, m — m' and n • m. Multiset inclusion, m c m^ is defined by m{a) ^ m'(a), for all a e AAn the examples, we will write, e.g., {«, «,Z7} for the multiset defined by m(^) = 2, m(Z7) = 1, andm(c) = Oforallc€ A\{a,b}. The set of all finite multisets over A is denoted by mult(A). A set of places or transitions will sometimes be identified with the corresponding multiset.
2.2.
CCSandPBC
In this section we list some further differences between CCS and PBC. Prefixing and sequential composition. Instead of expressing sequential behaviour by CCS prefixing, PBC uses a true sequential operator, E\ F, meaning that E is to be executed before F. The sequence can be simulated in CCS by a combination of prefixing, parallel operator and synchronization. One reason for allowing full sequential composition is that in a majority of imperative languages, this is one of the basic operations. Another reason is that in PBC, the semantics of the full sequential composition is no more complicated than that of prefixing. The CCS's nil process is no longer necessary in PBC. To see why, we compare the CCS way of deriving the complete behaviour of <7.(Z?.nil), and the PBC way of deriving the complete behaviour oia\b\ In CCS: a.{b.x\\\) -^ In PBC: '^^a;b-^a;b
b.n\\ - ^ = a;b^a;b
nil. = a\b.
In both cases, the action sequence ab is derived, but the PBC way of deriving this behaviour is more symmetric while the CCS way is shorter. The fact that 'execution has ended' is expressed in CCS by the derivation of nil, while in PBC by the derivation of an expression which is completely underbarred, such as a,b. In general, if £ is a static expression, then we call E 'the initial state of £", and E^ 'the final (or terminal) state of £". However, this terminology is slightly deceptive, for there are expressions E for which no behaviour leads from E to £ . Synchronization. As CCS, the PBC algebra is based upon the idea that in a distributed environment all complex interactions can be decomposed into primitive binary interactions.
A unified model for nets and process
Fig. 2. Activity of a (left), activity of ^ (middle) and activity ofa\a
before synchronisation
881
algebras
(right).
after 3-\vav sviichronisation
Fig. 3. Handshake between three people.
Suppose that two people, A and B, wish to communicate by exchanging a handshake. In CCS, one could represent the action 'A extends his hand towards ^ ' by a symbol a; the action 'B extends her hand towards A' by another symbol a (the 'conjugate'' of ^); and the fact that A and B are standing face to face by the symbol |, yielding the CCS expression (a.nW) I (5.nil) (abbreviated (a) \ (a)). This expression has the following possible activities: (i) A may extend his hand and withdraw it, leaving B with the same possibility; (ii) B may extend her hand and withdraw it, then A does the same; and (iii) both A and B extend their hands which results in a handshake, labelled by r, the 'silent action'. Using the existing Petri net semantics of CCS expressions (e.g., in [25,48]), these three possible activities could be represented in Petri net terms as shown on the right hand side of Figure 2. Now consider how one could describe a handshake between three people A, B and C. Although one might think that 3-way handshakes occur rarely in practice, we will argue in Section 8 that multiway synchronizations can be used well in the modelling of programming languages. In terms of Petri nets, such an activity could be modelled by a three-way transition such as H in Figure 3. A moment's reflection shows that a 3-way synchronization transition like this cannot directly be modelled using the 2-way handshake mechanism of CCS; the reason is that r cannot be synchronized with any other action (there is nothing like f in CCS). While one might try to simulate the 3-way-handshake using a series of binary handshakes, PBC proposes instead to extend the CCS framework so that a 3-way (and, in general, «-way) synchronization could be expressed. One possibility, which is akin to the ACP approach [4,3,23], might be to generalize the conjugation operation to a function or a relation that allows the grouping of more than just two actions; however, PBC takes a different approach, which is still based on considering primitive synchronizations to be binary in nature. This works through the usage of structured actions, which we will describe next. In CCS, conjugation is usually denoted by overbarring: we use hatting instead, because overbarring has already been used to construct dynamic expressions.
882
E. Best et al.
{a} \7]{b]
before synchronisation
after svndironisation
Fig. 4. 3-way handshake in terms of PBC.
To understand the PBC way of describing multiway synchronizations, it is perhaps easiest to interpret a CCS pair of conjugate actions (a, a) in the original way [41] as denoting two links between two agents that fit together. In this view, a denotes a communication capability in search of a matching a, and similarly a denotes a communication capability in search of a matching a. Once the communication takes place, i.e., a pair of a and a is matched, this becomes a private synchronization link (namely, r) between two agents with no further externally visible communication capability. The PBC model extends this idea in the sense that the result of a synchronization does not have to be completely internal or 'silent', but instead, may contain further communication capabilities that may be linked with other activities. This generalization is achieved by allowing a transition to correspond to a whole (finite) set of communication capabilities, such as for instance, 0, {^}, {a}, [a, b], {a, b], or even [a, a, b]. For instance, an activity {a} may be synchronized with activity {a, b} using the conjugate pair (a, a). This results in a synchronized activity which is not silent but rather, still has the communication capability {Z?}, as the pair (a, a) is internalized but b remains untouched. For instance, Figure 4 describes a 3-way handshake in terms of the (Petri net view of) PBC. In the figure, a denotes 'A shakes hand with B\ a denotes 'B shakes hand with A\ b denotes 'B shakes hand with C and b denotes 'C shakes hand with B\ Then, by the fact that B performs a and b simultaneously (expressed by the fact that {a, b} is the label of a transition), the resulting activity 123 (in Figure 4) describes a simultaneous handshake between all three people. Transition 12 describes the handshake only between A and B (with label [b] and capability to link with C) and transition 23 describes the handshake only between B and C (with label {a} and capability to Unk with A). Transition 123 can also be thought of either as a 2-way synchronization between 1 and 23, or as a 2-way synchronisation between 12 and 3. Let us now consider two actions {a,b} and {a,b]. According to the PBC approach, two transitions, say 1 and 2, corresponding, respectively, to these actions can be synchronised using the conjugate pair (a, a). However, what synchronisation capability should the resulting transition 12 still possess? There are only two meaningful answers: either the set [b] or the multiset {b, b}. The PBC model chooses the second alternative since only then we obtain the (highly desirable and expected) property that the order of a series of consecutive synchronizations is irrelevant. Therefore, PBC will use a set APBC of primitive actions or action particles. There is a conjugation function ": APBC -> APBC with the properties of involution ("o"= /JAPBC) and discrimination (a ^ a). This is the same basic setup as in CCS. However, unlike CCS,
A unified model for nets and process algebras
883
the PBC allows as the label of a transition any finite multiset over APBC» thus providing a means to specify multiway synchronisation used, in particular, to model simultaneous access to multiple variables in a programming language semantics (see Section 8). That is, the set of labels (or, for the more process algebraically inclined, elementary expressions, or, to emphasize the fact that more than one action may be combined in a single transition, the set of multiactions, or, if no confusion can arise with action particles, actions) is defined as LabpBc = mult(ApBc). This speciahzes to the basic CCS framework as follows: the CCS a and a correspond to {a} and {a] in PBC, respectively, and r to 0. No PBC action a, with \a\ > 1, has a direct CCS equivalent. Parallel composition. The CCS parallel composition performs the synchronisation for all possible conjugate pairs. For instance, the CCS expression a.(ci(b.n\\)) \ 5.(5.(/?.nil)) creates five synchronizations (three of them being actually executable); the syntax of CCS does not allow one to express synchronisation using only the pair (b, b) but not the pair {a, a). For reasons that will become clear in Section 8, it may be desirable to be able to say precisely which action names are being used for synchronisation. PBC therefore separates the synchronisation operator from parallel composition, E\\F, regarding synchronisation as a unary operator, Esy A where A c Apec- The latter makes it very similar to the restriction operator of CCS, but playing an opposite role: while synchronisation adds, restriction removes certain transitions. Other operators. Most of the remaining PBC operators (except iteration) are akin to their counterparts in CCS. The choice between two expressions E and F, denoted in PBC by £" D F, specifies behaviour which is, in essence, the union of the behaviours of E and F. As its counterpart in CCS, +, the choice allows one to choose nondeterministically between two possible sets of behaviours. The iteration operator obeys the syntax {E * F], where E is the looping part (whose execution may be repeated arbitrarily many times), and F is the termination (which may be executed at most once, at termination). Basic relabelling (simply called 'relabeUing' in CCS) is defined with respect to a function / on action particles; F [ / ] has all the behaviours of F, except that their constituents are relabelled according to / . Restriction, F rs A, is defined with respect to a set of action particles A, and has all the behaviours of F except those that involve the action particles in A U A, where A = {a\ aeA). Scoping, [A: E] = (Fsy A) rs A, is a derived operator; its importance stems from an application to the modelling of blocks in a programming language. In terms of the Petri net semantics of PBC, it will be seen that the distinction between control flow operators and communication interface operators manifests itself in a very simple way: the latter (relabelling, synchronisation, restriction and scoping) modify transitions, while the former (sequence, choice, parallel composition and iteration) modify places. Recursion allows process variables to be defined via equations. E.g., X = {a}\ X specifies the behaviour of X to be an indefinite succession of the executions of {a}.
884
E. Best et al.
3. Elements of an algebra of Petri nets We will introduce Petri nets as in [15,43,46], and their semantics as necessary, choosing from concurrency semantics such as: step semantics [24], trace semantics [40], process semantics [8,28], or partial word semantics [29,47,49]. In addition, however, we will also introduce a general compositionality mechanism for combining nets. Combinability of nets will be driven by labellings of both places and transitions. Since such labellings indicate the border between a net and its (potential) surroundings, the resulting combinable objects will be called boxes. More precisely, the compositionality mechanism will be founded upon transition refinement. Each operator on nets will be described by a net ^ whose transitions t\,t2, ...,tn can be refined by nets i7i, 1^2, •. •, ^/i in the process of forming a new net .T? (i7i, i72, • • •» ^n) • This corresponds formally to the application of a process-algebraic operator op to its n arguments. We shall distinguish plain boxes and operator boxes. Plain boxes form the Petri net domain upon which various operators are defined. When giving the Petri net semantics of a process algebra (such as PBC or CCS), we will associate a plain box with every (closed) expression. The nets Ti, 172, • •, ^/J above will be plain boxes. Operator boxes are patterns (or functions) defining the ways of constructing new plain boxes out of given ones by refinement. When translating a process algebra into Petri nets, we will aim at associating an operator box with every operator of the process algebra. The net ^ above will be an operator box. Note that the same type of nets - boxes - serve to describe two seemingly different objects, namely the elements and the operators of the semantical domain. This also corresponds to a process-algebraic idea (and to a general mathematical usage), namely that constants can be viewed as nullary operators.
3.1. Place and transition labellings We introduce the kinds of net labellings we shall need using a simple example. Consider the dynamic expression a; (a \\a), a possible Petri net model for which might look like the (safe) net depicted in Figure 5.^^ Place labellings. In Figure 5, three different kinds of places can be identified. The place ^0 is special in the sense that it contains the token corresponding to the expression in its initial state. And, by symmetry, the places ST, and 54, when holding one token each, characterize the terminal state of the expression. The two remaining places, s\ and ^2. may be considered as internal and contributing to intermediate markings corresponding to intermediate dynamic expressions. The different role of the places will be captured formally by suitable labels, with three possible values {e, i, x}, corresponding to the three different kinds of places: e for entry places, i for internal places, and x for exit places. In the examples, we often change notation from {a} as an action to a as an action for simpHcity, and provided that synchronisation is not involved.
A unified model for nets and process algebras
885
Fig. 5. A marked net corresponding to a: (a\\a).
Transition labellings. Clearly, the action a in Figure 5 cannot be used to identify the transitions, since there are three of them, all corresponding to the same action Af. As a result, to model static or dynamic expressions we need to employ Petri nets with transitions being labelled by action names. For Petri nets defining net operators, we shall also use transition labellings, but with labels coming from a set of relations, called {general) relabellings. This allows combining transitions coming from different nets. And, since action names may be treated as a special kind of ('nullary') relabellings, the latter may be used in full generality. More formally, we assume a set Lab oi actions (serving as transition labels) to be given. At this point Lab is an arbitrary set, but when translating PBC we shall consider Lab to be, in particular, the structured set LabpBC, and other suitable sets will be used for other concrete process algebras. A relabelling ^ is a relation ^Cmult(Lab) x Lab
(1)
such that (0, a) eQii and only if ^ = {(0, a)}. The intuition behind a pair (F, a) belonging to Q is that a (finite) group of transitions whose labels match the argument F can be synchronised, yielding a transition with label a. We distinguish two kinds of relabellings. A constant relabelling, Qa = {(0, a)}, where a is an action in Lab, can be identified with a itself, so that we may consider the set of actions Lab to be embedded in the set of all relabellings. Constant relabellings will be used for plain boxes. A non-constant relabelling will be called transformational; in such a case, the empty set will not be in its domain in order not to 'create an action out of nothing'. Transformational relabellings will be used for operator boxes. The following specific relabellings are of particular interest. Given a set A c Lab, the restriction QA = {({(x), a) \ a e A} only keeps the actions belonging A. And the identity relabelling, Qid = Qiab captures the 'keep things as they are' interface (non)change. 3.2. Labelled nets and their semantics A marked net with place and transition labels {labelled net, for short) is a tuple
E=
{S,T,W,k,M)
886
E. Best et al.
such that: S and T are disjoint sets of respectively places and transitions; W is a weight function from the set (SxT) U (TxS) to the set of natural numbers N; X is a labelling function for places and transitions such that kis) G {e, i, x}, for every place s e S, and k(t) is a relabelling Q of the form (1), for every transition / € T; and M is a marking, i.e., a multiset over S. Nets can be represented as directed graphs. Places and transitions are represented, respectively, as circles and as rectangles; the flow relation generated by W is indicated by arcs annotated with the corresponding weights; and markings are shown by placing tokens within circles. As usual, the zero weight arcs will be omitted and the unit weight arcs (or unitary arcs) will be left unannotated. To avoid ambiguity, we will sometimes decorate the various components of E with the index U; thus, Tj: denotes the set of transitions of E, etc. A net is finite if both S and T are finite sets. Figure 6 shows the graph of a labelled net ^0 = (So, 7b, Wo, Ao, Mo) defined thus: So =
To =
{S0,S\,S2,S3,),
{to.t\,t2}.
Wo = {{TSyJST)x
{ l } ) u ( ( ( 5 ' x 7 ) \ 5 r u ( r xS)\TS)
x {0}),
^0 = {(^o,e),(5i,i),(52,x),(53,e),(/o,«),(n,^),(^2,^)}, Mo = {(50, 1), (^1,0), (52,0), (53,1)}, where TS = {(to, 5i), (ti, 52), (/2,53)} and ST = {(so, to). (s\, ti), (53, toj}. If the labelling of a place 5 in a labelled net iJ is e then 5 is an entry place, if i then 5 is an internal place, and if x then 5 is an exit place. By convention, °E, E° and E denote respectively the entry, exit and internal places of E. For every place (transition) x, we use *x to denote is pre-set, i.e., the set of all transitions (places) y such that there is an arc from y to jc, W(y,x) > 0. The post-set x* is defined in a similar way. The preand post-set notation extends in the usual way to sets R of places and transitions, e.g., •R = y {•r \r e R). In what follows, all nets are assumed to be T-restricted, i.e., the preand post-sets of each transition are non-empty. For the labelled net of Figure 6 we have ° r o = {50,53}, r ° = {^2}, ^50 = 0, 5* = {to} and {50,5i }• = {ro, U} = •{51,52}. A labelled net E is ex-restricted if there is at least one entry and at least one exit place, ° E ^ id ^ E"". E is e-directed (x-directed) if the entry (respectively, exit) places are free
Fig. 6. A labelled net.
A unified model for nets and process algebras
887
from incoming (respectively, outgoing) arcs, i.e., *CZ) = 0 (respectively, (i7°)* = 0). Z is ex-directed if it is both e-directed and x-directed. E is marked if Mz ^ 0, and unmarked otherwise. The labelled net ZQ in Figure 6 is marked, T-restricted, ex-restricted and xdirected, but it is not e-directed. A labelled net 27 is simple if W always returns 0 or 1, and pure if for all transitions t eT, •tot* = 0. If E is not pure then there are 5 e 5 and r € T such that W{s, t) • W(r, s) > 0; in such a case, the pair [s,t) will be called a side-loop. The net in Figure 6 is finite and simple, but is not pure as it contains a side-loop {53, ^2}We will use three explicit ways of modifying the marking of 27 = (5, T,W,k, M^). We define [27J as (5, 7, W, X, 0); typically, this operation is used when ME i=' 0, since it erases all tokens. Moreover, we define 27 and X^ as, respectively, (5, 7, W, A, ^IJ) and (5", r , W, A, r ^ . We will call ° i : the entry marking, and i:° the exit marking of T. Note also that [.J, (.) and C) are syntactic operations having nothing to do with derivability (reachability) in the sense of the step sequence semantics defined next. Step sequence semantics. We adopt finite step sequence semantics for a labelled net 27 = (5, r , W, A,, M), in order to capture the potential concurrency in the behaviour of the system modelled by 27. A finite multiset of transitions U, called a step, is enabled by 27 if for every place s e S,
M{s)^Y^W{s,t)-U{t). We denote this by 27[L^>, or M[L^) if the net is understood from the context. An enabled step U can be executed, leading to a follower marking M' defined, for every place s e S, by M\s) = M{s) - ^
W{s, t) • U{t) -h ^
teU
W{t, s)' Uit).
teU
We will denote this by M [U) M' or 27 [U) 0, where 0 is the labelled net (S, T,W,k, M'). Transition labelling may be extended to steps, through the formula X{U) = Y^ U{t) • {A(/)} e mult(Lab).
Although we will use the same term 'step' to refer both to a finite set of transitions and to a finite multiset of labels, it will always be clear from the context which one is meant. The notation for label based steps will be 27 [r)iab 6), where F = X(U). A finite step sequence of 27 is a finite (possibly empty) sequence a = U\ .. .Uk of steps for which there are labelled nets 27o,..., 27^ such that 27 = 27o and for every 1 ^ / ^ /:, 27/_i [Ui) 27/. Depending on the need, we shall then use one of the following notations: 27 [or) A
ME[CT)MJ:,
27^ G [27>
ME,e[Mj:).
888
E.BestetaL
Moreover, the marking M^j, will be called reachable from Mz. and Ek derivable from E. The empty step will always be enabled, but it can be ignored when one considers a step sequence, since the empty step always relates a net to itself, i.e., Z [0> Q if and only if Consider the labelled net UQ in Figure 6. In the initial marking, transitions fo and t2 are enabled concurrently and so {ro, ti) is an enabled step. After this step has been executed, transitions t\ and ti are enabled concurrently and, hence, {fo, t2)[t\, ^2} is a step sequence of the net from the marking shown in Figure 6. A step does not need to be maximal. Thus, for instance, {ro} is also a step of To, and {ro}{^i}{^2}{^2} and {/o, ^2}{n}{^} are step sequences. In terms of labelled steps, the step sequence {ro, tjWx Wi) corresponds to [a,a}{b]{a]. Notice that different step sequences may correspond to the same labelled step sequence. For example, both {/o}{^2}{^i} and {/2}{^o}{^i} correspond to {a][a][b]. Safeness, cleanness and exclusiveness. The marking M of i7 is safe if for all s ^ S, M(s) e {0,1}. As already indicated, a safe marking can and will often be identified with the set of places to which it assigns 1. A marking is clean if it is not a proper super-multiset of ° i : or 17°, i.e., if ° i : c A/ or 17° c M implies ° r = A/ or 27° = M, respectively. A marking M is ex-exclusive if it does not simultaneously mark an entry place and an exit place, i.e., if M H ° r = 0 or M H r ° = 0. The marking of the net in Figure 6 is safe, clean and ex-exclusive. It would cease to be clean if we added a token to it, even if this new token was put on one of the entry places. A labelled net is called safe (clean) if all its reachable markings are safe (respectively, clean). Complex markings. A (safe) complex marking of an ex-restricted labelled net iJ is a pair (M, Q) such that M is a standard safe marking, and Q'lsa set of transitions T. Moreover, (M, Q) is a reachable complex marking if there is a marking M' e ["iJ) U [i7°) such that M' = M -h J^f^Q *t. Intuitively, Q represents a set of transitions which have started their execution at M' but have not yet finished. Partial order semantics. To model partial order behaviours of nets and expressions, we will use Mazurkiewicz traces [40]. Let A be a set and ind c A x A be an irreflexive symmetric relation on A. The idea here is that A represents the set of all possible events in a concurrent system, and ind is an independence relation which asserts which events can be executed concurrently. With every sequence a = A1 ... A^, where each A, is a finite subset of A such that (a,b) e ind for all distinct a,b e A,, we associate a partial order (poset), denoted by posetjnci(o^), in the following way. The set of event occurrences of a, 000^, comprises all pairs (aj) e A x (N\{0}) such that a e A\U --'U Ak and / is less or equal to the number of times a occurs within a. Moreover, we denote by idX(^;7) the index m such that A,„ contains the /-th occurrence of a in a, and define a precedence relation on ocCa, ^ a , by stipulating that (a J)
A unified model for nets and process algebras (^0.1) •
(^1,1)
^0
^
•
889
/l 1 ^
ihA)
(f2,2)
{t>,:i)
f,
t2
t-2
•
*^
^
•
-^
^
Fig. 7. Hasse diagrams of partial orders.
For a labelled net i7, let indr be a symmetric relation on its transitions, defined by: jndr = {(r, u)eTr
xTz\
Ct U r*) n Cu u M*) = 0}.
This relation is called the independence relation, because two distinct transitions belonging to indi: have no impact on their respective environments. If they are both enabled individually, then they are also enabled simultaneously. Then, with every finite step sequence a of a safe labelled net r , E [o) 0, we can associate a partial order, posetjnci^(cr), in the way described above, and after taking A to be the transition set, A = Tz- For example, the step sequence or = {ro,r2}0{ri,r2}{r2}0 of the labelled net To in Figure 6 generates a partial order posetjnd^ (^) whose Hasse diagram is shown on the left-hand side of Figure 7. This partial order is often represented as a labelled partial order with nodes being labelled by transitions, as shown on the right-hand side of Figure?. The presence of a path between two nodes is interpreted as causality, and the lack of ordering as concurrency. Thus, in the example above, the occurrences of ro and t\ are causally related, and both are concurrent with the three occurrences of t2. Whenever X" [a) 6>, we will write U [posetjnd^ (cr))po 6) to indicate that 0 arises from Z through the execution of the poset between the brackets [...). 3.3. Equivalence notions One may consider various behavioural equivalences for labelled nets. It may first be observed that the whole set of step sequences of a labelled net may be specified by defining its step reachability graph, whose nodes are all reachable markings (or equivalently, all derivable nets) and whose arcs are labelled with steps which transform one marking into another. For example. Figure 8 represents the step reachability graph of the net ZQ shown in Figure 6; the empty steps are left implicit, and the encircled white dot indicates the initial node (here and elsewhere). The arc labels may be transition steps (as in Figure 8) or labelled steps. Any (finite) path in the above graph starting at the initial node specifies a legal (finite) step sequence of the net ZQ, and vice versa. Transition systems. Using the step reachability graph to represent the behaviour of a labelled net leads to problems in a compositional setting. In particular, isomorphism of reachability graphs is not preserved by, e.g., choice composition of nets, as demonstrated informally in Figure 9. We address this problem by augmenting the behaviour of a labelled
890
Fig. 8. Step reachability graph of i7o.
0
.;e
a
V
©
O
i
{•>}
{b}
{a}
Fig. 9. Five nets and the corresponding (labelled) step reachability graphs demonstrating that isomorphism of reachability graphs is not preserved by choice composition.
net E with two auxiliary moves, skip and redo, which can transform its initial state into the terminal state, and vice versa. We achieve the desired effect by adding to 17 two auxiliary transitions, skip and redo, in such a way that: 'skip = redo* = ° r , skip* = *redo = i7°, A(skip) = skip, A.(redo) = redo, redo, skip ^ Lab, and all arcs adjacent to skip and redo have weight 1. The net U augmented with skip and redo will be denoted by I^srThe transition system of a marked net Z is defined as tsr = (V, L, A, fo) where: V = {0 I skip, redo ^ Te A 6)sr ^ [-^sr)} is the set of states; UQ = T is the initial state; L = mult(Lab U {redo, skip}) is the set of arc labels; and A = {(6), r , ^ ) G V X L X V I 6)sr [ r ) , a b '^sr}
is the set of arcs. In other words, t s r is the labelled step reachability graph of iTsr with all references to skip and redo in the nodes of the graph erased. The transition system of an unmarked net Z is defined as tsr = ts;^. The full transition system of a marked net U is defined as ftsr = (V, I-\ A!, i;o) where: V is the set of states and UQ is the initial state, both defined as above; h! is the set of all finite multisets of transitions of i^sr; and A ' = {(6), ^ , «/^) G V X L ' X V I 0 s r \U) ^ s r }
is the set of arcs. In other words, ftSr is the step reachability graph of i7sr with all references to skip and redo in the nodes of the graph erased. For an unmarked net iJ, ftsr = fts;^.
A unified model for nets and process
891
algebras
tS^ Fig. 10. Discriminating transition systems for the nets in Figure 9 (here and later we omit the brackets surrounding skip and redo).
{a} 1";
/
{a} v'f
\
)
: {b}
{b}
tS(// Fig. 11. Two strongly equivalent, but not ts-isomorphic, labelled nets.
Figure 10 shows how augmenting labelled nets with the redo and skip transitions allows one to discriminate between the nets E and 0 depicted in Figure 9. In general, skip and redo allow for distinguishing the entry and exit states from the other ones, and modelling the fact that if a net is left (through the exit state), it may later be possible to re-enter it (through the entry state). Behavioural equivalences. Let Z and 0 be two labelled nets which are either both unmarked, or both marked. The nets are ts-isomorphic, denoted by X" = 6), if t s r and tS(9 are isomorphic transition systems, and strongly equivalent {or bisimilar), denoted by i7 ^ 6), if tsr and \se are strongly equivalent transition systems, where two transition systems, {V,L,A, i;o) and {V\ L^ A\ UQ), are strongly equivalent if there is a relation /? c V x V , itself called a strong bisimulation, such that (i;o, v'^) e R, and if (u, v') G R then (i;, Uw)eA ^ 3w' e V'\ (v\ /, w) G A' A (U;, W) e /?, (i;', /, w') eA' =^ 3weV: (u, /, u;) G A A (U;, W') G R . Figure 11 shows two strongly equivalent labelled nets which are, however, not tsisomorphic. Structural equivalences. As ts-isomorphism and strong equivalence are behavioural notions, it may be difficult to check whether two nets are indeed equivalent. But, since we are
892
E. Best et al
t S Pj -
tSr2 -
t S v;3
tS^
Fig. 12. Four labelled nets and their transition systems.
working with nets, it is also possible to define equivalences based on their graph theoretic structure of nets rather than on their behaviour. Arguably the strongest structural equivalence, other than equality, is net isomorphism. Two labelled nets, E and 6>, are isomorphic if there is a bijective mapping V^:5r U Tr -> Se U T^ such that for all ^ e 5 r and / € Tz. ir{s) e Se, ^{t)eTe, Xe(xlf(s)) = XE(S), ^r-;(iA(0) = ^ r ( 0 , M(.)(ilf(s)) = M^is). W(.){xl/{s), xlr(t)) = WE{S, t) and Wo{f{t), f{s)) = Wz{t, s). We will denote this by E iso6), and call ^ an isomorphism for E and &. A weaker equivalence is obtained by allowing the two nets differ only by duplicating places and transitions. Two places s and s' are duplicating in a labelled net E if kj:{s) = IE{S'). MZ(S) = Mzis'), and for every transition r, Wz(s, t) = Wj:{s\ t) and W^(^ s) = W^(^ ^0; then, in any evolution of the net, the two places do not add anything with respect to each other. Similarly, two transitions t and t^ are duplicating if ^E(t) = ^ r ( ^ ' ) , and for every place ^, W^is^t) = Wz(s,t') and Wz(t,s) = Wz(t\s); then, in any label based evolution of the net, the two transitions do not add anything with respect to each other. The relation of duplication is an equivalence relation for places and transitions, and two labelled nets, Z and 6), are duplication equivalent if they lead to isomorphic nets when their places and transitions are replaced by their duplication equivalence classes which inherit the labels, connectivity and markings of their elements. We will denote this by E isosT 6). For the nets in Figure 12, we have Ui isosT ^2 isosT ^3- Moreover, Z4 is not equivalent to any of the other three nets since, intuitively, Z4 has no reachable terminal state (the x-places cannot be marked concurrently). 3.4. Plain boxes A box is an ex-restricted (and T-restricted) labelled net T. A box is plain if its transitions are all labelled by constant relabellings (or labels, according to our convention of identifying constant relabellings with labels). There are two main classes of plain boxes.
A unified model for nets and process algebras
893
An unmarked plain box E will be called static if each marking reachable from ° X" or ^7° is safe and clean. Static boxes are net counterparts of static expressions, i.e., expressions without overbars and underbars. A marked plain box E is dynamic if each marking reachable from Mz or T or E° is safe and clean. Dynamic boxes are net counterparts of dynamic expressions, i.e., expressions with active subexpressions indicated by overbars and underbars. Note that if i7 is a static box and 0 is derivable from Z then 0 is a dynamic box. When a box E or iJsr is marked, its reachable markings are always non-empty (due to T-restrictedness and ex-restrictedness). On the other hand, the empty marking of a box has no successor markings except itself. Thus, the distinction between static and dynamic boxes is invariant over behaviour. Moreover, if iJ is a static box then both Z and Z^ are dynamic boxes, and if 17 is a dynamic box then [iJJ is a static box. PROPOSITION 1. If Z is a dynamic box then every net derivable from it is a dynamic box. Moreover, if U is a step enabled by the marking of E then U x U C^\n6z ^ idj^ and WE{U
X SE) U WE{SE
X ^ ) C {0, 1}.
It could be objected that determining whether all the reachable markings are safe and clean may be hard. However, we shall see in Section 6 that a compositional way of defining plain boxes combined with careful behavioural analysis can guarantee that these properties hold without having to investigate the set of reachable markings. We further distinguish two special classes of dynamic boxes, called the entry and exit boxes, which comprise all dynamic boxes E such that Mz is, respectively, °X' and 17°. The sets of plain static, dynamic, entry and exit boxes will, respectively, be denoted by Box% Box^, Box^, and Box ^ The entire set of plain boxes will be denoted by Box. It is the static boxes E (or, equivalently, the entry boxes E) which in our approach ultimately provide a denotational semantics of the static expressions. Two behavioural conditions were imposed on the markings M reachable from the entry or exit marking of E. First, we require M to be safe in order to ensure that the semantics of the boxes is as simple as possible, and so we can directly use a partial order semantics of Petri nets in the style of Mazurkiewicz (cf. Section 3.2). The second condition, that M is always a clean marking, is a consequence of the first condition and our intention to use iterative constructs in the algebra of nets. Although static boxes are of our primary interest, we also need to be able to represent intermediate markings. For this reason we introduced dynamic boxes which, by definition, include all marked nets Q such that 0 is derivable from E, for some static box E. Dynamic boxes will provide a denotational semantics for the dynamic expressions. A box E will be called ex-exclusive if each marking reachable from M^ or °i7 or 17° is ex-exclusive. Moreover, for every pair of non-empty disjoint sets of places Se and 5v, the ex-box ex(5^, 5^) is a static box E such that ° i : = 5,,, 17° = S^ and i : = Tr = 0. The simplest ex-box has two places and no transitions. 4. Net refinement The mechanism for providing plain boxes with an algebraic structure is a general simultaneous refinement and relabelling meta-operator {net refinement, for short). It is defined
894
E. Best et al.
for an operator box Q (see Section 4.1) with n transitions. The transition refinement part of net refinement serves as a pattern for gluing together an «-tuple of plain boxes Z - one plain box for every transition in ^ - along their e and x interfaces. The relabelling part of net refinement combines (synchronizes) transitions from Z and changes the interface of the resulting transition(s) according to the transformations prescribed in ^'s transition labels.
4.1. Operator boxes An operator box is a simple finite unmarked box Q all of whose transition labellings are transformational. We will assume that the set of transitions of ^ is implicitly ordered, TQ = {v\, ...,Vn}. Then any tuple X = ( i J i , , . . . , X'l,,) consisting of plain boxes is called an Q-tuple. For T c TQ, we will denote TT = {^v \veT}. Throughout this section, we will refer to an example of net refinement shown in Figure 13, where E = (Ev^, E^j,, Zu^) and, in Q: Ql Q2 =
=QiA{({ci},a)}u{{{a,b},g)}, Qid\{i{e},e)A{d}.d)}u{({e}.h)}.
The net X2(Z) in this figure is the result of applying combined transition refinement and relabelling, using ^ as an operator box and refining its transitions v\, V2 and VT, by the three plain boxes E^^, Zv2 and i^t^. respectively.
4.2. Place and transition names of operator and plain boxes As far as net refinement as such is concerned, the names (identities) of newly constructed transitions and places are irrelevant, provided that we always choose them fresh. However, in our approach to solving recursive definitions on boxes in Section 5, the names of places and transitions are crucial since we use them to define the inclusion order on the domain of labelled nets. A key to the construction of recursive nets is the use of labelled trees as place and transition names. For the example in Figure 13, r\ is a tree used to name a place resulting from combining the place e of the operator box f?, with three places corresponding to the three arcs adjacent to e: the arc incoming from v\ contributes an exit place x\ of Uy^, the arc outgoing to v\ contributes an entry place ^^ of Uv^, and the arc outgoing to V2 contributes an entry place ej of Zi-,. We shall assume that there are two disjoint infinite sets of place and transition names, Proot and Troot (such ase £ SQ and U3 € TQ in Figure 13). Each name t] e Proot UTroot (or a pair (/,or), where/ is a name in Troot and cy is a label in Ldb) can be viewed as a special tree with a single root labelled with ri (or (r, a)). Moreover, we shall allow more complicated trees as transition and place names, and use a linear notation to express such trees. To this end, the expression jc < 5 , where jc is a single root tree labelled with jc (x is a name r; or a pair (t,a)) and 5 is a finite multiset of trees, is a new tree where the trees of the multiset are appended (with their multiplicity) to the root. All our trees will thus be finitely branching.
A unified model for nets and process fii (•) e
@ e'i
i« [a]
[t] fb
895
algebras
@ e2
(e) e,i
I C I tc
V^
Q
,,
• t'3
f'2»
•e3
.'•2*
^3
^2
*{vub)
n
-'3
?1
•(i'l-i?)
T4
•(ri.c)
6
n .(r2./0
TG
•('•3-/)
•tf ^4
6
Fig. 13. Running example of net refinement.
If <S = [p] is a singleton multiset then x <\ S will simply be denoted by x < p, and if 5 is empty then jc < 5 = JC. In Figure 13, TI = ^ <1 {ui < e], v\ <\x\,V2 < ei], TA = V\ <\ i\ We shall further assume that in every operator box, all places and transitions are simply names (i.e., single root trees) from respectively Proot and Troot- For the plain boxes, the trees used as names may be more complex. Each transition tree is a finite tree labelled with elements of Troot (at the leaves) and Troot x Lab (elsewhere), and each place tree is
896
E. Best et al.
a possibly infinite (in depth) tree labelled with names from Proot and Troot. which has the form: ti <\t2<\'"
<\tn <S
<]S,
where ^ i , . . . , r„ G Troot (« ^ 0) are transition names and s e Proot is a place name (so that no confusion will be possible between transition-trees and place-trees: the latter always have a label from P^ot and the former never). We include all these trees (including the basic ones consisting only of a root as special cases) in our sets of allowed transition and place names, denoted respectively by Ptree and Ttree- The definition of net refinement will be done in such a way that, provided all the names occurring in Q are single root trees, and all the names occurring in E are in the sets of allowed names, then all the names in ^ ( E ) belong there, too.
4.3. Formal definition of net refinement ^(1,) Under the assumptions made about the operator box Q and ^-tuple of plain boxes X, the result of a simultaneous substitution of boxes Z for the transitions in ^ is a labelled net Q(ll) whose components are defined thus. Places.
The set of places of I? (2) is defined as the (disjoint) union Sam
=
U
STnewU
== [J[v<]i
USP;;evv
\iei:„}U
veTQ [J {s < {{v < Xij}vers -\- {y^ < eu>}u.es'') \Xv € 27° A ^u- ^ T u - } . seSQ
Ifs is an isolated place, *s =s* = 0, then, by the definition of the tree appending operation, SP^ew = i^}' Notice that the multiset of trees in the definition of a place p = s
^ SP^ew
(2)
is in fact a set because even in case there is a side-loop between s and v — w, then Xv 5^ e^ since jc^; is an exit place and ^u, is an entry place of Zv. For the example in Figure 13, ST;;^W
= h
= {vi
< / | , i ; i
= {r2,r4}, SPnew =
{e < {{V < Xy}ye{v^} -\- {^ < eu^we{vi,V2])
= {e <{v\ <e\,v\
<\x\,V2<e2},e
\ ^i'^
<{v\ <el,v\
E^, A e^,
e°E^}
< xi, f2 < ^2}}-
A unified model for nets and process algebras
897
The following notation is useful in manipulating the tree names upon which a newly constructed place is based. Let j be a transition in Q. Then for p = v <\i in STfJg^, we define trees>'(/7) = {/} if v = y, and trees^ (/?) = 0 if v ^^y; and, for p e SP^ew as in (2), we define {jcv,^v}
if y ^ ' 5 0 5*,
{xy} trees^ (/?) = \ {ey} 10
if ye*s\s\ if yes^ys, otherwise.
For the example in Figure 13, trees^' (r\) = {e^,x\} and trees^' (u) = {/J}. Marking.
The marking of a place p in ^(T)
is defined in the following way:
fMr.O) MQ(T)(P)
=
if/7 = i;€ST;ie^,
J2 ^^^ (^^') + E I ve*s
^ ^ " (^"')
if ^ ^ ^Pnew is as in (2).
0)
wes*
Notice that if 5 e SQ is an isolated place then A/r2(5:)('y) = 0 , and that M^(5:)(/7) is always a natural number since ^ isfinite.For the example in Figure 13, MQ(Y)(T^2) = A^ri, ('f) = 1 and Mr2(i:)(r3) = ME,,^ (e\) + Mr,, Ui) + Mr,, (^2) = 1 + 0 + 0 = 1 . Transitions. The set of transitions of ^ (Z) is defined as the union T^a)=
U'^new= veTQ
\J{(v.a)
Notice that the multiset Rm{v,a) < R will never be empty since no pair in XQ (U) has the empty multiset as its left argument. In Figure 13, Tn^w = {(1^1'«)
mult({r,„r/„r,}) A (Xr,, (/?),«) eQid\[{[ci}.a)]^[{[a.b].g)]]
= {(ui, ^) < tb. {v\, g) < [ta.th]. {v\, c ) < r,.} = {§1, §2, §3}. Similarly as for places, we will denote by trees(M) the multiset of transitions R upon which a newly constructed transition M = (u, a) < /? € TfJew is based. In Figure 13, trees(§2) = \xees{(v\,g)<[ta.tb}) = [ta.th]Labelling.
The label of a node z in .Q(Z) is defined in the following way: i
if^eST;,ew^
a
ifz = iv,a) < R eV^^^.
898
E. Best et al.
Weights. For a place p and transition u in T^ew the weight function is given by: WQij:)(p.u) =
J2
Yl
H^r,U,0-trees(w)(0,
ze\rees^'ip) retrees(w)
W^iT^iu^p) =
Yl
Jl
W^,(^z)•trees(M)(0.
z€\rees^{p) /€trees(M)
For the example in Figure 13,
= 1+0=1. PROPOSITION
2. Q(J1) is a plain box which is unmarked if and only if so is each box
in H. Notice that the definition of refinement is constructed in such a way that: - The e/i/x-labelling of ^ ( H ) depends only on the e/i/x-labelling of Q (and not on that of Z). - The net structure (connectivity) of I?(Z) depends on the e/i/x-labelling of X (and, of course, on the structure of all participating nets), but not on the e/i/x-labelling of Q. More precisely, the e and x labelling of E^'s places is used (only) for linking with the pre- and post-places of i; in 12. At this point, however, it is not guaranteed that if we start from static boxes ^ and X, ^ ( Z ) will be a static box. Indeed, it will turn out that some extra conditions need to be introduced for this to hold. Net refinement is insensitive to taking isomorphic instances of the nets involved, as well as duplication equivalent instances of the refining boxes. Below we consider two instances of net refinement, ^ ( Z ) and ^ ' ( Z ' ) 1. Let ^ e {iso, isosi} cind ir be an isomorphism from Q to Q' such that Ux) ^ E'^^^y for every v e TQ. Then ^ ( Z ) - ^ ' ( Z ' ) .
THEOREM
We do not consider the isosT-equivalence for operator boxes, since it does not preserve the number of transitions of operator boxes. Moreover, the behavioural equivalences, = and ^ , will only be considered for concrete box algebras as they are highly influenced by the particular choice of operator boxes.
5. Recursive equations on boxes This section presents a method of solving recursive equations in the domain of boxes, following a common practice of using fixpoints and limit constructions. We will apply the standard methods, but also show that if they are applied to Petri nets, a number of specific
A unified model for nets and process algebras
899
problems arise which can be solved with help of the tree device for naming new places and transitions in net refinement. To simplify the presentation, we shall consider a single equation for a recursion variable X, of the form: X = ^(A)
(4)
where Q is an operator box, and A is an ^-tuple of recursion variables and unmarked plain boxes, called rec-boxes, Box'"^'^. A rec-box U is a solution of (4) if 17 = ^(A[i7]), where A[i7] is A with every occurrence of X replaced by E.
5.1. Solving a recursive equation We equip the set of rec-boxes with an ordering relation, c . For two rec-boxes Z and 6), we denote T c 0 if 5i: c Se. T^ c Tr-;, Wr = We\is^xT^)u{Tj:xSz) and A.r = >t(--;|5rurrThe relation C is a partial order, and a chain is an infinite sequence
x = r« r '
E^ ...
of rec-boxes such that E^ c i;^+' for every k ^0. Each such chain has a unique least upper bound or limit, denoted by LJ / ' which is a rec-box given by: oo
oc
oo
oc
\
^=0
k=0
k=0
k=:0
I
( [Js^,, IJr^., [Jw^,, U^r*'0 • A recursive equation may have different, even non-isomorphic, solutions, each such solution being uniquely identified by the sets of entry and exit places: THEOREM 2. Let E and 0 be solutions of (4). (1) The sets of transitions of E and Q and their labellings are the same. (2) E^e if and only if'E c ^S and E"" c Q\ (3) E = e ifandonlyif''E = ''0 andE^'^G^ It may even be the case that some solutions are countable while others are uncountable (this is true, for example, for the equation corresponding to X = {a\\b) • X, which is studied in [11]). However, for a recursive system arising in the context of the generic algebra described later, all the solutions can be shown to have identical behaviour. Using fixpoints. The right-hand side of (4) induces a mapping F : Box'^^ -> Box'^^'^ defined by F(E) = Q{A[E]). Hence solving Equation (4) amounts to finding the fixpoints of F. Following the usual treatment of fixpoint theory, we now proceed by trying to establish the monotonicity and
900
E. Best et al.
continuity of F. We say that F is monotonic if, for all rec-boxes E and &, E Q& implies ^{E) c F(6)), and continuous if for every chain x = E^E^ ... of rec-boxes,
F(UX)=UF(^>(^')-THEOREM
3. ¥ is monotonic and even continuous.
Thus one can attempt to solve (4) by constructing a chain of rec-boxes formed through successive applications of the mapping F to some initial approximation T. Note, though, that we do not necessarily have a complete partial order. For a rec-box T, we denote by F * ( r ) the infinite sequence F^(r)¥HT)¥^(r)... where F ^ ( r ) = T and F " ( r ) = F ( F ' - ' (T)), for every « ^ 1. We then call T a seed for (4) if T c F(T); in such a case, F*(T) is a chain of rec-boxes. It turns out that such a chain always yields a solution, and that it suffices to consider ex-boxes as the only seeds. THEOREM 4.
(1) IfT is a seed then | j F * ( r ) is a solution of (4). (2) IfE is a solution of (4) then T = ex(°r, E°) is a seed such thatU^*(T)
= E.
Before looking closer at the seed boxes, we present an example. Example of the limit construction.
Consider the following instance of (4) which intu-
itively corresponds to the recursive equation X
X
^
=a\{X\]b)\
X Qid i 1'2
Qt,i
(5)
^3
Let us examine how a solution of the net equation (5) might be constructed using the limit construction. Suppose that there already exists an approximation T^ given as a hypothetical seed. Then inserting that approximation in the place of the X on the right-hand side of (5) yields a new box T^ = ^(Ea, T^, Eh), where Q is the operator box in this equation and Ea and E^ are the two plain boxes, which is a slightly better approximation. We then construct another approximation T'^ = Q{Ea,T\ Eh) by the same principle, and so on. We already know that if T^ is a seed then the limit of the sequence T^T^ ... so constructed exists and solves Equation (5). We now claim that the ex-box T^ shown in Figure 14 (with these particular place names, defined on the bottom of the figure) is a good seed for (5). Figure 14 shows also the first four approximations resulting from this seed and, finally, it shows E = |JF*(T^), which is the limit of the infinite series of boxes whose first four elements are depicted. The reader may check that this box satisfies (5). To
A unified model for nets and process algebras
901
Te
© 2^0
©
®—e y^l
2"2
2^3
©
.0
-^
^
r!l - (r2.rt)
TI =
1 /../..,
(ro./))<3...<](r2./^K(?-3./>)<]/b *--l
Mr;,, s
Xa* k - \
ftT/,.>
Fig. 14. Four approximations for Equation (5) and the resulting solution.
see this, replace the variable X on the right-hand side of the equation by the box E shown in Figure 14, perform net refinement Q(I^cn ^^ ^h). and check that the result is not just isomorphic but even identical to E, i.e., it has the same places and the same transitions with the same connections and the same labels. Thus, once an appropriate starting point T^ has been chosen, the approximation of a solution is straightforward (we just keep refining successive approximations into the righthand side of the equation under consideration and compute the limit) and leads to a solution in all cases.
902
E.Bestetal
Deriving seed boxes. To find a seed T for (4), we need to ensure that T Q F(T) holds for T and the next approximation F(T). Moreover, we shall require that °T = °F(T) and T° = F(T)°, as for such seeds there is a one-to-one correspondence with the solutions of (4) (see Theorem 4(2)). One might ask why the rec-box T^ in Figure 14 was a suitable starting point for solving Equation (5). First, it is a good idea to start always with an exbox, because these are minimal with respect to the number of transitions and because, as a consequence of Theorem 4(2), all solutions can be so obtained. Moreover, we will only need to ensure that ° r = ° F ( r ) and r ° = F ( r ) ° , since then T c F ( r ) always holds. Let us now fix a hypothetical starting ex-box r = ex(P, 7^) and develop conditions for it to be a seed. First, V and H should be non-empty and disjoint. Second, with a view to ensure that ° r = ° F ( r ) and r ° = F ( r ) ° , some conditions need to be imposed on V and 7^, essentially by performing the refinement at the entry and exit places. As both place sets are sets of trees, these conditions can be translated into equalities over sets of place trees. We define a mapping i\2^^'^^ x 2^^^^^ -> 2^^'^^ x 2^^'^^ associated with F, and through F with (4), so that for all P, /? c Pjree,
f(P, /?) = ( U UP, R),
U fsiP, R))
(6)
where each ts(P, R) comprises all place trees s < ({v < Pv}ves* -h {u^ < ^wlicerv) such that: \P ^'^{^A,
ifAv = X ifA.^X
IR ^""^ ' " ' ^ i ^ ° .
if Au=X if Au^^X.
A pair of sets (P, R) e 2^^'^^ x 2^^^^« is a positive fixpoint of f if f(P, R) = (P, R) and P :^0^ R. The function f can be used to calculate the entry and exit places of F(T) since f(7^, 71) = (°F(r), F ( r ) ° ) . As a result, T = ex(P, 71) is a seed we are looking for if and only if CP, 7Z) is a positive fixpoint of f. Thus what we aim at amounts to finding positive fixpoints off. Using the notation introduced in (6), the latter amounts to finding non-empty sets P and 7Z solving the following tree equations:
r= [j fs(v,n). (7) seQ°
The function f is a monotonic mapping on the domain (2^^'^^ x 2^*^^^, c ) which is a complete lattice with set union as the 'join' and intersection as the 'meet' operation.^ It therefore follows that Tarski's theorem [18] can be applied. ^ All operations, including c , are carried out component-wise.
A unified model for nets and process algebras
903
5. The set offixpoints off is a complete lattice whose maximal element, fiXmax» is positive. Moreover, there is at least one positive fixpoint which is minimal among all the positive fixpoints off. THEOREM
This leads, though not immediately, to the main result of this section. THEOREM 6. The recursive equation (4) has at least one solution. Moreover, the set of solutions has a unique maximal element and at least one minimal element.
One might be tempted to always take the minimal fixpoint of f, fiXmin, and treat the corresponding solution as the solution of (4) since, by Theorem 2(2), such a solution would be minimal. Unfortunately, the minimal fixpoint of f may not be positive making it unsuitable for our purposes because boxes are ex-restricted. In other words, a minimal solution of (4) that exists by Theorem 6 may not correspond to the minimal fixpoint of f, and it may not be unique, either; for instance, an equation corresponding to X = (a\\b) D X has an uncountable number of non-isomorphic minimal solutions [11]. There is a simple structural condition guaranteeing that f is a constant mapping and therefore trivially has a unique fixpoint. The recursive equation (4) is front-guarded if no entry place of ^ has a direct access to the variable X; that is, if Av :^ X, for every V € T ^ ) U C^)\ Similarly, it is rear-guarded if A,, # X, for every v € V ^ ^ ) U (^°)V And (4) is guarded if it is both front- and rear-guarded. THEOREM
7. If (4) is guarded then it has a unique solution.
Solving recursive equations on boxes is insensitive to taking structurally equivalent nets. Below, we can consider two instances of (4), X = X?(A) and X =
Q'{\').
8. Let -^ e {iso, isosi} ««^ V^ be an isomorphism from Q to Q' such that Av — X = ^'^(i;) or ^i, ^ ^'^}f{vy f^^ ^^^^ ^ ^ ^^- ^^^^^ f^^ ^^^^ solution Z of the first equation, there is a solution E' of the second equation such that Z ^ E'. THEOREM
The treatment provided for a single recursive equation is easily lifted to systems of recursive equations on boxes, using standard techniques on Cartesian product spaces (for finite sets of equations) or on function spaces (for infinite sets of equations). The reader is referred to [11] for details.
5.2. Further recursion examples Let us first return to Equation (5). In this case, to find the fixpoints of f we need to solve the following instance of the tree equations (7): T> = {e <[v\ <ea], Tl=[x
eTl].
904
E. Best et ai
There are exactly two solutions, fiXmin = ({r^}, 0) and fiXmax = ({^^}, {^.v}), where r^ and Tx are as in Figure 14. Since fiXmin is not positive, there is only one solution of Equation (5) which can be obtained from the seed T = ex({r^}, {iv}), shown in Figure 14. The first recursion example was front-guarded, but not rear-guarded. The next example is neither front-guarded nor rear-guarded: ( J^
^
\Q^VI
\
Qe.
X
[QU
(8)
J df
Intuitively, this corresponds to X = a\\X.To construct a seed, we need to solve the following instance of the tree equations for the auxiliary function f: V = {el
7^={x|}
en}.
(9)
And there is a one-to-one correspondence between the positive solutions of (9) and the solutions of (8). But now we have several positive solutions; for example, the minimal fixpoint containing only finite trees, and the maximal fixpoint which contains infinite trees as well. More precisely, we have fiXmin = (P. R) and fiXmax = (P^ M. R U {T.V}), where: /" = {rj, r^, r,^ ...} R = {rj, r^, r,3,...}
Ze =ef^
where rj = e^ < D|| < ea and rj = X|j <\ v^^ < Xa and r^^^ z= ej <\vj <\ r^ and r^"^' = x^^ < vj < r^, for A: ^ 1. In all, there are four positive fixpoints which determine four starting boxes to begin the approximation of a solution of (8): T'"'" using fiXmin, T'""^^'"'" using {P U {r^}, R), E'^'"'"''^' using (P, R U {r.v}) and T'"'^^ using fiXmax- Depending on the choice, one of the four different solutions of (8) is obtained, shown in Figure 15. It is not hard to check that all four boxes are indeed solutions of (8) in the same strict sense as before. The interleaving behaviour - and also behaviour in terms of finite steps - of the four solutions is the same. However, there are subtle differences between these solutions, which are discussed in [11]. As the next equation - which informally corresponds to X = X - consider the following:
®. X
df ^
I Qid
V
(i).r
X
(10)
A unified model for nets and process algebras
905
y^ma.r
CO T^ CO '^e (^
0^-
T'
a
T'
C^^x C5''
•••
\^min:m,ax
Fig. 15. The solutions of Equation (8).
It leads to the following tree equations for the entry and exit places of the starting box: V = {e<\v
eV}, eU},
which means that f has a unique positive fixpoint (V,lZ) = [{e <\v <€
In this case, the approximations never change anything, and the box solving the equation is ex(P, 7Z). Note that despite the colloquial meaning of X = X, no box with a transition solves (10). Thus solving recursive equation by boxes with least behaviour is already inbuilt in our approach. We feel that this gives an intuitive semantics to the 'recursive call' X = X because we do not model procedure entry and procedure exit as separate (silent) actions. Thus, X = X essentially means that X is continually 'rewritten' by itself and effects no behaviour at all, be it silent or observable. This is in contrast to the view that X — X implies continual entry to a procedure and thus an infinite succession of silent moves; to model such behaviour, we would rather use X = 0\ X where 0 represents a silent action (or even X = 0; X\ 0, to model exit as well as entry, even though none of the transitions coming from the 0 following X will be executable). 6. An algebra of nets In this section, we restrict our attention to a special class of operator boxes, called sosoperator boxes (Section 6.1). They are defined in such a way that they allow two results to be true, namely Theorems 9 and 10 in Section 6.2. Even though these two theorems are
906
E.Bestetal
stated purely in net theoretic terms (as is the entire present section), they can still be seen as counterparts of an SOS rule. In the process of preparing for these results, we will also need to find a net-theoretic counterpart of the structural similarity relation, =, which has been explained in Section 2.1. 6.1. Sos-operator boxes An operator box ^ is factorizable if, for every reachable complex marking (A/, Q) of Q, there is a quadruple /x — (fie^ l^d. f^x^ f^s) of sets of transitions of ^ - itself called Si factorization of (M, Q) - such that iid = Q. Ms = T^Xifie U /xj U /x.v) and M = J2vefMe *^ "^ X!ue/iv ^** ^ ^ ^^^^ denote by factr? the set comprising all factorizations jjL of the reachable complex markings of Q as well as /x = (0, 0, 0, 7^) - the only factorization of the complex marking (0, 0). An SOS-operator box is a factorizable operator box ^ such that all markings reachable from °X2 or ^ ° are safe and clean. In what follows, we will call a transition v of an sos-operator box Q reversible if, for every marking M reachable from °Q or Q°, v* c. M implies that M \ i;* U {f} is also a marking reachable from °.^ or ^ ° . For the box in Figure 16, fi and i;3 are both reversible, while V2 is not. A RUNNING EXAMPLE. Figure 17 shows an sos-operator box QQ which will serve as a running example. Clearly, all markings reachable from the entry or exit marking of QQ are safe and clean. A justification that ^ o is also factorizable is provided by Table 1 which lists reachable complex markings (A/, Q) of .^o and their factorizations. Thus iac\Q^^ comprises thirteen different factorizations, as (0, 0, 0, [v\, V2,1^3}) also belongs to factf^o- Note that for the operator box QQ, all three transitions are reversible. Domain of application. Let ^ be an sos-operator box and Z be an ^-tuple of static and dynamic boxes. The factorization of T is the quadruple 11 = (fie, fid, t^x^l^s) such that, for (5 e {e,d,x,s], _\[veTQ\E,.e
Box^}
if 5 € [e,x,s],
^^ ~ j {i; € r ^ I r , G Box^\(Box^ U Box^)}
Fig. 16. An sos-operator box with a dead transition.
'\i8=d.
A unified model for nets and process / e(m)qn
Y
=
e ( • ) ^12
11
~6]/l2
907
algebras
(e) q-ii
^
@ '731
\(m)(i22
\
[ll'31
[t] in \
1^ =
( x )
( x ) ^14
( x ) 723
( x ) qZ2
)
{({a,6},/)}UpLab\{a,6}
/?o{T)
/2n
(^ pi
=
.Si <] ?'i
p-2
<^q\\
.Si < r i
P3
= S3 <]
PA
= S:i <
p5
=
po
=
i'2 < q22
pi
— S.\ <] { t'2 < < / 2 3 . 1'3
PR
-
Sr, < ("3 < (/32
m
=
U-2 =
{Vo.c)
IC4 =
( r a . c ) < ^31
U-3 =
{vi
=
6'2 < r-2
{Vuf)<{tiutv2} {v-2,d)
< t2-2
P8
{i-i
< ^21
Fig. 17. A tuple of boxes Y = (Ti,, Tv^, Ti^) and the sos-operator box Q() for the running example, and the result of an application of ^ Q ^^ '^• Table 1 f2o is factorizable M
Q
{s\,S2}
0
{s\} {^2}
{V2} {1^1}
{51,54}
0 0
{^2-^3}
0 ki} {^4} {53,54}
{i;i,U2} {1^2} {1^1}
0
l-^c {i;i,U2}
^d
MA
0
{1^1} {i'2} {vi}
{t'2} {fll
0 0 0
{1^2}
0 0 0 0 {1^3}
0
{1^3}
{^5}
0
0 0
0 0 {1^1.1^2} {1^2} {l^ll
0 0
{i;.} {1^1}
0 {1^1} {1^2} {i;i,L'2}
{t'3}
0 0
0
{t'3}
M.v {f3} {1^3} {t'3} {1^3} {1^3} {1^3}
[v^] {1^3} {1^3} {i'l,U2} [V\,Vl] {i;i,U2}
908
E.Bestetal
The domain of application oiQ, denoted by domf^, is then defined as the set comprising every 12-tuple of static and dynamic boxes X whose factorization belongs to fact^, and such that, for every v eT^: - If *!; n u* ^ 0 then Zy is ex-exclusive. (Doml) - If u is not reversible then Zi, is x-directed. (Dom2) The first condition, (Dom 1), is meant to prevent the non-safeness of refinements in which a box is refined into a transition which is part of a side-loop (see formula (3) for the marking in net refinement). A typical situation addressed by (Doml) is the process-algebraic expression (fl||^)*. Translating the unary iteration directly yields a transition v satisfying •i; n i;* 7«^ 0, and the typical Petri net of a\\b is not ex-exclusive. More careful arguments must be found in order to deal with this situation ([11]; see also Section 9). The second condition, (Dom2), is related to the possible presence of dead transitions in an operator box. Referring again to the sos-operator box in Figure 16, one may observe that if we were allowed to refine the transition V2 with a non-x-directed box Ti,, then some behaviours originating from U^^ could be possible from the entry marking of the refined net, while no behaviour beginning at the entry nor exit marking of the operator box can possibly involve V2.^ EXAMPLE (Continued). Taking the sos-operator box in Figure 17 and the factorizations in Table 1, we obtain:
dom^() = Box"^ X Box"^ x Box' U Box' x Box' x Box'' U Box' x Box' x Box'.
In Figure 17, Y = (r^,,, T^,., T^^) is an ^o-tuple with the factorization, ({i;i}, {^2}, 0, {1^3}), which belongs to fact^o- Hence Y belongs to the domain of application of the sos-operator box ^0- Notice that (Doml) and (Dom2) are trivially satisfied in this case since QQ is pure and all its transitions are reversible. The result of performing the refinement QQC^) is shown in Figure 17.
6.2. Structural operational semantics of composite boxes A typical structural operational semantics rule in process algebras [1] stipulates that if a process term expr = op(expr^,..., expr„) can make a move act
I
expr —> expr then act can be composed out of some individual moves of the sub-terms expr^,..., expr^^. And conversely, if the sub-terms can individually make moves satisfying some prescribed conditions, then the whole term can make a combined move. We translate this scheme into the present net-theoretic framework. ^ Actually, one could have required that no transition be enabled at r ° ^ , but x-directedness is a simple structural sufficient condition for this.
A unified model for nets and process algebras
909
Let Q be an sos-operator box and E be an ^-tuple in its domain, dom^. When dealing with the operational semantics of the compositional box i?(X), we shall use the notation (^:i:)-^(Q:e)
(11)
to mean that the boxes X can individually make moves which, when combined, yield step U and lead to new boxes 0 . By definition, this will be the case whenever /7 is afiniteset of transitions of ^ ( I]) and, for every transition v in ^ , U DV^^^^ {MI, . . . , MJ^} is asetof transitions such that Uy [trees(Mi) + • • • -htrees(wA))6),.
(12)
In fact, the multiset sum in (12) is a disjoint union of k sets. Instead of expressing behaviours in terms of transitions, it is also possible to express them using actions, through the labelling function
which returns multisets rather than sets since different transitions may have the same label. EXAMPLE
(Continued). For the boxes in Figure 17 we have
(^0 : Y) i^^^i:^ (^0 : e ) ,
(13)
where 0 = (0y^, 0V2^^V3,) = (^r,, T^,,, T^,,). Indeed, by setting U = {w\,W3} we obtain: ^ n C w = {u;i},
trees(u;i) = {rii,ri2},
T,, [{rii,ri2})6),,,
UnV^lvj = {W3}, trees(u)3) = {^22},
T,, [{(22})^v.^
unrr,l^ = &.
r,3[0)6),3.
Notice that {w\, w^} is also a valid step for the box ^oC^) and ^oC^) [{u)\. ^^3}) •^0(0)THEOREM 9. Let 1. be a tuple in the domain of an sos-operator box Q.If^ as in (11), then 0 € dom^ and Q{J:) [U) ^ ( 0 ) .
and U are
This theorem states that the transformation captured by (11) is correct (or sound) with respect to the standard net semantics. A direct converse of Theorem 9 does not, in general, hold true. For if we consider the tuple of boxes 0 as in (13), then .r2o(0) [{w^4}). yet no move at all of the form (^0 : 0 ) - ^ (^0 : 0 ' ) for a non-empty U is possible. This is so because, when composing the nets, the tokens contributed by Oy^ and 0^^ are inserted into the composed net in such a way that they
910
E.Bestetai
could all have been contributed by 0^^ as well. More precisely, we have ^ ( 0 ) = . ^ ( ^ ) , where ^y^ = [T^^J and ^v, = l^vii ^"^ ^i? = ^ - ^ " ^ the situation is now different since a move (^0 : ^ ) ^ ^
(^0 : * ' )
is possible with i/^^'^ = ^i,^, »/^^'^ = ^i,^ and ^/^^'^ = ^/^i^. Hence the markings in a tuple of boxes Z may need to be re-arranged before attempting to derive a move which is admitted by their composition ^ ( Z ) . Such a re-arrangement is formalized by a similarity relation =Q on f2-tuples of boxes. This is, of course, very similar to the case discussed earlier, that the token on S2 in {N, M\) (see Figure 1) can be interpreted either as an exit token belonging to the a or as an entry token belonging to the b. At this point, we need to define a net-theoretic counterpart of the similarity relation = discussed in Section 2.1. Let ^ be an sos-operator box and Z and 0 be i?-tuples of static and dynamic boxes whose factorizations are respectively /x and K. Then Z =Q 0 if /X and K are factorizations of the same complex marking, [ZJ = [0J and Ev = 6>i., for every v e fid = ^d=Q is an equivalence relation which is closed in the domain of application of Q, and relates tuples which yield the same boxes through refinement, QiX) — ^ ( 0 ) . A partial converse of the latter property also holds: if Z and 0 are tuples in the domain of Q such that LXJ = L0J and ^ ( X ) = ^ ( 0 ) , then X =Q 0 . With help of the similarity relation =Q it is possible to reverse Theorem 9. THEOREM 10. Let "^ be a tuple in the domain of an sos-operator box Q. lfQ{^) {U) E then there are X and 0 in doxWQ such that ^ =Q X, . ^ ( 0 ) = E and{\ 1) holds. This theorem states that the transformation captured by (11) is complete with respect to the standard net semantics. Various important consequences may be derived from Theorems 9 and 10. In particular, they imply that ^ ( E ) is a static or dynamic box, and if i7 is a net derivable from QiX) or ^ ( S ) , then there is a tuple 0 in the domain of Q such that L^^J = L®] and E = ^ ( 0 ) . As a summary, the SOS rule for boxes can be presented in the following way:
Z, = o 0 , ZJ =Q
0
^ ( Z ) [6^)^(5:0
6.3. Further restrictions on the application domain The conditions (Doml) and (Dom2) imposed on the domain of an sos-operator box are sufficient for the main compositionality results; in particular, for showing the full consistency between the net semantics and operational semantics in the process algebra presented in Section 7.5. So far, however, this is unrelated to any process algebraic considerations, except that the shape of the SOS rule is inspired by process algebra theory. Starting with
A unified model for nets and process algebras
911
Fig. 18. Operator box Q* and a net modelling (tentatively) ^oCN^, r?*(N^, Ny)).
this section, we shall discuss relationships between operations on nets (realized by operator boxes) and process algebraic operators. In the present section, we address a behavioural consistency issue that pertains to such a discussion. Consider the operator box ^ * on the left hand side of Figure 18, whose terminated behaviours are modelled by the expression 1^2 fi (in other words, any number of repetitions of V2 followed by a behaviour of ui). Allowing operator boxes like Q* raises the danger of creating composite nets which are not in agreement with an intuitive behavioural meaning of operations specified by operator boxes. For consider an expression such as ^ Q (Ha, ^*(N^, Ny)) (anticipating, for the moment, the boxes in Figure 20), whose behaviour is, intuitively, 'do either a, or ^ * ) / \ According to our intuition about the operation specified by .^2*, one might expect that the net corresponding to this expression could be constructed by first applying Q* to N^ and Ny, and then putting the result in a choice with Nc^, yielding the net shown on the right-hand side of Figure 18. This net, however, allows evolutions such as {^}{^}{a}, which do not correspond to what one expects from a choice construct. This phenomenon is neither particular to our approach, nor to Petri nets in general (cf. [4,25]), nor does it invalidate our coherence results (see Section 7.5). Boxes such as ^ * are useful in modelling guarded while-loops in programming languages (basically, v\ corresponds to the negation of the guard(s), and V2 to the repetitive behaviour). To our experience, in practical programming languages, it is usually ascertained that a loop does not occur initially in an enclosing choice, or in another enclosing loop. We therefore formulate a set of conditions in such a way that these situations, and similar ones, are excluded. -lfv^wmd*vn*w:^ 0, then T,,, Tu- € Box^^"". (Behl) - If i; 7^ u; and i;* n u; V 0. then T,, i:„. € Box ^^^''". (Beh2) - If v^n^w:^ 0, then T , e Box^^" or T^. e Box"^". (Beh3) - If •!; n ^ V 0. then T , G Box^^'^ (Beh4) - If u^ n °r? 7«^ 0, then r , e Box ^^'^ (Beh5) With (Behl), it will not be possible to start the execution of Zv and later, without finishing it, to enter Eui for a conflicting w because we came back to the initial state of Zi, (notice that, again, the problem really concerns the possibility of coming back to the initial state and e-directedness is a simple structural condition excluding this kind of behaviour). (Beh2) prohibits to finish the execution of Zi^ and afterwards to enter Eu^ from the rear (notice that here the problem concerns the possibility of executing something from an exit marking which, perhaps unexpectedly, makes the situation rather different from the previous one). (Beh3) excludes a situation, combining the previous two problems, where we start the execution of U^J and later, without finishing it, we come back to the initial state and
912
E.Bestetal
(re)enter Ey from the rear. (Beh4) excludes the situation whereby we reach the exit marking, start the execution of Ey and return to the exit marking without finishing 17^., so that a completed history is not composed out of completed histories of the components corresponding to a completed history of Q. Finally, (Beh5) excludes the situation whereby, from the entry marking of the composed net, we can execute a behaviour originating from i7° which bears no relationship to any possible behaviour of Q (this intuitively corresponds to the backward reachability in Q, which is not allowed). More formally, it can be shown that, for a large and interesting class of operator boxes Q, if (Beh 1 )-(Beh5) hold in addition to (Dom 1 )-(Dom2), then not only SOS compositionality, but also behavioural compositionality is ensured. The latter means that the behaviour of an ^-composite object is the composition of the behaviours of its components, as determined by the behaviours of ^ . Details can be found in [11]. 7. A generic process algebra and its two consistent semantics This section describes an algebra of process expressions based on the sos-operator boxes, called the box algebra. The box algebra is in fact a meta-model parameterized by two non-empty, possibly infinite, sets of Petri nets: a set ConstBox of static and dynamic plain boxes which provide a denotational semantics of simple process expressions, including constants, and a disjoint set OpBox of sos-operator boxes which provide interpretation for the connectives. The only assumption about the sos-operator boxes in OpBox and the static boxes in ConstBox is that they have disjoint sets of simple root-only trees as their place and transition names, i.e., for all distinct static and/or operator boxes E and 0 in OpBox U ConstBox, ^rUTrCProotUTroot
and
5 r n 5(-; = T r n TV-; = 0 .
(14)
7,1. Syntax We consider an algebra of process expressions over the signature Const U { O , O } U {op^ I Q G OpBox},
where Const is a fixed non-empty set of constants which will be modelled through the boxes in ConstBox, (.) and (.) are two unary operators, and each op^ is a connective of the algebra indexed by an sos-operator box taken from the set OpBox. The set of constants is partitioned into the static constants. Const % and dynamic constants, Const^; moreover, there are two distinct disjoint subsets of Const^, denoted by Const^ and Const ^ and respectively called the entry and exit constants. We also identify three further, not necessarily disjoint subsets of Const, namely: Const''^^ Const^"^" and Const''^''^, called respectively the ex-exclusive, e-directed and x-directed constants. We will also use a fixed set X of process variables. Although we use the symbols (.) and (.) to denote both operations on boxes and process algebra connectives, it will always be clear from the context what is the intended interpretation. There are four classes of process expressions corresponding to previously introduced classes of plain boxes: the entry, dynamic, exit and static expressions, denoted respectively
A unified model for nets and process algebras
913
by Expr^, Expr^, Expr^ and Expr\ Collectively, we will refer to them as the box expressions, Expr^^^. We will also use a counterpart of the notion of the factorization of a tuple of boxes. For an sos-operator box Q and an .T?-tuple of box expressions D, we define the factorization of D to be the quadruple fx = {pie. I^d. MA » M.O such that ps = {^ \ Dv e Expr^}, for 8 G [e, X, s}, and p^ = {v \ Dy e Expr'^\(Expr'' U Expr')}. The syntax for the box expressions Expr^^^ is given by: Expr'
£::=cMX|op^(E),
Expr^
F :•.= €"
Expr'^
G::=c'\K\opn{G), ^|0Pr2(^),
Expr^
//::=c^|F|G|op^(H),
\E\op^(F),
(15)
where c^ e Const^, for 8 e {e, x, s}, and c'^ e Const''\(Const'' U Const') are constants; X G A* is a process variable; Q e OpBox is an sos-operator box; and E, F, G and H are f2tuples of box expressions. These tuples have to satisfy some conditions determined by the domain of application of the net operator induced by f2. More precisely, the factorizations of E, F and G are respectively factorizations of the complex markings (0, 0), ( ° ^ , 0) and ( ^ ° , 0), and the factorization of H is a factorization of a reachable complex marking different from ( ° ^ , 0) and {Q°, 0). In what follows, expressions in Const U Const^ U Const \ will be referred to as^^r. The above syntax is liberal in the sense that it only reflects properly the first part of the definition of the domain of an operator box, without reflecting the conditions (Doml) and (Dom2). We will describe syntactic restrictions implied by (Doml) and (Dom2) separately. For every process variable X e X, there is a unique defining equation X = op^(L) where ^ e OpBox is an sos-operator box and L is an ^-tuple of process variables and static constants. As in the domain of boxes, it is convenient to have a notation for turning an expression into a corresponding static one. We again use [.J to denote such an operation. To achieve the desired effect, we assume that for each dynamic constant c there is a corresponding unique static constant denoted by [cj and, if C is an expression, then [C] is the static expression obtained by removing all occurrences of (.) and (.), and replacing every occurrence of each dynamic constant c by the corresponding static constant [cj. EXAMPLE (Continued). We will use the running example based on the boxes depicted in Figure 17 in order to construct a simple algebra of process expressions. More precisely, we will consider the Do It Yourself (DIY) algebra based on the following two sets of boxes:
OpBox = {^o} and C0nstB0X= {01, 011, 012} U{02, ^21, 022, 023} U {^3}, where \jPij\ = 0/ = L^iv J, for all / and 7, and the following hold: ^0,1 = {^11,^14} and M0._, = [qik]
M0,, ={(713,^12}
(for ^ = 1,2, 3).
and
914
E.BestetaL
The constants of the DIY algebra correspond to the boxes in ConstBox: Const^ = {c2i},
Const ^ = {ci,C2,c3},
Const^ = {Q3},
Const^ = [c\\,c\2.C2\, cii, C23}.
Moreover, Const = Const^'^''' = Const''^", Const'"^ = Const - {ci, ci 1, cn] and L<:/7J = c/, for every dynamic constant cij. The syntax of the DIY algebra is obtained by instantiating (15) with concrete constants and operator introduced above, and taking into account the factorizations in factr?o (see Table 1). For example, the syntax for the static and entry DIY expressions is: Expr-^
E ::=op^^^(£, £, £) | c, | c. | C31 X,
Expr^
F::=op^^,(F,F,£)k2i|^.
An example of valid dynamic expression is op^jj(cT, C22, ^3) which, as we shall later see, corresponds to the net refinement I2o(T) of Figure 17. Domain restrictions. We now take into account restrictions implied by (Doml) and (Dom2). Let Expr"^, Expr'^'^ Expr'''^''^ and Expr^^^''^ be the largest sets of expressions in Expr^^^ - called respectively the well formed, ex-exclusive, e-directed and x-directed box expressions - such that the following hold: - All ex-exclusive, e-directed and x-directed expressions are well formed. (Exprl) - If op^ (D) € Expr''^ then, for every V£TQ: (Expr2) • if *!; n u V 0 then D^ e Expr ^^', • if i; is not reversible then D^ e Expr ^^'"^. - If op^(D) € Expr ^'^^ then f2 is ex-exclusive and Di € Expr ^'^ for every V elQ satisfying •i;n°^7«^0 7^i;*nr?°
or
(Expr3)
i;* H ° ^ 7^ 0 ^^^ % 0 ^ ° .
- If op^(D) € Expr^''''" then f2 is e-directed and, for every v e (°^)*, Dy e Expr^^^^ - If op^(D) € Expr''^''* then ^ is x-directed and, for every v e • ( ^ ° ) , Dy € Expr^^^^
(Expr4) (Expr5)
- If £ G Expr^ or £ G Expr^ or X G Expr^ and X = E, then E G Expr^ (Expr6) for S G {wf, xcl, edir, xdir}. - Const c Expr''^ and Const^ = Const n Expr\ for 8 e {xcl, edir, xdir}. (Expr7) We will be interested only in well formed expressions, and they will simply be called (box) expressions from now on. 7.2. Denotational semantics Denotational semantics of the box algebra associates a box with every expression. We proceed by syntactic induction.
A unified model for nets and process algebras
915
Constants. Constant expressions are mapped onto constant boxes of corresponding types, i.e., for every constant c and S e [e, d, x, s, xd, edir, xdir), c e Const"^ ^ box(c) € Box*^ n ConstBox.
(16)
It assumed that, for every dynamic constant, the underlying box is the same as that for the corresponding static constant, and that it is reachable from the entry or exit marking of the latter; i.e., for every c in Const*^^ [box(c)J =box(LcJ)
and
box(c) e ([box(LcJ))u [box(LcJ))).
It is also assumed that, for every non-entry and non-exit dynamic box reachable from an initially or terminally marked constant box, there is a corresponding dynamic constant, i.e., for every c in Const \ ([box(c))u ["box(c))) \ { box(c), box(c)} c box(Const'').
Variables. With each defining equation X = op^ (L), we associate an equation on boxes, X = Q(^), where ^v = Lv if L^ is a process variable (treated here as a box variable), and ^i, = box(Li,) if L^, is a static constant. This creates a system of net equations of the type considered in Section 5, but for a set of recursive variables JY rather than for a single variable X. For such a system, it follows that it has at least one solution in the domain of static boxes. We then fix any such solution sol: A' -^ Box ^ and define, for every process variable X, box(X) = sol(X). As a result, for every variable X defined by the equation X = op^(L), box(X) = ^ ( b o x ( L ) ) G Box'.
Compound expressions. The definition of the semantical mapping box is completed by considering all the remaining static and dynamic expressions, following the syntax (15). The box mapping is a homomorphism; hence, for every static or dynamic expression op^(D) and every static expression £, box(op^ (D)) = Q (box(D)) box(£;) = box(£).
and
box(£) == boxCE)
and
The semantical mapping always returns a box, and the assumed type consistency between constants and their denotations, (16), carries over to the remaining box expressions. 11. For every box expression D, box(Z)) is a static or dynamic box. Moreover, for every 8 e [e, d, jc, s), D e Expr^ if and only ifbox(D) e Box^. THEOREM
(Continued). In the case of the DIY algebra, for every static constant c,, box(c/) = 0/, and for every dynamic constant c/y, boxCc/y) = 0ij. Thus, for example, the EXAMPLE
916
E.Bestetal
composite box in Figure 17 can be derived in the following way: box(op^^(cr,C22,C3)) = ^o(box(cr),box(c22),box(c3)) = ^o(bOX(ci), 022, ^3) = - ^ 0 ( ^ 1 , ^22, ^ 3 )
= ^o(r,,,n3,r,3) = ^o(Y). 7.3. Structural operational semantics Similarity relation on expressions. First, we define a structural similarity relation on box expressions, =, which provides partial identification of box expressions with the same denotational semantics. It is defined as the least equivalence relation on box expressions such that the following hold. - For all flat expressions D and H satisfying box(Z)) = box(//), and all defining equations X = op^(L), D=H
Z^op^(L)
(17)
- For every sos-operator box Q and every factorization /x of ( ° ^ , 0) or (i?°, 0), we have respectively: op^ (D) = op^ (H)
op^ (D) = op^(H)
(18)
where D and H are ^-tuples of expressions such that, for every v e TQ: Di= Hi, if V e iie\ Dy = Hy^'if V e iXx\ and Di- = H^ otherwise. For every sos-operator box Q, for every reachable complex marking of Q, different from ( ° ^ , 0) and ( ^ ° , 0), and for every pair of different factorizations /x and K of that marking. op^(D) = op^(H)
(19)
where D and H are ^-tuples of expressions for which there is an ^-tuple of expressions F such that, for every v e TQ: D^. ^~F\'\f V e iie\ D^ = Fj^'ii V e /Xv; and Dv = F^ otherwise. Similarly, for every v e TQ: //,. = Fv if f G Ke\ Hi, = F\^ if v e KX\ and Hx) = Fy otherwise. Intuitively, F corresponds to the common (and thus unchanging) part of D andH. For all static expressions E and F, for every sos-operator box Q, and for all ^-tuples of expressions D and H with factorizations in fact^: E=F E=F
E=F D= H E = F_ o p ^ ( D ) = o p ^ ( H )
(20)
The structural similarity relation is closed in the domain of box expressions and preserves the denotational semantics. More precisely, whenever a box expression can match
A unified model for nets and process algebras
917
one side of a rule, then it is guaranteed that the other side is a box expression too. Thus the rules can be thought of as well formed term rewriting rules. Similar comment applies to the rules of the structural operational semantics. 12. If D is a box expression and D = H then H is a box expression such that box(D) = box(//). THEOREM
Thus = is a sound equivalence notion in the domain of box expressions. It is also complete in the sense that box(D) = box(//) implies D = H provided that [DJ = [_H\. {Continued). The DIY algebra gives rise to five specific rules for the structural equivalence relation (we omit here their symmetric, hence redundant, counterparts). The first two are derived from (17): cj = C2i and Q = C23. The third and fourth are derived from (18): O\>^^(E, F , G) = op^^^(£,F,G) and op^,(E, F, G) = op^^,(£, F, G). EXAMPLE
Finally, there is a single instance of (19): op^^( F, F^,G) = op^^/F, F, G). An application of these rules is illustrated below:
OPf2o(£l' ^23, C3) = Op^Jci^, Q , C3) C\ =C\
C23 = C2
Op(C£, Q , C3) = Op^^/Ci, Q , C3)
C3 = C 3
Label based operational semantics. Thefirstderivation system has moves of the form D —> H, where D and H are expressions and F is a finite multiset of labels. Formally, we define a ternary relation —> which is the least relation comprising all triples D —> H, where D and H are box expressions and F G mult(Lab U {skip, redo}), and the following hold. - For every static expression F:
EJ^!^E
EJI^E
(21)
For all box expressions D, J and //: D~H D^H
D-L^J^H
D-^jJl^H D-^
H
D-^
(22)
H
- For every flat expression D and a non-empty step of transitions U enabled at A/box(D). there is an expression H such that box(D)[L^)box(//), Abox(D)(^) = ^ and: D-^ H
918
E. Best et al.
For every operator box ^ , and all X?-tuples D and H of expressions with factorizations in fact^: WveT^: 0PQ(D)
r,!-h--+ri^'' >//,
D,
L.^Toi^l
4n
(23)
(rl,al)ekQ(v)
op^iH)
The only way to generate a skip or redo is through applying the rules (21), and possibly the rules (22) afterwards; thus, for example, if D - ^ H and skip e F then T = {skip}. Moreover, D - ^ H if and only if D = //. A fundamental property of the operational semantics is that it transforms box expressions into box expressions, and the moves generated are all valid steps for the corresponding boxes. 13. Let D be a box expression. If D —> H then H is a box expression such that box(D)sr[r)iabbox(//)sr. Conversely, (f box(D)sr[r)iab i^sr then there is a box ex-
THEOREM
n
pression H such that box(H) = Z and D —> H. This theorem ascertains the soundness (correctness) and the completeness of the SOS rules for the box algebra with respect to the denotational semantics. In its proof [11], Theorems 9 and 10 are used, along with a string of more technical results about the boxalgebraic framework. EXAMPLE (Continued), In the DIY algebra, the operational semantics of flat expressions is given by:
c\ C22
—>C\2
—^£2
C2 •C\2
^
Q2
J^' £ l
^1 Q2
{h}^
n
c\\ Q3
-H Q 2 ±1^£i
{aj^
Ql -
C\
c\\
c^ Je]^
c\ £3
and the inference rule for the only operator box can be formulated in the following way: £), l±Jn±n^
HuD2-^
H2, Dy - ^ //3
a,bi^n
0Pi2„(D,, D2, D3) *^^•^i+^'+^^+^^ op„„(//,, //2, Hi) An application of these rules is shown below: OPf?()(^J' ^2^ O ) ^^^ 0PQQ(C],C2,C^)—^op^^(ci,C2,C3)
Op^^,(£j^, C22, C3)
'•'fj, opp^j(ci,C2,C3) — ^ op^^^ (C|, C22, C3) c\ —> c\
C2 —> C22
C3 —> C3
919
A unified model for nets and process algebras
The upper step is an application of (22), while the lower step is an application of the preceding inference rule (and hence of (23)). Transition based operational semantics. Consider the set Tj^^g of all transition trees in the boxes derived through the box mapping. It is easy to see that each t e J^^^QQ has a unique label, lab(0, in all the boxes associated with box expressions in which it occurs. The operational semantics we will now define has moves of the form D —> H such that D and H are box expression and L^ is a finite subset of T^^Jg U {skip, redo}. The idea here is that L^ is a valid step for the boxes associated with D and //, after augmenting them with the skip and redo transitions. We will denote, for every such set, lab(f/) = ^ { l a b ( 0 } teU
assuming that lab(skip) = skip and lab(redo) = redo.
In the process of defining a transition based operational semantics, we adopt without any change the structural similarity relation on expressions, =. The rules of the operational semantics are also carried forward after changing F to U consistently, with the exception of the last rule (23) which is redefined thus:
{\db{U[:).a[)eXQ{v) op^(D)^op^(H) where
U = lJ^^^j^[{v^al)
..{v.a'l^XU^n
{Continued). In the DIY algebra, the transition based operational semantics of flat expressions is given by the axioms: EXAMPLE
C7^C,2
— U21J ^ Q ^ C12
C22
C\l — ^ £!_
>C2
crimen
C2,
{/22}
Q2
-^022
c\
—V
c^
cni^c.
^ Q3
and the inference rule for the only operator box is: D^
^i<^i
g.^A.-vi
v/}
Y\i
TT
\y\
ym\
Tjf
^
{^i--
-ic
op^„(D, G, //) - ^ opi2„(D', C , //') where k, l,m,n^ 0; {lab(//), lab(M/)} = {a, b}, for every / ^ k; \ab(xi) ^ {a, b}, for every / ^ /; and the step U is given by: U =
{(vuf)<{tuu^],...Av\,f)<{tk.Uk}}U
920
E. Best et al.
{{v\,\ab(x\))
< i j c i , . . . , (i;i,lab(jc/))
{(i;2, lab(ji)) <] j i , . . . , (u2, lab(j,„)) < y,„} U {(us, lab(zi)) < z i , . . . , (i;3, lab(z„)) < z,;}.
For example, the following is a valid sequence of three moves: OP^o(^l'^2,C3)
"'l.W'2l '-^^
^ « /^ ^ ^ \ {"'3j Op^^/Ci^,C22,C3)^—>Op^^j(Ci,C2,C3)
- ^
Op^^/Cl,C2,C3).
A derivation tree for the first move is shown below: OP^O^^l' ^ 2 , C3)
{U'i.U'2^
' - ^ Op^^,(£i^, C22, C3)
^9QO(C\ . C2, C3) —> opQ^^ic\, C2, C3)
o p ^ j / c i , C2, C3) ci
!--^ '- > c\
^ Op^^/cj^, C22, C3) C2-^C22
C3—)• C3
7.4. Partial order semantics of box expressions The structure of name trees in T^^^^ turns out to be a rich source of information about the connectivity between transitions in nets generated from box expressions. What is more, this information is independent of the specific net to which two transitions happen to belong. Connectedness properties of transition trees. It is possible to capture the property of 'being connected to an entry or exit place'. A transition tree t € 1^^/^ belongs to the set Con^ or Con^, if one of the following holds: either (i) there is a plain box U e ConstBox Pi Box^ such that t e TE and we have, respectively, (•/ U r*) n ° r 7^ 0 or (V U r*) n r ° 7^ 0; or (ii) there is an operator box Q € OpBox such that t = {v,a) <\ Q and v £TQ, and we have,^ respectively: •f n ° ^ 7^ 0 7^ (2 n Con' V i ; T l ° ^ ^ 0 ^ e n Con'
or
• i ; n ^ V 0 7^ 2 n Con' vi;Tl^°7«^07«^(2n Con\ One can then show that if D is a box expression then •(°box(D)) U (°box(D))* = TboxCD) H Con' and •(box(D)°) U (box(D)°)* = TboxiD) H Con'. ^ Hence, the definition of the sets Con^ and Con^ (as well as that of the global independence relation) is recursive, but since transition trees arefinitethis is not a problem.
A unified model for nets and process algebras
921
Global independence relation. The trees in Tj^gg also contain enough information to reconstruct the independence relation on transitions in nets generated by box expression. A pair of transition trees (r, u) e T^'/gg x Tj'/gg belongs to the set ind^^'^ if one of the following holds: either (i) there is a plain box E G ConstBox n Box^ such that (r, u) G indr; or (ii) there is an operator box Q G OpBox such that t = {v,a) < Q and u = (w, P) < R and v,w eJQ, and we have: •i; n u; V 0 => G n Con' = 0 V /? n Con' = 0, i;* n 'u; 7^ 0 => Qr\ Con'' = 0 v /? 0 Con' = 0, vi^w A*vf^*w^V^ ^ Qr\ Con' = 0 v /? n Con' = 0, Vy^wAv*nw*^0=^Qn Con' = 0 v /? n Con' = 0, and, moreover, if i; = u; then Q x R c. ind^''^^. Intuitively, ind*^^'"^ can be thought of as a global independence relation since, for every box expression D, indbox(D) = {TboxiD) x T^O%{D)) H ind"''''. That this property holds is due to the assumption made in (14) that the operator and static constant boxes have disjoint transition sets. As a result, one can identify, for every transition t in OpBox U (ConstBox 0 Box^), a unique net (operator or static constant box) to which t belongs. Partial orders generated by box expressions. Having defined the global independence relation, we can introduce partial order behaviours modelled by Mazurkiewicz traces directly into the box algebra. Let D and H be two box expressions, and U\, ...,Uk (k^O) be subsets of 1^^^ such that there are box expressions DQ, D\,.... Dk satisfying D = Do, H = Dk and, for every i/ < < k, Di ^- ^ A + i . Then n = posetjnci^'/t>'(^i ... 6^;) is a partial order execution for D, A+i denoted D-^ H.
7.5. Consistency results The consistency between the denotational and operational step sequence semantics of box expressions is expressed through the transition systems they generate. Let G be a dynamic expression. We will use [G)sr to denote the least set of expressions containing G such that if // G [G)sr and H - ^ C, for some finite subset U of ^tre^e ^ {^^'P' ''©do}, then C G [G>sr. The full transition system of G is the transition system generated by G up to structural similarity. Formally, it is defined as ftsc = (V, L, A, UQ) where: V = {[//]= | H e [G)sr} is the set of states; vo = [G]^ is the initial state; L - the set of all finite subsets of Tj^ee ^ {skip, redo} - is the set of labels; and A = {{[HU, [/, [CU) eV X LxV
\H
-^C]
is the set of arcs. For a static expression £", ftS£ = fts^.
922
E. Best et al.
The label based operational semantics of a box expression D is captured by the transition system of D, denoted by tso and defined in exactly the same way as ftso, with each transition based move H —> C replaced by the corresponding label based move H —> C. We now state two fundamental results which effectively state that the operational and denotational semantics of a box expression capture exactly the same behaviour. Both theorems rely on Theorem 13, but go a step further. THEOREM
14. For every box expression D, the relation
iso = {{[HU, box(H)) I [HU is a node ofWso] is an isomorphism between ftso and ftSbox(D) (^s well as between XSD and tSbox(D)15. Let D be a box expression, and n be a partial order (1) IfD - ^ H then box(D) [7r)pobox(//). (2) //box(D) [7r)po r then there is H such that box(//) = E andD^^
THEOREM
H.
EXAMPLE (Continued). In the DIY algebra. Theorem 14 can be illustrated by taking the expression D = op^^ (cf, C22, C3) and the corresponding box shown in Figure 17. Figure 19 depicts ftsz) and ftSbox(D), where
^0 =
{opQ^ic\,C22.C3)),
^l = {oPr2o(^NQ'0),Op^,^(cT,Q,C3), OP^o(^,C21,C3)},
Mr,
={p\^P2.P5},
?2 = {oP^o(£l' ^ ' ^3), Op^j/Ci^, C21, C3)},
Mz2
={P3.P4,P5}.
§3 = {op^(^(Ci_,C22,C3)},
Mzy ={/?3,P4,P6},
§4 = {op^o(CT, C23, C3), Op^^/cT, C2, C3)},
Mr4
=^{p\^P2.pi}.
ftSi box(D) Fig. 19. Isomorphic full transition systems.
A unified model for nets and process algebras
923
§5 = {oP^o^£l' £2, C3), Op^^/Ci^, C23, O ) ,
In Section 3.3, we defined two behavioural equivalences between static and dynamic boxes based on the transition systems they generate. These can be lifted, through the box() mapping, to the level of static and dynamic box expressions, and then one can show that they are both preserved by the operators of the box algebra.
8. Examples and applications In this section, we formalize PBC using the generic framework of the box algebra. We then argue that other process algebra models can be viewed as instances of the general scheme too. Finally, we sketch an application of PBC to a concurrent language with data.
8.1. PBC As a first case study, we discuss a version of PBC which is based on eight operator boxes and two kinds of constants, depicted in Figure 20. The operator boxes are: Q[f] (basic relabelling), QsyA (synchronisation), QrsA (restriction), 0[A:] (scoping), ^- (sequence), ^ 0 (choice), ^n (parallel composition) and ^ * (iteration), where / : APBC -> ARBC is a
function and A c APBC is a set of action particles. (See Section 2.2 for the definition of ApBc and other related notions.) All eight operator boxes are sos-operator boxes which are x-directed and have all transitions reversible. Moreover, all except iteration are also pure and e-directed. The specific relabellings used are as follows: - QsyA is the smallest relabelling which contains QU and such that, if (T, a -\- [a]) e QsyA and {A, p + {a}) e QsyA where a £ AUA, then (F -\- A,a -\- P) e QsyA, as well. This relation captures the multiway synchronisation explained in Section 2.2. - Q[A:] comprises all the pairs (T, a) G ^sy A such that a ^ a, for every a e AU A. - QrsA comprises all the pairs ({o?}, a) € Qij such that a ^a, for every a e AU A. - Q[f] comprises all the pairs ({a}, f(a)) where / is applied to a element-wise. The static PBC constants (all ex-directed and ex-exclusive) are: Na for a multiaction a e LabpBC* and l^[x^^] for a data variable x (not a recursion variable). The latter deserve an additional explanation. Data variables. Let x be a data variable of type D, and • be a special symbol not in D, interpreted as an 'undefined value'. For such a variable, the set of action particles APBC contains the symbols Xki and xu for all /:, / G D U {•}; moreover, x^i and xu are conjugate action particles. The behaviour of JC will be represented by a plain box N[v,)j. Intuitively, it is composed of an initialization part, a core looping part and a termination part. Such a box can first execute x.^, for any value u in D, then a sequence of zero or more executions of Xu^, where u,v e D, and possibly terminate by executing jc„,. Each such execution is carried
924
E, Best et al.
Na
Q s>\/A
^'' X ; -l' sy A
•S.4
0^:^:]
rs.l
©•'•[•4::
[ e ) e,,
Qr
j / | |
\QU{
VI
X ) .r I
Nf. [JQ]
( e ) e Q„r\ V
( X )
X,
4
{-foo}
W3
[W]
<-i' {^nj]
| { . n . } | <•]•
Fig. 20. PBC operator boxes and constants.
out under a restriction that, if Xku and JCi,/ are two consecutively performed actions, then u = v. We use Xiiv to represent the change of the value of x from M to u, x.n to represent an initialization of x to the value w, and Xu. to represent the 'destruction' of A^ when its current value is u. The net model of a data variable is exemplified in Figure 20 for a binary x, i.e., D = {0, 1}. In general, we define N^.v,,] = (5v, T,, Wv, A..v, 0) where: S^ = {e;,, jc.v} U {s'^ \ueD] and r,. = [v*\ v';* \ueD}u {u;''' I M, i; G D}, the weight function W.v returns 1, for all the pairs in the set { ( e v , C ) . ^ " . ^ . 0 - (^"'^n
«"-^.v)' ( ^ . v ' O -
{v'i\x,)\u,veD}
A unified model for nets and process algebras
925
and 0 otherwise; and the label function is defined, for all the values u,v e Kx {ex) = e,
A.v (-X.V) = X,
D,by:
A.v ( < ) = i,
There is also a set of dynamic constant boxes N[j^j, for every u e D, defined in the same way as N[jC()], but with a single token in the place ^". PBC syntax I. The following is the syntax (15) for static box expressions generated by the operator boxes and constants in Figure 20.
E::=X\a\
[x^] I E\\E \EQE \E;E \{E^E]\ E[f] I EsyA I ErsA \ [A : £ ] .
Notice that we have replaced the functional style of denoting box expressions by more common infix and postfix notations. The symbols used should make obvious the association between the boxes in Figure 20 and the PBC term operators. The dynamic PBC expressions are defined below, where E denotes a static PBC expression given by (24): G::=E
\E E;G
{[x^^]
\ G\\G \ GU E \ E UG \ G; E \
I ( G * £ ] I ( £ * G ] | G[f] \ GsyA
\ Gxsa
^^^^
\ [A : G ] .
The syntaxes (24) and (25) do not yet incorporate the condition (Doml); the other condition, (Dom2), is trivially satisfied since the operator boxes in Figure 20 have only reversible transitions. PBC syntax IL
The refinement of the syntax (24) - shown below - incorporates (Doml).
It is assumed that the variables X''f and X'''^ are defined by X''f = E''^' and X''^ = £•'^^ respectively. E''f \:=X''f
I E''f[f]
I E''-^' D E''f \ {E'''' * E''^] \ E'^'f \\ E^'f \ E'''
Expressions defined by E^^'^ and £^^' are the well formed and ex-exclusive PBC expressions, respectively. Moreover, since non-trivial aspects of non-ex-exclusiveness and non-ex-directedness are associated with control flow rather than communication interface operators, we may treat the latter as equivalent; hence we shortened the syntax by arbitrarily selecting only one communication interface operator, viz. basic relabelling. The same comment apphes to the constant boxes; since in PBC all these are both ex-exclusive and ex-directed, we included just the basic action. Similar, rather immediate, modifications can be incorporated into the syntax of dynamic PBC expressions. The refined PBC syntax (26) is an instance of the general box algebra and, as a consequence, all results formulated in the Sections 6 and 1 hold for it.
926
E.Bestetal
PBC syntax III The syntax (26) still admits expressions for which the corresponding boxes may not satisfy the conditions (Behl-5). We therefore further refine it by introducing a third syntax which identifies a subset of expressions generated by (26) where these conditions have been incorporated. The syntax is based on four syntactic classes E^, and it is assumed that each variable X^ is defined by X^ = E^. j^wf
:= X''f
1 £"^[/] 1 E"'"''
1 E''i'\\E''f
1 i^pedinxcl ^ pedir^
p'edir
.
-yedir
1 E"»'[f]
1 pedir^^pedir 1 pedir |] pedir
pxcl
: = X""'^
\ £«•'[/]
1 E''^'\ E''^' 1 / pedinxcl ^ pedirixc ]\E' edinxcl
pedinxcl
.
pedirixcl
i £edir.^ £ u / 1 pedinxcl n pedinxcl
'yedir.xc I 1 pedinxclTs^
The above syntax conforms to the general box algebra scheme (again, we omitted a straightforward adaptation of the syntax for the dynamic PBC expressions) and all composite boxes corresponding to expressions it specifies satisfy the five conditions, (Behl-5). Referring to the notation used in Section 7.2, the annotations u/, edir and xcl indicate that the respective syntactic entities define expressions which are respectively well formed, edirected and ex-exclusive. Notice that all expressions are also x-directed since so are the PBC constants and operator boxes in Figure 20.
8.2. The two semantics of PBC The denotational semantics of PBC follows the general pattern, so we omit the details. As to the structural equivalence equations, we provide those specific to the PBC in Table 2. Table 2 PBC structural equivalence rules
KWL^EWF
IPARl
MF^'EWT
IPAR2
ICIL
EUF=^UF
IC2L
EUF=EUF
ICIR
EUF=EUT
IC2R
EUF=EUF
ISl
'ErF=~E\F
IS3
E\Fi=E\F
IITl HT3 IRl
{E*F] =
IS2
{E*F]
(£*F] = (£*F]
W]^E[f]
E:,F = E\T
HT2
(£*F] = (£*F]
IIT4
(£*F] = (£*F]
IR2
E[f] ^
E[f]
IRSl
ErsA = ErsA
IRS2
ErsA = E^rsA
ISYl
EsyA = EsyA
ISY2
Esy A = E_sy A
ISCl
[A:E]^[A:
ISC2
[A:E]^[A:E_]
E]
A unified model for nets and process algebras
927
Table 3 PBC operational semantics rules I AR
a —> a
.ii^c
AR'
{V*"]
DATl
M^^i^i
DAXr
DAT2
[^1-^^^^
DAT2'
DAT3
riTmiiiiili
DAT3'
{v'ri
PAR'
G-^G ,H -^ H r et/ur^ew •G'WH' G\\H
PAR
G-^G',H
G^ GUE-^
CR
-^ H'
11
H
SR
G-^ H
ITl
EUG^^^EUH
G\E—
G-^ H {E*G]-^
RR
E\G—
Gin -^^ H[f]
v-eu
> E\H
G^H
ITl'
(G * £ ] - ^ i ® ^ ( / / * £ ] G-^H
IT2'
{E^H]
G-^H
> H\E
G^H
SR'
E;H
G-^ H
G^H
SL'
( G * £ ] - U (//*£] IT2
,
G^H
CR'
H\E
G-^ H E;G-^
W
H\]E
G-^ H
G\E-^
f
[^()]
G-^H
CL'
EUG-^EWH SL
[Xiu)]
(l"'}
G||//-^-t4G'||//' CL
[X()]^—^
{E^G]^^^^{E^H] G^H
RR' G[f]^^
>H[f]
The rules of the label based and transition based operational semantics, except those which hold for any box algebra, are shown in Tables 3 and 4. In the Tables 3 and 4, the notations (u, f)®U and i; 0 f/, where f is a transition name, /'- ApBC -^ ApBc is a mapping from labels to labels and L^ = {ri,..., r^} is a finite set of transition trees, respectively denote the following sets of transition trees: {(u, /(lab(fi))) < r , , . . . , (u, /(lab(r^))) < a } and {(u, lab(/i)) < r i , . . . , (u, lab(rA)) < tk].
928
£. Best et al. Table 4 PBC operational semantics rules 11 RS
^ - ^ GrsA-^ HrsA
aGr=>(AUA)na = 0
cr€lab(y)=>(AUA)na = 0
RS' GrsA ''''^®^> HrsA SY
^
GsyA ^"' SY'
^
^^
"^UsyA ^^
sc
C7ii±:±^//
SC
G " ' ^ - ^ ^ / /
i\ab(Ui),ai) EQsyA
iri,ai)eQ[A:]
(lab(Ui),ai)e6[A:\
Let us verify, for instance, that the rule (23), when instantiated for the sequential composition operator, is equivalent to the two rules SL and SR of Table 3. What we need to do is look closer at the syntax of legal PBC expressions and, moreover, bear in mind that static expressions allow only empty moves. Then (23) can be seen as giving rise to two different rules, where G and H are dynamic, while E and F static expressions:
And, if we take F = E (which is always possible since E —> £"), we obtain SR and SL. Conversely, SR and SL together with the rules (20) and (22) as well as the fact that E —> F implies E = F, yield RSi and RS2. 8.3. Equivalence properties As yet we have not discussed any specific algebraic properties of the various box algebra operators with respect to behavioural equivalences. Although we could, in principle, consider these equivalences separately, within the net framework and the process expression framework, in view of the consistency results formulated in Section 7.5, we would do the same thing twice, as every result developed for one would hold (almost) verbatim for the other. We therefore present a set of properties - or laws, in CSP terminology - for the static PBC expressions (their extension to the dynamic expressions being immediate). To
A unified model for nets and process algebras
929
be more precise, we will say that two static PBC expressions, E and F are ts-isomorphic, E = F,if tS£ and tS/r are isomorphic, and strongly equivalent, E ^ F, if so are ts^ and ts/r. We now list several laws for PBC. - Parallel and choice compositions are associative and commutative, while sequential composition is only associative: E\\(F\\F') = {E\\F)\\F'
E\\F = F\\E
EQ(FUF')
EUF
= (EUF)[]F'
=
FUE
E\ (F; F') = (£; F); F^ Choice is also idempotent, in the following sense: EUE^E
aDa
= a.
- Synchronisation and restriction are both commutative, idempotent and insensitive to conjugation; they also distribute over choice, sequence, iteration and, in the case of restriction, parallel composition: EsyAsyB
= EsyBsyA
ErsArsB
=
EsyAsyA
= EsyA
ErsArsA
= ErsA
EsyA-EsyA
ErsBrsA
ErsA = ErsA
(E D F)syA = (EsyA) D (FsyA) (F;F)syA^(FsyA);(FsyA) (F*F]syA = ((FsyA)*(FsyA)]
(F D F)rsA = (ErsA) D (FrsA) (F; F)rsA = (FrsA); (FrsA) (F * F]rsA = ((Frs A) * (FrsA)] (F||F)rsA = (FrsA)||(FrsA).
Moreover, synchronisation propagates through parallel composition: (F||F)syA = ((FsyA)||(FsyA))syA. - Scoping is idempotent and insensitive to conjugation; it also distributes over choice, sequence and iteration compositions: [A : [A : F]] = [A:E]
[A: F] ^ [A : F]
[A : (F D F)] = [A : F] D [A : F]
[A : (F; F)] = [A : F]; [A : F]
[A:{E^F]]^{[A:E]^lA:F]l - For non-interfering sets of action particles A and B (i.e., A O (B U B) = ^) synchronisation and scoping commute with restriction: (Fsy A)rsB = (FrsB) sy A
[A : F] rsB = [A : (FrsB)].
930
E. Best et al
- Relabelling distributes over the control flow operators: (£; F ) [ / ] ^ ( £ [ / ] ) ; ( F [ / ] )
{E D F ) [ / ] = ( £ [ / ] ) D ( F [ / ] )
{E\\F)[f] ^ {E[f])\\{F[f])
{E * F][f] = {E[f] * F [ / ] ] .
- For a bijective relabelling / which preserves conjugates (i.e., f(a) = f{a)) we obtain properties akin to commutativity and distributivity: (EsyA)[f]^{E[f])syf(A)
{E[f])sy A = {Esy
(ErsA)[f]^{E[f])rsf(A)
{E[f])rsA
[A : E][f] ^ [f(A):
[A : ( £ [ / ] ) ] ^ [ / - ' ( ^ ) : F ] [ / ] .
(£[/])]
=
f-\A))[f] {Ersf-\A))[f]
- Successive relabellings can be collapsed, and [id] (where id is the identity relabelling) is a neutral operator: ^[/][^] = ^ [ ^ o / ]
E[id]^E,
- Iteration can be expressed through recursion (see also Example 3 below): (F * F] ^ X
where X ~ (F; X) D F.
It is possible to consider other equivalences in the domain of PBC expressions. For example, two static expressions are duplication equivalent if so are the corresponding static boxes. The resulting equivalence was studied in [31] where its sound and complete axiomatization for a variant of the PBC syntax was given. The applicability of the laws presented in this section can be extended, since they also hold if the behavioural equivalence is expressed using the partial order semantics based on Mazurkiewicz traces. For the majority of PBC laws, this follows from the fact that boxes derived for the constituent expressions are isomorphic.
8.4. Some applications of SOS rules Below we show derivations based on the inference rules and equations for the PBC expressions, indicating which specific rules in Tables 2, 3 and 4 have been applied; other rules introduced in Section 7.3 are applied implicitly. To simplify notation, in the example expressions, a singleton multiset {a} e LabpBc will be abbreviated by a, and similarly [b] by b etc. Moreover, we use sya to denote sy{(3}. EXAMPLE
1. We first deduce that
^^rj;jD7iifiimi,(«;fc)Dc.
A unified model for nets and process algebras
931
i.e., that the expression {a;b)[]c can do an ^-rnove, and thereafter a terminating /7-move: (a;b)Uc
=
(a;b)[]c
ICIL
(a; b)Uc
AR SL CL = (a; b)Uc
IS2
^M (a;b)Uc
ARSRCL=(^;^)Dc
IS3
^
=
(a;b)[]c
=(a;b)Uc
ISl
IC2L
EXAMPLE 2. As an appHcation of the rule for synchronisation, we show that E —^^^ £ where £ = (({fl,Z7}||{a,a})||{a,c})sya:
E
^
a{a,b}\\{a.a})\\{a.c})sya
ISYl
^
(({a,^}||{5,a})||{«,c})syfl
IPARl
^
(({fl,MII{^,5})ll{«,c})sya
IPARl
^ ^ ^ (({fl,Z7}||{a,a})||{a,c})syt? =
K
ARPARSY IPAR2ISY2
3. The next example shows that Z ^^''^^^^^'^^ K^ where ^ is a process variable with the defining equation K = (a\ K)[\b. To conform with the general scheme, we first replace the defining equation by a set of two equations, K = M Qb and M = a\ K. Then the detailed derivation can be carried out as follows: EXAMPLE
K = MWb = ^T^D^ ^feA:)D^ = {a\{M[\b))Wb ^M (a\ (M D ^)) D ^ = (a;K)Ub = MDZ?
ARSLCL
=M\]b ={a\K)\]b
ICIL ISl
={a\'K)\]b ={a\{M[\b))^b
IS2 ICIR
AR CR SR CL = (a; (MQb)) D b IC2R =(a\K)Ub IS3 =MUb IC2L
Note that K can make an infinite sequence of a-moves since K - % (a\ K)U b. EXAMPLE 4. The fourth example is similar to that discussed in [4] and involves a non-tailend recursive expression not directly expressible in CCS. Below we show that the dynamic expression L, for which the defining equation is L = (L; «) D «, can make two successive (2-moves, i.e.,
L """""") L.
932
E. Best et al.
We first transform the equation into the format required by the scheme developed in Sectic 7: L = N[]a and N = L\a. The derivation is then obtained in the following Section way:
Z = N[\a='N[\a
= (L;a) Ua = (L;a)[]a
= {(N{]a)\a)[]a =
{{N[]aYa)[]a^M{{NUq);a)Ua
= ((A^Dfl);^)Dfl = ( L ; a ) D a ^ ( L ; ^ ) D ^ ^ ( L ; a ) D f l = (L;a)Dfl = TV D a = NUa = L. By induction, it can be shown that L can do n successive (3-moves, for every n. But the argument cannot be used to show that it can do an infinite sequence of fl-moves; in fact it cannot. This may be contrasted with the previous example. EXAMPLE 5. We now prove by induction that the dynamic expression C, where C =a\\C, can do a T^-move, for every r,j =n - {{a]], n^ \. That is, for every « > 1, there is Cn such that
In the base step, « = 1, the above follows from the following derivation: C=^
= ^ | | C ^ £ | | C = Ci. — p
In the induction step, by the induction hypothesis, there is €„ such that C —^ C„. Then
which completes the proof. EXAMPLE 6. We finally turn to the step sequence semantics based on transition trees and the derived partial order semantics. Let E be an expression defined as {{h\ a)\\{a\ c)) sya. Figure 21 shows box(E) together with the transition trees which serve as the actual names of transitions. Note that there are four pairs of independent transition trees in the sense of the relation ind^'^, namely (ri, r3), (r\, 14), (12, T3) and (12,14). It is possible to show that E can generate the following two step sequences,
fililMliif
and
fJnllllMliif.
Below we give a derivation for the first one: E = M
(ib;a)\\ia;c))sya
= ({b;a)\\ia;c))sya
=
{{b; a)\\(a; c))syo = ((b;a)\\(a; c))sya M
ab;an(a;c})SYa ({b; g)\\(a; c))sya
A unified model for nets and process algebras
(Vsya.b)
(Vsya.a)
ivlb) ivl^b)
(i'sya,a)
• (if, a)
>(vl2) '(via)
•'^a
'K
*{v\,a)
Vb
(t'sya,c)
T2
(t'sya,0)
•('ic)
(i-'lJ.a).
•(t'«,S)
'{vie)
(if, a).
'{via) ,V2
l'o«
'Vc
U
n
933
n
Fig. 21. The box of £ = ((b; a)\\(a\ c))sya.
=
{{b;a)Ua;c))sya
=
M {ib;a)\\(a;c))sya
ma)\\ia;c))SYa
({b',a)Ua;c))sya^K-
As a result, we obtain that E - ^ £ and E -^ labelled partial orders: Tl
=
T5
T4
£ , where n and n' are the following
- • •
•
Ti
T2
n
TT'
8.5. CCS, TCSP and COSY In this section we outline how CCS, TCSP and COSY could be treated in the general compositionality framework provided by the box algebra. In what follows, by a simple operator box we will mean a two-place one-transition operator box similar to f2[/j shown in Figure 20. We will denote such an operator box by ^ '.Q, where Q is the relabelling of its only transition. CCS. To model CCS processes we assume that Lab = Act U {r} is the set of CCS labels and ^:Act -^ Act is a bijection on Act satisfying a = a and a ^ a, for all a e Act.
934
E.Bestetal.
We then define five simple operator boxes, Q\restr{b), Q.relab{h), Q.left, Q.right and Q:syn{CCS), where b e Act and /z is a mapping on labels h :Lab -> Lab commuting with (.), defined by the following relabellings: restr{b) = {{{a},a)\ae
Lab\{Z7}},
relabQi) = [{{a}, h(a)) \ a e Lab}, left={{{a},a^)\aeLab}, right ={{{a],a^)\
a eLab},
syniCCS) = {{{a^^a^}, r)\ae
Act} U {({a^},a), {{a^}.a) \ a e Lab}.
It is assumed that Lab is extended by the labels a^ and a^.for a e Lab, but neither a^ nor a^ are allowed in the syntax of CCS expressions; they are auxiliary symbols used to model correctly the semantics of CCS parallel composition. Below, we give a denotational semantics of CCS, through the full translation (()ccs for the CCS processes conforming to the standard syntax [42]: 0cc5(nil) = [{a}: a]
(for any a),
^ccsia.E) = op^ (N«, (jyccsiE)), (pccsiE -\-F) = op^^ {(pccsiE), (pccsiF)). (pCCs(E\F) = 0p^.,,„(CC5)(0Pr2|, {09Q:left{(t>CCsiE)), Op^.,/^,/,;(0cC5(/^)))),
(l>ccs{E[h]) = op^.,,i,ji,^,,){(t)ccs(E)), ^ccs(E\a)
= opQ.,^,f,^,,^{^ccsiE)).
TCSR The other two models employ synchronisation mechanisms different from those used in CCS and PBC. We will not provide a full translation of TCSP and COSY into a box algebra, leaving this task as an exercise for the reader. Rather, we shall briefly explain how concurrent composition - and thus synchronisation - used in these two models could be handled. The concurrent composition in TCSP is a binary operator, E\\AF, where A c Lab is a set of actions on which \\A enforces synchronisation. The resulting process can execute an action « 6 A if it can be executed simultaneously by the two component processes; this simultaneous execution is denoted by a. The actions outside A can be executed autonomously by the two component processes. Such a synchronisation discipline can be modelled similarly as in CCS. This time, however, we do not assume that the set of labels. Lab, has any special properties. The relevant fragment of the transformation (prcsp from TCSP expressions to box algebra expressions is modelled thus: (PTCSP(E\\AF)
= 0P^.7C5P(A)(0P^|| {09^:left{(t>TCSP(E)). Op^.,/^/,;(>rC5P(/^)))),
where Q\TCSP(A) is a simple operator box with the relabelling defined thus: TCSP{A) = {{{a\a^},a)
\aeA}u
{({^^},«), ({«^},«) I « ^ (Lab\A)}.
A unified model for nets and process algebras
935
As before, we assume that the set of labels is temporarily extended by labels a^ and a^, for each a e A, which are not in the TCSP syntax. COSY. The concurrent composition in COSY [33] is based on a multiway synchronisation. Consider a path program /7ro^ = program path^
...
path„
endprogram
Here, prog can execute a if it is executed simultaneously in all the paths pathf in which a occurs. To model such a synchronisation mechanism, we first extend ^\\ to «-ary (n^ \) parallel composition operator boxes, ^l!, in the obvious way. Let A c Lab be the set of labels occurring in program/7rog and, for every a G A, let index{a) be the set of all indices / such that a occurs in pathi. Define a simple operator Q.COSY(prog) with the relabelling being given by:
COSY{prog)=[j\( aeA
y
{a'},a\\
ieinde.xia)
and n simple operators, Q.indexi, with the relabellings indexi = {{{a), a^)\a ^ Lab}, for / = ! , . . . , « . Then the relevant fragment of the transformation 0CO5K from COSY programs to box algebra expressions is modelled thus: (pCOSYiprog)
= 0p^,coSY[prog){0Pn'^
{oPQJnde.x^ {(l>C0SY(pClth^)), . . . , 09Q:i„cIeXn {
8.6. Modelling a concurrent programming language In order to illustrate how it is possible to exploit the framework developed so far let us discuss informally how to give, using PBC, a fully compositional semantics to a concurrent programming language using PBC. Consider, for example, the following fragment of a concurrent program:
begin
varjc: {0, 1}; [jc:=:xei]||[x:=j]
end
where y is assumed to be declared by vary : {0, 1} in some outer block, 0 denotes the addition modulo 2, || denotes 'shared variable parallelism' (as variable x occurs on both sides of II), and [...] deUneates an atomic action. Let us discuss how to construct an appropriate, and as small as possible, Petri net modelling this block. Moreover, such a net should be constructed compositionally from nets derived for its three constituents: the
936
E. Best et al.
declaration varx : {0,1}, and the two atomic assignments, [x:=x 0 1] and [x:=>^], and should itself be composable, i.e., usable in further compositions with similar nets, e.g., derived for the outer blocks. As in Section 8.1, we use special action particles, in the form of indexed terms x^^^ and x^ where v,w e {0,1}. Each such term denotes a change of the value of the program (or data) variable x from i; to if, or a test of the value of jc, if i; = u;. Then the following will be translations of the two assignments into PBC:
lx:=xeij-^{m]0{xro}.
(27)
lx:=y'l -w {f55, y^o) • {xTb, m) U {xo\,yu}U
{xT\,yu]
The first expression means that 'either x could be 0, and then it is changed into 1, or JC could be 1, and then it is changed into 0', which is a sound semantics of [ x : = x 0 l ] for a binary variable. Unlike the multiactions in the first line, the two-element multiactions in the second PBC expression are not singletons because [jc:=y] involves both variables, x and y. Each two-element multiaction should be interpreted as denoting two simultaneously executable accesses to these variables, one checking the value of j , the other updating the value of X. For instance, {fTo, yob) denotes the value of y being checked to be 0 and, simultaneously, the value of jc being changed from 1 to 0. The expressions for [x:=x 0 1] and [ x . ^ j ] given in (27) have corresponding Petri nets with respectively two and four transitions labelled by the corresponding multiactions, as shown in Figure 22. The Petri net corresponding to the declaration of JC involves action particles jCt^., where Xyuj is the conjugate of x ^ , which ensures that the net of a variable can be put in parallel with the net of an atomic action, and then both nets can be synchronised in order to describe a block. The net describing varjc: {0, 1} is shown in Figure 20 and - in abbreviated form in Figure 23. In the latter, it is arbitrarily assumed that the current value of x is 1, and thus the net contains a token on the corresponding place.
{^i}
{•rTo}
[.T:=.Tel]
{•roo- yoo}\ [{•rio- l/oojj | {-''oi. //u }j I {•^'^^^y^}}_
[•'•: = .«/]
Fig. 22. Petri nets representing [JC:=JC01] and [jc:=y].
Fig. 23. Part of the Petri net representing a binary variable x, ^[x^^]•
A unified model for nets and process algebras
937
0
[.T~.Tel]
varx:{().l}
"
[j-:=y]
Fig. 24. (Abridged) Petri net representation of a small program fragment.
What was just described is the principal use of conjugation in the PBC semantics of programming languages; we always assume that the command part of a block employs 'hatted' action symbols, while the declaration part uses their 'unhatted' (conjugated) versions in order to describe accesses to variables. A block will be described by putting command part and declaration part in parallel and then synchronizing and restricting (hence scoping) over all variables that are local to it. This leaves only non-local accesses to be still visible in the communication interface, i.e., in the transitions. In order to describe the block structure of the program fragment (with x being a local and >' global variable of the block), the net of varx : {0, 1} needs to be synchronised with the nets of [x:=jc 0 1] and [jc:=y]. For example, the transition labelled {xio} coming from the declaration of x is synchronised with the transition labelled {fTo. 5^} coming from the action [ x : = j ] using and consuming the conjugate pair (jcTb, ^lo) but retaining yoo (as we have already seen, this mechanism is built into the definition of synchronisation). The resulting transition has the label {yoo}. After that, all the transitions with labels containing x^v and Xuv action particles are removed by applying the PBC restriction operator, since the variable jc is not known outside its declaring block. The net of the block, obtained through synchronisation and restriction, is shown in Figure 24. This net describes the effect of actions on local variable x directly by its connectivity, and on global variable y indirectly through its labelling. The transitions labelled {y^i} can be synchronised again, e.g., with transitions labelled {yw} coming from the declaration of y in an outer block, using and consuming conjugate pairs (yrr,5Vi) and yielding transitions labelled by 0, after what is a 3-way synchronisation. During the translation process we have thus seen an effective application of the multiway synchronisation mechanism, in the modelling of an assignment involving two program variables which are declared in different blocks but accessed in the same atomic assignment. The details and formal treatment are in [11].
9. Conclusions Brief review of the results. In this chapter, we have knit a tight link between a processalgebraically inspired Structural Operational Semantics framework, and Petri nets and their
938
E, Best et ai
diverse semantics. In order to obtain our results, both had to be modified: the SOS framework has been brought closer to Petri nets by introducing structural similarity (Sections 2.1 and 6.2), and Petri nets have been made composable by using place and transition labellings (Section 3). We have shown how composable Petri nets can be understood both as elementary objects (plain boxes. Section 3.4) and as operators (operator boxes. Section 4.1) of a process algebra. We have defined an operation of net refinement (Section 4.3) which corresponds to the application of a process-algebraic operator to its arguments, and we have demonstrated that recursive net equations can be solved using net refinement (Section 5). Further, we have shown that in the presence of an additional property (namely factorizability, which distinguishes sos-operator boxes from other operator boxes. Section 6), the domain of composable nets has generic SOS rules (which are, more precisely, in de Simone format [1]); see Section 7. The main result states that there is an isomorphism between the SOS-semantics and net-semantics of the resulting algebra (Section 7.5). Thus, in order to test whether a given process algebra has a (safe) Petri net semantics which is equivalent with SOS rules, one has to check whether or not its constants and operators can be described by plain boxes and sos-operator boxes, respectively; or, alternatively, whether there is a translation into PBC, which is known to have this property (Section 8.1 to 8.4). And the equivalence extends to whatever semantics one wishes to consider, be it step sequences (Section 3.2) or partial orders (Section 7.4), be it either transition-based or label-based (Section 7.5). We have finally demonstrated this for CCS, TCSP, COSY and a concurrent language with data and blocks (Sections 8.5 and 8.6). Some carefully avoided problems. With the view of developing an equational theory - a modest approximation of which has been given in Section 8.3 -, it is tempting to investigate unit boxes for various common operators. Regarding the choice operator D , clearly the simplest ex-box ex = ex({^}, [x}) is a unit: £'iso(exD£')iso(£Dex). As for the parallel composition, it is clear that only the empty labelled net o, that is, the net having empty sets as its components, would be a unit for ||. (Note that we use o, rather than 0, to denote the empty net, since 0 is a name for the silent action in PBC.) Thus, we do not have a structural unit for parallel composition, since the empty box has been excluded from consideration by the requirement that boxes are ex-restricted (Section 3.4). The reason for this is that o creates serious problems in other contexts; for instance the sequence o; a is not safe, for any a, and allows an arbitrarily large step of concurrent «'s. Had we included the empty box o, the treatment of recursion would have become simpler on purely formal grounds, since o would then be the unique least element with respect to c (Section 5.1), and all approximations could have started with it as a seed. However, consider the recursive equation X = « D X. Using the empty seed as starting point, will allow X to make arbitrarily large a-steps. As this is counterintuitive, it makes sense also from a recursion point of view to exclude o. As for the sequential composition, we also cannot define a structural unit in the framework presented in this paper. However, consider an extension of the notion of a box by allowing a place to be both entry and exit at the same time, i.e., by extending the codomain
A unified model for nets and process algebras
939
of the labelling X on places from {e, i, x} (Sections 3.1 and 3.2) to {e, i, x, ex}. And then consider the box u consisting only of a place labelled ex and no transitions nor arcs. With a reasonable extension of the definition of net refinement, u will be a structural unit for sequential composition: EisoCu; £')iso(£'; u). Moreover, u has a very simple SOS rule u = u which is fully consistent with it being a unit for sequence. The extension just mentioned also allows the unary iteration (£")* to be expressed by an operator box, namely by the box which has a single place labelled ex, a single transition (to be refined by the argument E) and two arcs leading from the place to the transition and back. What is more, (£)* is a derived operator since (£)* can be expressed as (E D u), which is again consistent with the SOS rules for D and for u. Because the last property is very unusual, and in order not to complicate the definition of net refinement still further, and also since in all applications, the unary iteration plays a minor role (as opposed to iterations with initial commands, or terminal commands, or both, see also Section 6.3), it was decided not to consider this extension for the time being. In passing, it may be seen that due to the absence of an expansion law, a unit for parallel composition may well differ from a unit for sequential composition. In general, however, we agree with [5] that such units and their interplay deserve further study. Directions for future work. From the discussion of the previous section, it is apparent that the extension of A to ex, i.e., allowing places that are both entry and exit, is meaningful and should present only technical but no principal problems. A first step towards this aim is [ 13] where the definition of transition refinement has been extended to allow such labellings. Unfortunately, the inclusion of o seems to lead to more fundamental problems. Nevertheless, it may deserve some re-consideration, perhaps by further scrutinizing the definition of net refinement. There seems to be a further possibility for enlarging the class of allowable operator boxes without losing the essential SOS property. This would allow operators with internal memory, while in the present setup, all boxes are clean and therefore memoryless (Section 3.2). Finally, an interesting extension is to add real-time. The reader is referred to [36] for a first step in this direction. Acknowledgements The work described in this chapter has greatly benefited from cooperation with other people, in particular Javier Esparza, Jon Hall and Richard Hopkins. It has been supported by the Esprit Basic Research Project 3148 DEMON (Design Methods Based on Nets) and Working Group 6067 CALIBAN (Causal Calculi Based on Nets), as well as the AngloGerman Foundation ARC Project 1032 BAT (Box Algebra with Time). We also thank one reviewer of this paper for a number of comments, and the editors for their support. References [1] L. Aceto, W. Fokkink and Ch. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292.
940
E. Best et al
[2] J.C.M. Baeten and T. Basten, Partial-order process algebra (and its relation to Petri nets). Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 769-872. [3] J.C.M. Baeten and C. Verhoef, Concrete process algebra. Handbook of Logic in Computer Science S. Abramsky, D.M. Gabbay and T.S.E. Maibaum, eds, Oxford University Press (1995), 149-268. [4] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 18, Cambridge University Press (1990). [5] J. Bergstra, W. Fokkink and A. Ponse, Process algebra with recursive operations. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 333-389. [6] E. Best, Semantics of Sequential and Parallel Programs, Prentice Hall (1996). [7] E. Best, Partial order verification with PEP, Proc. POMIV'96, Partial Order Methods in Verification, G. Holzmann, D. Peled and V. Pratt, eds, American Mathematical Society (1997), 305-328. [8] E. Best and R. Devillers, Sequential and concurrent behaviour in Petri net theory, Theoret. Comput. Sci. 55(1988), 87-136. [9] E. Best, R. Devillers and J. Hall, The Petri box calculus: A new causal algebra with multilabel communication. Advances in Petri Nets 1992, Lecture Notes in Comput. Sci. 609, G. Rozenberg, ed.. Springer-Verlag (1992), 21-69. [10] E. Best, R. Devillers and M. Koutny, Petri nets, process algebras and concurrent programming languages. Advances in Petri Nets, Lectures on Petri Nets II, Applications, Lecture Notes in Comput. Sci. 1492, W. Reisig and G. Rozenberg, eds. Springer-Veriag (1998), 1-84. [11] E. Best, R. Devillers and M. Koutny, Petri Net Algebra, EATCS Monographs on Theoret. Comput. Sci., Springer-Verlag (20(X)), to be published. [12] E. Best, W. Fr^czak, R.P Hopkins, H. Klaudel and E. Pelz, M-nets: An algebra of high-level Petri nets, with an application to the semantics of concurrent programming languages. Acta Inform. 53 (1998), 813-857. [13] E. Best and A. Lavrov, Generalised composition operations for high-level Petri nets, Fundamenta Informaticae40(1999), 125-188. [14] G. Boudol and I. Castellani, Flow models of distributed computations, three equivalent semantics for CCS, Inform, and Comput. 114 (2) (1994), 247-314. [15] G.W. Brams (nom collectif de Ch. Andre, G. Berthelot, C. Girault, G. Memmi, G. Roucairol, J. Sifakis, R. Valette and G. Vidal-Naquet), Resaux de Petri, Theorie et Pratique, Vols. I and II, Editions Masson (1985). [16] G. Bruns and J. Esparza. Trapping mutual exclusion in the box calculus, Theoret. Comput. Sci. 153 (1995), 95-128. [17] I. Castellani, Process algebras with localities. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 945-1045. [18] B.A. Davey and H.A. Priestley, Introduction to Lattices and Order, Cambridge Mathematical Textbook (1990). [19] P. Degano, R. De Nicola and U. Montanari, A distributed operational semantics for CCS based on C/E systems. Acta Inform. 26 (1988), 59-91. [20] R. Devillers, Construction of S-invariants an S-components for refined Petri boxes, Proc. ICATPN'93, Lecture Notes in Comput. Sci. 691, M. Ajmone Marsan, ed.. Springer-Verlag (1993), 242-261. [21] R. Devillers, S-invariant analysis of general recursive Petri boxes. Acta Inform. 32 (1995), 313-345. [22] R. Devillers and M. Koutny, Recursive nets in the box algebra, Proc. CSD'98, International Conference on Application of Concurrency to System Design, IEEE Press (1998), 239-249. [23] W.J. Fokkink, Introduction to Process Algebra, Texts in Theoret. Comput. Sci., (EATCS Series), SpringerVerlag (2000). [24] H.J. Genrich, K. Lautenbach and PS. Thiagarajan, Elements of general net theory. Net Theory and Applications, Proc. Advanced Course on General Net Theory of Processes and Systems, Lecture Notes in Comput. Sci. 84, W. Brauer, ed.. Springer-Veriag (1980), 21-163. [25] U. Goltz, On representing CCS programs by finite Petri nets, Proc. MFCS'88, Lecture Notes in Comput. Sci. 324, M.P Chytil, L. Janiga and V. Koubek, eds. Springer-Verlag (1988), 339-350. [26] U. Goltz and R. Loogen, A non-interleaving semantic model for nondeterministic concurrent processes, Fundamentae Informaticae 14 (1991), 39-73. [27] U. Goltz and A. Mycroft, On the relationship of CCS and Petri nets, Proc. ICALP'84, International Conference on Automata, Languages and Programming, Lecture Notes in Comput. Sci. 172, J. Paredaens, ed.. Springer-Veriag (1984), 196-208.
A unified model for nets and process algebras
941
[28] U. Goltz and W. Reisig, The non-sequential behaviour of Petri nets. Inform, and Control 57 (1983), 125147. [29] J. Grabowski, On partial languages, Fundamentae Informaticae 4 (1981), 427^98. [30] J.G. Hall, An algebra of high-level Petri nets, Ph.D. Thesis, University of Newcastle upon Tyne (1996). [31] M. Hesketh and M. Koutny, An axiomatization of duplication equivalence in the Petri box calculus, Proc. ICATPN'98, Lecture Notes in Comput. Sci. 1420, J. Desel and M. Silva, eds. Springer-Verlag (1998), 165184. [32] C.A.R. Hoare, Communicating Sequential Processes, Prentice Hall (1985). [33] R. Janicki and RE. Lauer, Specification and Analysis of Concurrent Systems - the COSY Approach, EATCS Monographs on Theoret. Comput. Sci., Springer-Verlag (1992). [34] H. Klaudel and R.-Ch. Riemann, Consistent equivalence notion for a class of high level Petri nets, Proc. ISCIS, 11th International Symposium on Computer and Information Science, V. Atalay, U. Halici, K. Inan, N. Yalabik and A. Yazici, eds. Middle East Technical University, Antalya (1996), 7-16. [35] M. Koutny, Partial order semantics of box expressions, Proc. ICATPN'94, Lecture Notes in Comput. Sci. 815, R. Valette, ed., Springer-Verlag (1994), 318-337. [36] M. Koutny, A compositional model of time Petri nets, Proc. ICATPN'2000, Lecture Notes in Comput. Sci. 1825, M. Nielsen and D. Simpson, eds. Springer-Veriag (2000), 303-322. [37] M. Koutny and E. Best, Fundamental study: Operational and denotational semantics for the box algebra, Theoret. Comput. Sci. 211 (1999), 1-83. [38] RE. Lauer, Path expressions as Petri nets, or Petri nets with fewer tears. Technical Report MRM/70, Computing Laboratory, University of Newcastle upon Tyne (1974). [39] J. Lilius and E. Pelz, An M-net semantics for BPN~ with procedures, Proc. ISCIS, 11th International Symposium on Computer and Information Science, Antalya, V. Atalay, U. Halici, K. Inan, N. Yalabik and A. Yazici, eds. Middle East Technical University, (1996), 365-374. [40] A. Mazurkiewicz, Trace theory. Advances in Petri Nets 1986, Petri Nets, Applications and Relationships to Other Models of Concurrency, Part II, W. Brauer, W. Reisig and G. Rozenberg, eds. Lecture Notes in Comput. Sci. 255, Springer-Veriag (1987), 279-324. [41] R. Milner, A Calculus of Communicating Systems, Lecmre Notes in Comput. Sci. 92, Springer-Veriag (1980). [42] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [43] T. Murata, Petri nets: properties, analysis and applications, Proc. IEEE 77 (1989), 541-580. [44] E.R. Olderog, Nets, Terms and Formulas, Cambridge Tracts in Theoret. Comput. Sci. 23, Cambridge University Press (1991). [45] G.D. Plotkin, A structural approach to operational semantics. Technical Report n^J-19, Computer Science Department, University of Aarhus (1981). [46] W. Reisig, Petri Nets. An Introduction, EATCS Monographs on Theoret. Comput. Sci., Springer-Veriag (1985). [47] P.H. Starke, Processes in Petri nets, Elektronische Informationsverarbeitung und Kybemetik 17 (1981), 389-416. [48] D. Taubner, Finite representation of CCS and TCSP programs by automata and Petri nets. Lecture Notes in Comput. Sci. 369, Springer-Veriag (1989). [49] W. Vogler, Partial words versus processes: A short comparison. Advances in Petri Nets 1992, Lecture Notes in Comput. Sci. 609, G. Rozenberg, ed.. Springer-Veriag (1992), 292-303.
Subject index ^-tuple, 894
action particles, 882, 883, 923, 936
ACP, 881 action, 885 -redo, 890 - skip, 890
Behl-Beh5, 911 bisimulation -strong, 891 box, 884, 892
942 - dynamic, 893 - e-directed, 886 - entry, 893 - ex-directed, 887 - ex-exclusive, 893 - exit, 893 - factorizable, 906 - operator, 884 -plain, 884, 892 - rec-, 899 - seed, 900 - SOS operator, 906 - Static, 893 - x-directed, 886 box algebra, 912 - denotational semantics, 914 - independence relation ind"^^^, 921 - semantics - - label based, 922 - - partial order based, 921 - - transition based, 919 -signature, 912 - structural equivalence, 916 -syntax, 912 - transition trees, 919 box expressions, 913 cardinality of multiset, 880 causality, 889 CCS, 876 chain, 899 clean - marking, 888 - net, 888 cleanness, 888 communication interface operator, 883 complex marking, 888 constant -dynamic, 912 -exit, 912 - static, 912 constant boxes, 912 constant relabelling, 885 constants, 912 continuity, 900 control flow operator, 883 COSY, 876, 935 CSP, 934 defining equation, 913 denotational semantics, 914 derivability, 888 DIY algebra, 913 -constants, 914
E. Best et al. -denotational semantics, 915 - operational semantics, 918, 919 - similarity relation, 917 -syntax, 914 domain of application of sos-operator box, 908 duplication, 892 dynamic - box, 893 -constant, 912 -expression, 912 e-directed - box, 886 -expression, 914 enabled - step, 887 - transition, 877 entry -constant, 912 -expression, 912 - marking, 887 - place, 886 entry box, 893 equation -defining, 913 - front-guarded, 903 - guarded, 903 - rear-guarded, 903 event occurrence, 888 ex-box, 893 ex-directed - box, 887 ex-exclusive - box, 893 -expression, 914 - marking, 888 ex-restrictedness, 886 exit - constant, 912 -expression, 912 - marking, 887 - place, 886 exit box, 893 Exprl-Expr7, 914 expression -dynamic, 912 -e-directed, 914 -entry, 912 -ex-directed, 914 -ex-exclusive, 914 -exit, 912 -flat, 913 -static, 912, 925
A unified model for nets and process -well formed, 914 -x-directed, 914 factorizable box, 906 factorization - of a tuple of boxes, 906 - of a tuple of expressions, 913 fixpoint - positive, 902 full transition system - o f a net, 890 - of an expression, 921 global independence relation, 921 guardedness, 903 - front, 903 - rear, 903 handshake, 881 hatting, 881 identity relabelling, 885 independence relation, 888 -global, 921 initial marking, 877 internal place, 886 isomorphism of nets, 892 labelled net, 885 labelled step, 888 labelling function, 886 limit, 899 marked net, 887 marking, 877, 886 - clean, 888 - complex, 888 -entry, 887 -ex-exclusive, 888 -exit, 887 - initial, 877 - reachable, 877, 888 - safe, 877, 888 Mazurkiewicz traces, 888 monotonicity, 900 multiactions -LabpBc,883 multiset, 880 - cardinality, 880 - difference, 880 - inclusion, 880 - scalar multiplication, 880 - sum, 880
algebras
names of places and transitions, 894 net - behaviour, 877 - clean, 888 - derivable, 888 - ex-restricted, 886 - finite, 886 - isomorphism, 892 - labelled, 885 - marked, 887 - pure, 887 - safe, 877, 888 - simple, 887 - T-restriction, 886 - transition system tsjr, 890 - unmarked, 887 net refinement, 893 occurrence - of transitions, 877 operational semantics for box algebra, 919 operator - communication interface, 883 - control flow, 883 operator box, 884, 894 - SOS, 906
ordering - on labelled nets, 899 overbarring, 878 partial order, 879 PBC syntax, 925 place, 886 - entry, 886 - exit, 886 - internal, 886 - labelling, 886 plain box, 884 pure net, 887 reachability, 888 - graph, 889 reachable complex marking, 888 reachable marking, 877 rec-box, 899 recursion - variable, 899 redo, 890 relabelling - constant, 885 - identity, 885 - relation, 885 - restriction, 885 - transformational, 885
943
944 reversible transition, 906 safe - marking, 877, 888 - net, 877, 888 safeness, 888 seed box, 900 side loop, 887 similarity relation - for expressions, 916 simple net, 887 skip, 890 solution - of recursive equation, 899 sos-operator box, 906 - domain of application, 908 sos-operator boxes, 912 static - box, 893 -constant, 912 - expression, 912, 925 step, 887 - enabled, 887 - executed, 887 -labelled, 888 step sequence - finite, 887 strong - bisimulation, 891 -equivalence, 891
E. Best et al. T-restricted net, 886 TCSP, 877, 934 token in a marking, 877 transformational relabelling, 885 transition, 886 - enabled, 877 - labelling, 886 - occurrence, 877 - reversible, 906 transition system, 922 -full, 890,921 - of an expression, 922 - of net, 890 tree equations, 902 ts-isomorphism, 891 underbarring, 878 unmarked net, 887 variable - recursion, 899 weight function, 886 well formed -expression, 914 x-directed - box, 886 -expression, 914
CHAPTER 15
Process Algebras with Localities Ilaria Castellani INRIA, 2004 Route des Lucioles, 06902 Sophia-Antipolis, France E-mail: Ilaria. Castellani@ sophia. inria.fr
Contents 1. Introduction
947
2. An abstract view of locations
949
2.1. Noninterleaving semantics for process algebras
950
2.2. Motivation for location semantics
960
2.3. A language for processes with locations
962
2.4. Static approach
963
2.5. Dynamic approach
973
2.6. Equivalence of the two approaches
979
3. Extensions and comparison with other approaches
991
3.1. The local/global cause semantics
991
3.2. Comparison with other distributed semantics
995
3.3. Comparison with causal semantics
1000
3.4. Extension to the TT-calculus
1007
4. A concrete view of locations
1008
4.1. A concrete location semantics for CCS
1009
4.2. The location failure approach
1011
4.3. Combining locations and mobility
1013
5. Conclusions
1034
Acknowledgements
1036
References
1037
Subject index
1043
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
945
946
/. Castellani
Abstract Process algebras can be enriched with localities that exphcitly describe the distribution of processes. Localities may represent physical machines, or more generally distribution units where processes are grouped according to some criterion like the sharing of resources. In a concurrent process, localities are naturally associated with (groups of) parallel components. These localities then intervene in the semantics of processes and become part, to some extent, of their observable behaviour. In a first line of research, initiated in the early nineties, localities have been used to give noninterleaving semantics for process algebras, and particularly for Milner's calculus CCS. Here localities are used to differentiate parallel components. The resulting semantics, taking into account distribution, is more discriminating than the standard interleaving semantics of the calculus. It is also incomparable with other noninterleaving semantics proposed for CCS, based on the notion of causality. More recently, localities have appeared in a number of new calculi for describing mobile processes. The idea here is that some "network awareness" is required to model wide-area distributed mobile computation. In these calculi localities are more than simple units of distribution. According to the case, they become units of failure, of conmiunication, of migration or of security. This chapter reviews in some detail the first body of work, and tries to delineate the main ideas of the more recent studies, which are still, for the most part, at an early stage of development.
Process algebras with localities
947
1. Introduction The aim of this chapter is to review some estabhshed work on process calcuH with explicit locaUties or locations,^ as has been developed in the last decade by several authors [28, 29,5,118,38,116,171,117,119,49], as well as to delineate new directions of research in this area that have been spurred by the growing interest in calculi for mobile processes. The presentation will accordingly be structured in two parts: in the first (Sections 2 3) we shall present the more consolidated work on traditional process calculi, while in the second (Section 4) we will report more informally on recent proposals for combining locations and mobility. The emphasis, as well as most of the technical material, will be on the first part, where locations are used as a means to provide noninterleaving semantics for process algebras. The starting idea of the former work is that distribution is an important aspect of parallel systems and should somehow be reflected in their semantics. If systems are modelled in a process calculus equipped with a parallel operator, like Milner's calculus CCS [109,111], this can be achieved by assigning locations to parallel components and then observing actions together with the location at which they occur. Using these enriched observations, one obtains so-called distributed semantics for the language, which are more discriminating than the standard interleaving semantics. The aim of these distributed semantics is twofold: (1) give a measure of the degree of parallelism present in a system, and (2) keep track of the local behaviour of components within a system. While (1) can be useful for implementing a system on a given physical architecture, (2) allows for the detection of local properties, like a local deadlock or the dependence from a local resource. The above-mentioned papers are all based on the language CCS, and adopt semantic notions which are variants of the notion of bisimulation introduced by Park [126] and Milner [109]. However they differ for the various subsets of CCS they consider. They also vary according to the way locations are assigned to processes: whether statically, before processes are run ([5,118,38,119,116]), or dynamically as the execution proceeds ([28, 29]). We shall refer to the former as "static approaches" and to the latter as ''dynamic approaches". The static approaches are further distinguished by the way locations are observed. In [119,49] the identities of locations are significant and the resulting semantics is very concrete: processes are equated if they reside on the same set of locations and present the same behaviour at each location. In [5,38], on the other hand, locations are observed up to a concurrency-preserving renaming which is built incrementally along executions. Here the resulting semantics is more abstract, identifying processes which are bisimilar in the classical sense and whose computations exhibit the same degree of distribution and the same local behaviours. There is a little subtlety to note here, as processes presenting the same degree of parallelism in each run need not consist of the same number of parallel components. In the dynamic approach, which was the first to be developed [28,29], locations are associated with actions rather than with parallel components. They are built incrementally We shall use the two words interchangeably throughout the chapter.
948
/. Castellani
when actions are performed, and then recorded in the residual processes. Here the location of an action can be viewed as the history of that action in the component where it occurs. Clearly locations do not have the same intuitive meaning in the two approaches. In the static approach they represent sites, much as one would expect. In the dynamic approach, on the other hand, the location of an action is a record of its local causes, the actions that locally precede it. In spite of this difference in intuition, the dynamic and (abstract) static approach turn out to yield the same semantic notions of location equivalence and location preorder [5,38]. This means that observing distribution - in conjunction with the usual interleaving behaviour - is essentially the same as observing local causality. As mentioned previously, these location semantics emerged as particular noninterleaving semantics for process algebras. To provide some historical background. Section 2 will start with a brief survey of such noninterleaving semantics. A comprehensive presentation of the abstract location semantics, both static and dynamic, will then be given in Sections 2.22.5. The two approaches will be compared in Section 2.6. Instead, the description of the concrete model of [119,49,46] will be deferred to Section 4.1, as it fits more naturally with the more recent issues examined in that section. In Section 3 the abstract location semantics is compared with other distributed semantics (like distributed bisimulation [37,39,98], the local mixed-ordering equivalence of [116], and variants of them [47,48]), as well as with noninterleaving semantics based on causality (like causal bisimulation [51,52] and history preserving bisimulation [75,78,77]). This comparison will be mainly based on the papers [3,29,100]. In particular, we will recall in some detail the local/global cause semantics of [100], which incorporates distributed and causal semantics into a single framework. As it turns out, distributed semantics and causality-based semantics are orthogonal ways of accounting for the parallelism in systems, which only agree on the communication-free fragment of CCS, a class of processes also known as BPP (Basic Parallel Processes). At the end of Section 3 we present the extension of the location semantics of [29] to the TT-calculus, as proposed by Sangiorgi in [145]. An important result of this work is that the location machinery of [29] can be encoded into the standard TT-calculus, in such a way that the location semantics reduces to ordinary interleaving semantics. In Section 4.1, we describe the concrete approach of [119,49,46], where the identities of locations are fully observable. Observability of location names is also the standpoint adopted in most of the recent studies on languages for mobility and migration surveyed in Section 4.3. In Section 4.2, we report on subsequent work dealing with location failure and its detection [12,9,140]. This has been developed for extensions of CCS and the TT-calculus, with features for creating processes at remote locations, and for testing and killing locations. Contrarily to the previous line of work, here the emphasis is on location failure rather than distribution, and locations are only observable in case of failure. While the previous approaches assumed a global observer for the whole distributed system, here one adopts the perspective of an individual user, wishing to have transparent access to resources irrespective of where they are located. This is the so-called network transparency principle. Awareness of locations is only requested in case of failure: a process that has spawned activities at another location wants to be notified in case of failure of this location, in order to stop interacting with it and transfer activities to other locations. This kind of semantics is
Process algebras with localities
949
particularly appropriate for describing mobile applications in distributed systems, where it may be important to distinguish between a process executed locally and a process spawned at a remote location which is liable to failure. Finally, in Section 4.3, we discuss the use of locations in connection with mobility and migration in some more recent languages with explicit distribution like the distributed JoiN-calculus [71,69], the distributed jr-calculi of [141,92] and [149], the AMBIENT calculus [33], the SEAL calculus [161] and the language Nomadic Pict [150]. These languages address some aspects of large-scale distributed computation in a very explicit way. In particular, most of them abandon the network transparency assumption. For instance, in the AMBIENT calculus the details of routing for migrating processes must be exposed. Similarly, messages are explicitly routed in the distributed TT-calculus of [141,92] and in the SEAL calculus. In general, in these models, processes have to know the locations of other processes and resources in order to be able to interact with them. To conclude this introduction we could say that, while in the first approaches locations were treated simply as units of distribution, in these new languages they acquire additional meanings. For instance, in languages dealing with failure detection they become units of failure, in that the failure of a site entails the termination of all processes at that site. They constitute units of communication in languages with purely local communication, where processes have to convene in a common location in order to interact. In some languages supporting process migration locations are also units of mobility, in that the migration of a process from a location provokes the simultaneous migration of all processes placed at the same location. Finally, locations can be used as units of security, in the sense that a resource access request emanating from the location of the resource is not submitted to the same security checks as an external request. As their roles progressively accumulate, locations become more and more an integral part of the semantics of the language.
2. An abstract view of locations This section reviews the approach to abstract locations as described in [28,29] and [5,38]. Generally speaking, this work is concerned with distributed semantics for CCS, which account for the spatial distribution of processes among different sites or locations. Such semantics emerged from a line of research on noninterleaving semantics for process algebras, which started in the early eighties and developed at a steady pace in the subsequent decade. By "noninterleaving semantics" we mean a semantics that does not simulate parallelism by a nondeterministic choice of sequential interleavings. Typically, such reduction of concurrency to interleaving is expressed by Milner's expansion law [109], a simple instance of which is: a\b = a.b^b.a
(1)
where "|" and "." stand respectively for parallel and sequential composition, " + " for nondeterministic choice and ^, b are any (non-synchronizable) actions. This law is indeed valid for bisimulation equivalence, the standard behavioural equality for the calculus CCS. By contrast, semantic models that reject this equation and insist on treating concurrency as
950
/. Castellani
primitive are sometimes qualified as "true-concurrency" or "nonsequential" models. Such models mostly evolved from the early ideas of Petri [ 129]. Paradigmatic models of this kind are Petri nets [ 130,128,138], event structures [ 165,123,168] and Mazurkiewicz traces [ 106, 107]. Similar nonsequential models were studied by Shields [153] and Winkowski [164]. To provide some background for the coming material on location semantics, we shall start with a short review of this area of research, focussing on operational semantics for CCS. For a more comprehensive account, covering other process algebras like ACP [14] and the Petri Box Calculus, the reader is referred to the other chapters of Part 5 in this Handbook [17].
2.1. Noninterleaving semantics for process algebras We give here a brief introduction to noninterleaving operational semantics for process algebras. We concentrate on branching-time semantics based on variations of the notion of bisimulation, and will mostly restrict our attention to the calculus CCS. The search for operational semantics for process algebras accounting for the concurrent and causal structure of processes, started roughly around the mid-eighties. Previously, there had been a few proposals for interpreting languages like CCS, CSP and TCSP into nonsequential models for concurrent systems such as Petri nets [129,130,128] and event structures [165,123,168]. Among these early proposals, we will only mention those by Winskel [166], De Cindio et al. [45], and Goltz and Mycroft [83]. Many other interpretations of a similar kind were to be given in subsequent years, on variants of these models or on other semantic domains like asynchronous transition systems [15], causal trees [51], trace automata [13] and transition systems with independence [170]. For instance, Petri nets have been further used to give semantics for CCS-like languages by Goltz [83,85, 82], Winskel [167,169], Van Glabbeek and Vaandrager [80], Nielsen [122], Degano, De Nicola and Montanari [61], Degano, Gorrieri and Marchetti [57], Olderog [ 124,125], Taubner [154,155], Boudol and Castellani [27], Montanari and Gorrieri [86], Montanari and Ferrari [67], and others. Similarly, event structure interpretations have been proposed and studied, among others, by Winskel [167], Goltz and Loogen [105], Degano, De Nicola and Montanari [54], Vaandrager [159], Boudol and Castellani [23,24,27], van Glabbeek and Goltz [78,77], and Langerak [102]. Event-based models like Petri nets and event structures are built from the outset on the primitive notions of concurrency and causality between events, and therefore naturally provide a noninterleaving semantics for process calculi. The question was then to devise a purely operational semantics for processes, by means of labelled transition systems specified via structural rules (in the style advocated by Plotkin [133], see also [6]), which could express the same information about concurrency and causality. A natural idea was to generalize the labels of transitions, from simple actions to whole partial orders of actions representing nonsequential computations. The representation of concurrent computations as partial orders, where the ordering stands for causality (and the absence of ordering for concurrency), was already standard in nonsequential models like Petri nets, event structures and Mazurkiewicz traces, where these partial orders were called respectively abstract processes [84,137], configurations and dependency graphs.
Process algebras with localities
951
When dealing with process algebras, a simple way to achieve this generalization of actions is to extract the information about concurrency and causality from the syntax of the terms themselves. More precisely, one looks for structural semantic rules by which the constructs of sequential and parallel composition are directly transferred from the terms to the actions labelling their transitions. This idea was successfully applied in [23] to a simple CCS-like language with sequential composition and disjoint parallel composition (not allowing communication): using the notion of partially ordered multiset,^ studied by Grabowski [88], Pratt [134,135] (who coined for it the term "pomset") and Gischer [73], a definition of pomset transition was introduced in [23] for this language, with the associated notion of pomset bisimulation. This new notion of bisimulation distinguishes the two processes of Equation (1) because the first has a pomset transition a I b —> nil \ nil which the second cannot simulate. The second process has two possibilities for executing a and b in one step, but in each case the two actions are ordered. One of these pomset transitions is a.b -\- b.a —> nil. To generalize the pomset semantics to the full language CCS [24], on the other hand, it appeared necessary to use an indirect construction of a pomset transition starting from a class of permutation-equivalent transition sequences.-^ This construction "a posteriori" of a partial order from an equivalence class of sequences is similar to the synthesis of a partial order from a Mazurkiewicz trace [107]. The main novelty of [24] was the use of enriched transitions for CCS called proved transitions (because they were labelled with a representation of their/7ro6>/in the inference system of CCS), from which the concurrency relation between transitions could be derived by syntactic means. For instance, a sequence of proved transitions for the process a \ b is a\b^nil\b^
nil \ nil.
These two transitions are concurrent because they are extracted from two different sides of the parallel operator (i.e., they are inferred using different rules for |), and this information is recorded in their labels. The transitions can therefore be commuted and the pomset corresponding to the equivalence class of this sequence is a \ b. On the other hand the process a.b-}- b.a has the sequence of proved transitions
a,b +
b.a^b-^nil
where the two transitions cannot be commuted, hence the corresponding pomset is a.b. - Or pomset, a generalization of the notion of partial order, which is necessary to deal with homonymous actions in computations. Formally, pomsets are defined as isomorphism classes of labelled partial orders. ^ This is because the class of pomsets is not closed with respect to parallel composition when communication is allowed.
952
/. Castellani
Indeed, the permutation semantics of [24] extends the pomset semantics of [23] and can be applied to more interesting examples. For instance the process {a.y \ y.b), where y and y are two synchronizable actions, can do the sequence of proved transitions a.y \y.b^y\
y.b ^ ^
nil \ b ^
nil \ nil
Here the two transitions a and b, although marked as concurrent by their labels, cannot be commuted because they are not adjacent. The pomset generated by this transition sequence is a.T.b (where r represents a generic communication action). Indeed, the communication between y and 7 creates a cross-causality between the actions a and b. Note that while in the direct pomset semantics of [23] atomic actions are replaced with composite actions representing whole nonsequential computations, in the proved transition semantics actions remain atomic but are decorated with additional information that identifies them uniquely in a term. Pomset transitions are retrieved only in a second step. Indeed, these two proposals by Boudol and Castellani exemplify two different ways of structuring actions: either relax atomicity of actions so as to obtain compound actions, or retain portions of their proof in order to pinpoint their identity - we shall speak in this case of decorated {atomic) actions. Another track for defining noninterleaving semantics for process algebras was to structure the states - rather than the actions - of the transition system, so as to mark the components responsible for each action. This led first to Degano and Montanari's model of concurrent histories [58], concrete computations with structured initial and final states, which could be concatenated while keeping the causality information. From these computations a partial ordering of actions could then be abstracted away. This model was used by Degano, De Nicola and Montanari to define a partial ordering semantics for CCS in [59, 56]. Here the causality relation on actions is recovered by decomposing each CCS process into a set of sequential components called grapes, and by causally connecting only those successive actions that originate from the same component. For example the process a \ b is decomposed into two components a \ id and id \ b (here the markers | id and id \ are used to specify the access paths of components inside a term, and therefore to identify them throughout a computation"^). We have here a computation [a I id, id \ b} - ^ {nil \ id, id \ b} - ^ [nil \ id, id \ nil} where actions a and b can be seen as emanating from different components and hence are not causally related.^ On the other hand the process a.b-\- b.a has only one component, itself. The computation in this case is
{a.b-i-bM}-^{b}-!^{nil}. ^ Just like the markers |o and 11 are used to identify occurrences of actions in proved transitions. ^ This is a shghtly simphfied rendering of the semantics of [59]. As a matter of fact, also actions were enriched in [59,56] - with a portion of their proof - but this information was somehow redundant, in particular it was not used to derive the partial order computations.
Process algebras with localities
953
Here actions a and b originate from the same component and thus are causally related. The resulting partial order semantics is the same as that derived from the previously mentioned proved transition systems [24]. In both cases a partial order computation is obtained from a sequential computation together with a relation on transitions (a causality relation here, and a concurrency relation in [24]). On the other side, the same idea of structuring states led Castellani and Hennessy to the definition of distributed transition systems [37,39], where transitions have distinct local and concurrent residuals:^ that is to say, transitions p —^ p' are replaced by transitions of the form p - ^ (/7^, p[), where p[ is what locally follows the action a while p[. is what is concurrent with it. A notion of distributed bisimulation, acting separately on the two residuals, was then proposed to compare these systems. For the two processes of our running example, the distributed transitions would be'^ a\b-^ a.b^-b.a-^
{nil b) (b^nil)
and the distributed bisimulation would tell them apart since the residuals are not pairwise equivalent. It should be pointed out that no partial order computation was synthesized here. Indeed this particular semantics, which will be reviewed in some detail in Section 3.2, departed somehow from the main line of research at the time, which aimed at defining partial ordering transitions. It was the first attempt at a distributed semantics, emphasizing local behaviours rather than the global causal behaviour. Unfortunately this distributed semantics was defined only for a subset of CCS without the restriction operator, and its extension to the whole language, investigated by Kiehn in [98], appeared to be difficult. Indeed, the very idea of splitting terms into parts and observing these parts separately did not seem fully compatible with global operators such as restriction. The partial ordering approach of [59] was pursued in subsequent works by Degano, De Nicola and Montanari [54,61], where the grape semantics was adapted in various ways to match more closely event structure and Petri net interpretations for CCS. The same authors presented a different formulation of a partial ordering semantics for CCS in [60], based on a tree-model called Nondeterministic Measurement Systems (NMS). By applying so-called observation functions to NMS's, different equivalence notions could be obtained, among which a partial ordering equivalence called NMS-equivalence, which turned out to be unrelated to pomset bisimulation.^ Another rather original tree-model that was put forward in the late eighties, with the express purpose of reconciling the interleaving and partial order approaches, was Darondeau and Degano's model of causal trees [51,52]. These are a variant of Milner's synchronization trees, where labels of observable transitions carry an additional element representing the set of causes of the corresponding action. More precisely, these labels are of the form This was the original formulation reported in [37]. An alternative fonnulation in terms of local and global residuals was considered in [39], as it seemed better suited to deal with the full language CCS. •^ To be precise the first transition should ht a \b - ^ {nil, nil j /?), but we are keeping deliberately informal here. Examples showing the incomparability of the two equivalences are given by Goltz and van Glabbeek in [75] and [79].
954
/. Castellani
(a, K), where K is an encoding - in the form of backward pointers in the tree - of the actions that causally precede «. The bisimulation associated with these new transitions, called causal bisimulation, was of course stronger than the usual bisimulation, but also stronger than pomset bisimulation and NMS-equivalence. It may be noted that in causal trees, the causal information is recorded in both the states (nodes) and the actions. In fact, this model illustrates a further way of decorating atomic actions, with parts of their computational history rather than parts of their proof. The initial criterion for these noninterleaving operational semantics for CCS was their agreement with "denotational semantics" given by interpretations into event based semantic domains like event structures and Petri nets. Besides the above-mentioned papers [54, 61], which show the consistency of the grape operational semantics with interpretations of terms into prime event structures and condition/event systems, we can mention also [24, 25], where the pomset semantics is shown to agree with an interpretation of processes into more general event structures, and the work by Olderog [124], where a Petri net semantics for the language CCSP (a mixture of CCS and TCSP) is derived operationally. In [27] the results of [24,25] are extended to Petri nets and asynchronous transition systems. A correspondence between (a variant of) the proved transition semantics and an interpretation of processes as trace automata is given by Badouel and Darondeau in [13]. As it were, the search for denotational interpretations of process algebras gave a new impulse to the study of semantic domains, and led to the definition of specific classes of event structures and nets, such as bundle event structures [102] and^ow event structures [25,40],^ flow nets [26], and A-free event structures [53]. Following the approach of Winskel [167], many of these denotational models had been meanwhile uniformly formalized in a categorical framework, which facilitated their analysis and comparison: several correspondence results between the various models, including Mazurkiewicz traces and transition systems with independence, could be established in this setting [170].'^ We refer to this work and to [147] for a comprehensive survey of such categorical models and their relationships. The unification of models of concurrency into a common algebraic framework had also been a central concern of Ferrari and Montanari's work [65,67]. In the late eighties, a new criterion for assessing equivalences emerged in connection with the issue of action refinement. Here, in accordance with the methodology of stepwise refinement, one wishes to allow for a gradual specification of systems by successive refinements of atomic actions into more complicated behaviours. Then, to be applicable along such top-down design of systems, equivalence notions are required to be preserved under action refinement. This means that two equivalent processes should remain equivalent after replacing all occurrences of an action a by a process r(a). AX first, this new criterion appeared to be a further argument in favour of ''true concurrency" semantics, since all the existing interleaving semantics failed to satisfy it. For instance, as mentioned earlier, the standard bisimulation equivalence ^ satisfies the expansion law a\b "^ a.b + b.a. '^ The correspondence in [170], as in most other cases, is given by the isomorphism of the computation domains of the models, while in [27] the correspondence between the three considered models was tighter, amounting to the equality of the famihes of computations.
Process algebras with localities
955
On the other hand, if action a is refined into the process «i .(72, the equahty no longer holds a\ .a2\ b ^ a\ .ai-b + b.ax.ai since after performing a\ the first process can choose between ai and b, while the second cannot. On the basis of this example, the use of partial ordering semantics was advocated by Castellano, de Michelis and Pomello as more appropriate for dealing with action refinement [41]. However, in reaction to this position Goltz and van Glabbeek showed that none of the existing branching-time partial order equivalences was preserved by refinement [75,76]. In particular pomset bisimulation and NMS equivalence•' were not invariant under refinement. In conclusion it was proved that a finer equivalence called history preserving bisimulation - first proposed by Rabinovitch and Trakhtenbrot [136] under the name BS-equivalence (Behaviour Structure equivalence) and then reformulated for event structures by Goltz and van Glabbeek - was indeed preserved by refinement. This result was first proven in the setting of prime labelled event structures for a restricted form of refinement [75], and subsequently extended, for more general forms of refinement, to flow and stable event structures [78,77,79], and finally to configuration structures [79]. Well before the start of this debate on refinement, Hennessy had proposed in a somewhat confidential publication [89] a semantics for CCS taking into account beginnings and endings of actions, and studied the corresponding bisimulation. This equivalence, later called split bisimulation, was reproposed in [90] in a slightly updated form and subsequently studied by Aceto and Hennessy [7,8] as well as other authors. It appeared to be closely related to another equivalence, not conceived for true concurrency but for real-time, introduced by van Glabbeek and Vaandrager in [80] and named ST-bisimulation}^ While ST-bisimulation is preserved by refinement [74], split bisimulation is only preserved by refinement on a subset of CCS [7,81]. Thus ST-bisimulation appeared to be the weakest strengthening of ordinary bisimulation which would be a congruence with respect to refinement. However, since this equivalence is not generally agreed to properly reflect causality (see [79]), it could not be adopted as a representative for partial order semantics. Meanwhile, refinement had been studied in the setting of Petri nets [162] and causal trees [53],'^ and history preserving bisimulation had been shown to coincide with concurrent bisimulation [19] on nets, and with causal bisimulation [3,53] on causal trees. In [3] Aceto also showed the coincidence of causal bisimulation with the mixed-ordering equivalence of Degano et al. [55]. These results further consolidated the status of history preserving bisimulation as the best candidate equivalence when both causality and refinement are of concern [79]. It should be pointed out, however, that only the strong version of this equivalence was studied, taking into account internal actions as well as visible ones. This is because the weak version of history preserving bisimulation would not be preserved by ' ' Which also coincides with an equivalence proposed by Devillers [63], called weak history preserving bisimulation by Goltz and van Glabbeek [75]. '- This equivalence is finer than split bisimulation in that it matches action endings with specific beginnings, but it coincides with it on systems without autoconcurrency (i.e., concurrency between actions of the same name). '-^ In fact, refinement was prevalently studied as a substitution operation on the semantic domains used to interpret terms {semantic refinement) rather than on the languages themselves (syntactic refinement). Among the abovementioned papers, only [7] and [8] give a syntactic treatment of refinement. For other references see [87].
956
/. Castellani
refinement - as is the case, in fact, for most weak equivalences.'"* For more about history preserving bisimulation and the question of action refinement, we refer the reader to [2,79] and to [87]. Most of the noninterleaving semantics reviewed so far are based on the notion of causality, and can therefore be quahfied as causal semantics. By contrast, distributed semantics focus on the local behaviour of parallel components and aim at capturing local dependencies. As mentioned earlier, the distributed bisimulation semantics of Castellani and Hennessy [37,39], initially defined for a subset of CCS without the restriction operator, appeared to be hard to extend to the whole language. The problem can be illustrated by a simple example, where the restriction operator \y has the effect of forcing actions y and Y to occur simultaneously (and unobservably). Consider the process: p = (a.b.y
\y.c)\y.
Suppose action a is performed. Then, what should be its local and concurrent residuals? Clearly, distributing the restriction operator over the two residuals would unduly limit their behaviour: if we let p = (a.b.y \ 'y.c)\y - ^ {ib.y)\y, (y-c)\y), then the second residual would be equivalent to nil, and the whole process p would be equivalent to a.b, which is not what we expect. A variant of this example shows that we could also make unwanted distinctions between processes. Let q =: (a.y.b \ y)\y. Then q should be equivalent to a.b, since in both cases actions a and b occur in sequence at the same location. However a transition q = (a.y.b \ 'y)\y -^ {(y-b)\y, y\y) would yield a local residual equivalent to nil, and therefore distinguish q from a.b. The other naive solution would be to "resolve" the restriction by transforming restricted actions into unobservable r-actions in the residuals. Again, this would lead to unwanted identifications and distinctions. For instance, we would have in this case a transition p = (a.b.y I y.c)\y - ^ {b.z, z.c) and p would behave like the process (a.y.b \ y.c)\y, where action c can occur before action b. On the other hand, the process (a \ y.b)\y, which should be equivalent to just a, would be equated with (a.y | y.b)\y. In fact, it is not clear how to distribute an encapsulation operator such as restriction without losing information about its scope, which is crucial to determine both the local and the overall behaviours. For this reason, subsequent studies on distributed bisimulation tended to keep the residuals in their context (while marking them in some way) rather than observe them in isolation. The alternative formulation in terms of local and global residuals studied in [39] was a first step in this direction. It did not seem sufficient, however, to overcome the above-mentioned difficulties. Indeed, the later work by Kiehn [98] showed that in the presence of the restriction operator even rather ingenious reformulations of the semantics failed to capture some desired operational distinctions (the later variant considered by De Nicola and Corradini in [48], while getting around Kiehn's counterexample, still suffered from the same drawback). A few years later, a fresh attack on the problem was resumed with the location semantics of Boudol, Castellani, Hennessy and Kiehn [28,29]. The idea here was to insert locations '"* In [8], Aceto and Hennessy studied a weak equivalence which is preserved by refinement. However this is essentially a weak ST-bisimulation equivalence.
Process algebras with localities
957
into processes and observe actions together with the location at which they occur. In the initial work [28,29] locations are created dynamically for actions when they are executed, and then recorded in the derivative process. The assignment of locations is such that concurrent actions have disjoint locations, while actions from the same component have related locations (one is a sublocation of the other). For instance the process a \ b has a sequence of transitions a\b-j^i::nil\b^i::nil\k::nil where actions a and b occur at different locations. On the other hand the process «./? + b.a has transitions a.b-\-b.a-f>l::b-^l::k::nil where the location of Z? is a sublocation of that of a. Note that the idea underlying this semantics is a natural generalization of that of splitting residuals: every component which becomes active is marked with a location which will distinguish it from any other component running in parallel. Based on this new transition system, notions of location equivalence ^t and location preorder £ ^ were introduced. The equivalence ^t formalizes the idea that two processes are bisimilar, in the classical sense, and moreover are equally distributed and have the same local behaviours in each computation. Formally ^i is just the ordinary bisimulation associated with the new transition system. It can be easily seen, looking at the transitions above, that aI
b^ia.b-\-b.a.
This is expected since the first process is distributed among two different locations while the second is confined within one location. The location preorder £ , on the other hand, relates a process with another which is bisimilar but possibly more distributed. Technically, the locations of the second process are required to be subwords of the locations of the first. For example a.b-i-b.a
^^a\b.
Again, this is expected because the first process is less distributed than the second. In two subsequent papers, Aceto [5] and Castellani [38] proposed an alternative approach where locations are assigned statically to parallel components, and observed modulo a concurrency-preserving renaming. This approach, although closer to the intuition, had been initially abandoned in favour of the dynamic one because of some technical difficulties it presented. In the static approach, processes are given an explicit distribution before they are executed, by inserting locations in front of parallel components. For instance, two distributions for the processes a \ b and a.b-\-b.a would be l::a\k::b
and
a.b-\-b.a
958
/. Castellani
where I and k are distinct locations, and processes with no exphcit location are supposed to be placed at the location e of the overall system. The semantics then simply exhibits the locations along transitions. For instance l::a\k::b-j^l::nil\k::b-Y>e:: a.b +
nil \ k :: nil
bM-^b-^nil. s
e
Notions of location equivalence and preorder are now redefined in this setting. An immediate observation is that one cannot require here equality of locations. Otherwise one would distinguish processes like a\ {b\c) and (a \ b) \ c, whose distributions are of the form l\::a\
kx :: {l\ :: b \ k\ :: c)
and
ti:: (£; :: a\k'2'.:b)\ ko :: c.
The idea is then to compare transitions modulo particular associations of their locations. For this example the required association would be: {(^1,^2^7), (^1 ^^^2^2^' (^1 ^ ' P ^ 2 ) } Interestingly the two semantics, dynamic and static, yield the same notions of location equivalence and preorder, in spite of the fact that locations reflect different intuitions in the two cases. In the static case locations represent sites, while in the dynamic case they represent local causes for an action. Indeed, in the static case locations may be seen as part of the proof of a transition, in the sense explained earlier, while in the dynamic case they are part of its computational history. We shall not enter in further details here, since the location semantics will be presented in detail in the next section. Let us just mention that this semantics consistently extends the distributed bisimulation semantics of [39], while being in general incomparable with the causality-based semantics discussed earlier.' ^ It therefore offers an interesting complementary point of view about observing parallelism in processes. Semantics based on static locations were investigated also by other authors. In [118] an equivalence analogous to that of [38] was studied by Mukund and Nielsen for a class of asynchronous transition systems modelling a subset of CCS with guarded sums. It was conjectured to coincide with the dynamic location equivalence of [29], a result that could later be subsumed from those of [38]. A transition system for CCS labelled with static locations, called spatial transition system, was considered by Montanari and Yankelevich in [116,171,117]. In this latter work, however, location transitions are only used as a first step to build a second transition system, labelled by local mixed partial orders (where the ordering is a mixture of temporal ordering and local causality), which is then used to define the behavioural equivalence. This equivalence, a variant of the mixed-ordering equivalence of [55] called local mixed-ordering equivalence, was shown to coincide with location equivalence [171]. The view of location equivalence as capturing local causality was further substantiated by the work of Kiehn [100], who characterized it as a variant of causal bisimulation called local cause bisimulation. In the same spirit, in [38] location equivalence was presented as a local history preserving bisimulation. The first characterization ' ^ Except on the finite fragment of CCS without communication, where the location semantics coincides with the causal semantics of [51] and [75].
Process algebras with localities
959
was carried out within Kiehn's local/global cause transition system, an enriched transition system which unifies distributed and causal semantics into a single framework, thus shedding light on their relationship. In afterthought, the convergence of these three new formulations of location equivalence was somehow expected since their ^'global" counterparts (mixed-ordering equivalence, causal bisimulation and history preserving bisimulation) were known to coincide from Aceto's work [3]. A more concrete view of localities was proposed by D. Murphy in [119] (and later extended to unobservable transitions by Corradini and Murphy in [49]), for a subset of CCS with only top-level parallelism. Here again localities are assigned statically to parallel components. The main difference with respect to the other static approaches is that the names of localities are significant here, and processes are considered equivalent only if they reside on the same set of localities and present the same behaviour at each locality. The interest here is centered on implementing a system on difixednetwork of processors, while in the previous cases the notions of local behaviour and degree of distribution where expressed somewhat abstractly. For instance the two distributed processes {l\\a\k\:b)
and
{l:\b\k
v. a)
are distinguished in Murphy's semantics, while they are equated in the other static location semantics. More recently, Corradini and De Nicola have reformulated in [48] both the dynamic location equivalence and a variant of Kiehn's extended distributed bisimulation [98] within the grape semantics of [56]. Kiehn's extended distributed bisimulation was known to be weaker than location equivalence from [28] and [29]. While exploiting some of Kiehn's ideas, Corradini and De Nicola propose here a slightly stronger equivalence, which however still fails to recover the full power of location equivalence. We conclude our review of noninterleaving semantics with a remark about structured actions and states. The idea of decorating atomic actions with (portions of) their proof to obtain more expressive semantics for CCS culminated on one side in the above-mentioned proved transition systems [24,27], and on the other side in Montanari and Ferrari's structured transition systems [65,67,68]. In the first model only actions are structured while in the second both states and transitions are structured.'^ Both these transition systems retain in some sense a maximal information about the structure of the underlying terms, which can be weakened in various ways to obtain specialized semantics like pomset or distributed semantics. For instance the structured transitions of [67] are interpreted through a mapping into an algebra of observations, and the associated notion of bisimulation is parameterized with respect to the choice of the algebra. Similarly, proved transitions were exploited by Degano and Priami in [62] to obtain different semantics for CCS. Here, in order to capture the causal bisimulation semantics of [51], the authors use a simpler model based on derivation trees - called proved trees - rather than the more general proved transition systems discussed earlier. '^ In [27] a generalization of the proved transition system called event transition system is considered, where also states are structured in order to represent partially executed terms: like the causal trees of Darondeau and Degano and Kiehn's local/global cause transition system, these systems incorporate information about the computational history of processes, and this information needs to be recorded in the states in order to be correctly propagated along the transitions.
960
/. Castellani
2.2. Motivation for location semantics In this section we introduce the abstract location semantics proposed in [28,29] and [5, 38], by means of simple examples. These will be described using CCS notation (formally introduced only in the next section), which should be accessible to the unfamiliar reader with the help of comments and pictures. The distributed structure of CCS processes can be made explicit by assigning different locations to their parallel components. This can be done using a location prefixing construct /::/?, which represents process p residing at a location /. The actions of such a process are observed together with their location. We have for instance (l::a\k::b)-j>
(I::nil\k::b)-j^(l::nil\
k ::nil).
In CCS, paralleUsm is not restricted to top-level. It may also appear after the execution of some actions, in which case it is best viewed as difork operation, a future activation of two processes in parallel. Then the locations of actions will not be simple letters /,/:,... but rather words u=l\ '•- In, and a "distributed process" will perform transitions of the form p - ^ /7^ For instance, if the process (/:: a | /::: /?) is a component of a larger process, we will have I':: c.{l ::a\k::b)\k'::d
-jr> I' ::{l::a\k -ff
:: b) \k' v.d
l'::(l::nil\k::b)\k'::d.
Let us consider a more concrete example, taken from [28]. We may describe in CCS a simple protocol, transferring data one at a time from one port to another, as follows: Protocol <= (Sender | Receiver)\a, fi Sender ^ Receiver ^
in.a.p.Sender a.out.p.Receiver,
where a. represents transmission of a message from the sender to the receiver, and ^ is an acknowledgement from the receiver to the sender, signalling that the last message has been processed. In the standard theory of weak bisimulation equivalence, usually noted ^ , one may prove that this system is equivalent to the following specification PSpec <= in.out.PSpec. That is to say, PSpec ^ Protocol. The reader familiar with the (weak version of) causal bisimulation ^c of [51],^^ which is a strengthening of ^ , should also be easily convinced that PSpec ^c Protocol: intuitively, this is because the synchronizations on or, fi in Protocol create "cross-causalities" between the visible actions in and out, constraining them to happen alternately in sequence. ^^ This equivalence will be reviewed in Section 3.3.
961
Process algebras with localities
In a distributed view, on the other hand, it would be reasonable to distinguish these two systems, because PSpec is completely sequential and thus performs the actions in and out at the same location /, what can be represented graphically as follows
in
out
while Protocol is a system distributed among two different localities l\ and h, with actions in and out occurring at l\ and I2 respectively. Thus Protocol may be represented as
out
Here the unnamed hnk represents the communication lines a, )S, which are private to the system. We shall see that PSpec and Protocol will not be equated in the location semantics. On the other hand they will be related by a weaker relation, a preorder that orders processes according to their degree of distribution. Let us consider another example, taken from [29], which describes the solution to a simple mutual exclusion problem. In the system Mutex, two processes compete for a device, and a semaphore is used to serialize their accesses to this device Mutex <= {Proc \ Sent \ Proc)\{p, v} Proc ^ ^.enter.exit.V.Proc Sem <= p.v.Sem. As a distributed system, Mutex can be pictured as follows, where l\ and I2 are again two distinct locations (the location of the semaphore is left implicit, since all its actions are unobservable)
enter exit
Take now a variant of the system Mutex, where one of the processes is faulty and may deadlock after exiting the critical region (the deadlocked behaviour being modelled here as
962
/. Castellani
nil). This system, FMutex, may be defined by: FMutex <= (Proc \ Sent \ FProc)\{p, v] FProc <= ^.enter.exit.(v.FProc -\-v.nil) where Proc and Sent are defined as above. In the standard theory of weak bisimulation, the two systems Mutex and FMutex are equivalent. Indeed, they are both observationally equivalent to the sequential specification: MSpec ^ enter.exit.MSpec. Again, we could argue that these systems should be distinguished in a distributed semantics. Note that FMutex has a distributed representation similar to that of Mutex, with FProc replacing the second occurrence of Proc. Then Mutex and FMutex should have different behaviours, because FMutex may reach a state in which no more actions can occur at location /2, while this is not possible for Mutex. In other words, there is a local deadlock at location I2 in FMutex, which has no counterpart in Mutex. Moreover, both systems should be distinguished from the specification MSpec, because both have activities at distinct locations, while MSpec is confined to a single location. Note that a causal semantics would not help in this case either: we have Mutex ^c MSpec ^c FMutex because the synchronization on /?, u in Mutex and FMutex create cross-causalities between the critical regions of the two competing processes. We shall now proceed to a formalization of these intuitions. In the next two sections we present the static approach to location semantics, as has been proposed in [5,38].
2.3. A language for processes with locations We introduce here a language for specifying processes with locations, called LCCS. This language is a simple extension of CCS, including a new construct to deal with locations. We start by recalling some conventions of CCS [ 109,111 ]. One assumes a set of names A, ranged over by a, p,..., and a corresponding set of co-names A=^{a\a e A}, where ~ is a bijection such that a — a for all a € Z\. The set of visible actions is given by Act = AU A. Invisible actions - representing internal communications - are denoted by the symbol T ^ Act. The set of all actions is then Actr =def Acr U {r}. We use a, ^, c , . . . to range over Act and /x, y , . . . to range over Actj. We also assume a set V of process variables, ranged over by X, y In addition to the operators of CCS, the language LCCS includes a construct for building processes with explicit locations. Let Loc, ranged over by / , / : , . . . , be an infinite set of atomic locations. The new construct of location prefixing, noted /:: p, is used to represent process p residing at location /. Intuitively, the actions of such a process will be observed to occur "within location /". The syntax of LCCS is as follows: p ::= nil \ fi.p \ (p \q) \ (p-\-q) \ p\ot \ p{f) \ x \ recx. p \ I:: p.
Process algebras with localities
963
Apart from / :: p, all the other constructs are borrowed from CCS. They are: the empty process nil, action prefixing ix.p (a simplified form of sequential composition), parallel composition p \ q, nondeterministic choice p-{-q, restriction p\a, relabelling p{f)^^ and recursion recx. p. The intuitive meaning of these operators is as follows: nil represents the terminated process; fx.p is a process that performs action /x and then behaves like p\ {p \q) represents the concurrent execution of p and q, with possible communication; (p-\-q) behaves like any of p and q, discarding the other; p\a behaves like p but with the use of actions a, a restricted to internal communications; p{f) behaves like p with all its actions relabelled by / , where f :Actr -> Actr is a function preserving complementation and T-actions. Finally, recx. p denotes a distinguished solution of the recursive equation X = p. As usual, we shall omit trailing occurrences of nil in terms, writing for instance a.^ instesLd of a.b.nil. The basic idea of the semantics is that the actions of processes are observed together with the locations at which they occur. In general, because of the nesting of parallelism and prefixing in terms, the locations of actions will not be atomic locations of Loc, but rather words over these locations. Thus general locations will be elements u,v ... of Loc*, and processes will be interpreted as performing transitions p - ^ p', where /x is an action and u is the location at which it occurs.
2.4. Static approach We start by presenting an operational semantics for LCCS based on the static notion of location, as described in [3,38]. The idea of this semantics is very simple. Processes of LCCS have some components of the form /:: p , and the actions arising from these components are observed together with their location. The distribution of locations in a term remains fixed through execution. Location prefixing is a static construct and the operational rules do not create new locations; they simply exhibit the locations which are already present in terms. Formally, this is expressed by the operational rules for action prefixing and location prefixing. Recall that locations are words M, u , . . . G Loc*. The empty word e represents the location of the overall system. The rules for fi.p and I:: p SLTC respectively: (51) (52)
p^.p-^.p. p^sP'
^
iv.p-^siy.p'^
Rule (SI) says that an action which is not in the scope of any location / is observed as a global action of the system. Rule (S2) shows how locations are transferred from processes to actions. The rules for the remaining operators, apart from the communication rule, are similar to the standard interleaving rules for CCS, with transitions - ^ . s replacing the usual transitions - ^ . '^ Here we adopt the slightly nonstandard notation p{f) for the renaming operator of CCS, as the notation p{f] will be used for renaming of locations later on.
964
/. Castellani
The set of rules specifying the operational semantics of LCCS is given in Figure 1J ^ The rule for communication (S4) requires some explanation. In the strong location transition system defined here (where no abstraction is made from r-transitions), we take the location of a communication to be that of the smallest component which includes the two communicating subprocesses: the notation M n i; in rule (S4) stands for the longest common prefix of u and v. For instance we have: EXAMPLE 2.1.
l::a\k\:
a.Q' '•• P \ k':: fi) - ^ , /:: nil \ k :: (/' ::P\k':: -j^s
P)
l::nil\k::{r::nil\k'::nil).
There are other possibilities for defining locations of r-actions representing communication. In [116] the location of such an action is the pair of locations of the contributing actions. In the above example, the resulting location would be (/, k) for the first communication, and (kr, kk') for the second. In [28,29], r-actions have no location at all. In fact, these differences are not important since in all these studies the interest is centered on the weak location transition system, where the locations of r-actions are simply ignored (since the actions themselves are not observable). The weak location transitions =^s and ^^s are defined by: p =^s q <=> 3 M1,..., w„, /7o,..., Az, ^1 ^ 0 such that P = P^-i^s
P\"--^sPn=q.
P =^s q <=^ ^P\,P2 such that p = ^ , P\ -^s
Pi =^s q•
The weak location transition system will be the basis for defining notions of location equivalence and location preorder accounting for the distributed behaviour of CCS processes. The reader may have noticed, however, that applying the rules of Figure 1 to CCS terms just yields a transition p -^s p' whenever the standard semantics yields a transition p - ^ /7^ In fact, these rules will not be applied directly to CCS terms. Instead, the idea is to first bring out the parallel structure of CCS terms by assigning locations to their parallel components, thus transforming them into particular LCCS terms called "distributed processes", and then execute these according to the given operational rules. The set DIS c LCCS of distributed processes is given by the grammar: p ::= nil \ fi.p \ (l::p\k::q)
\ {p-\-q) \ p\a \ p{f) | x \ recx. p.
Essentially, a distributed process is obtained by inserting a pair of distinct locations in a CCS term wherever there occurs a parallel operator. This is formalized by the following notion of distribution. '^ For convenience we include in the same page the rules for the dynamic transition system, which will only come into play in Section 2.5. These rules (given in Figure 2) can be ignored for the time being.
Process algebras with localities For each /i eActx, u e Lac'', let -^s following axiom and rules. (SI)
11.p- -^ P
(S2)
P
(S3)
be the least relation - ^ on LCCS processes satisfying the
t
11
965
=^ lv.p-^l::p'
p
^
lit
^
=> p\q^p'\i
P u p'
q\p-^'i\p' (S4)
P
(S5)
(X ^ 11
p'. 9 ^ 9 '
1
=> P\Q =>
P u P
r
f I
1
M
^
p+ ^-^p
p^p
(S6)
P 11 ' p\ 11^ {a, a) =^ p\« - ^ p'V"
(S7)
P
(S8)
p[ recx. p/x] -^
11
f
z/ni- P ' ^
=» P ( / > ^ p ' ( / >
P'
U
p' => recx. p-rr^ P
1
Fig. 1. Static location transitions.
Let p —^^ q ^^=^def P —^.v ^, and for each a e Act, u e Loc*, let -^j be the least relation - ^ on LCCS processes satisfying rules (S2), (S3), (S5), (S6), (S7), (S8) and the axiom: (Dl)
a.p-j^l::p
for a n y / G L O C
Fig. 2. Dynamic location transitions.
DEnNlTlON 2.2. The distribution relation is the least relation V c (CCS x DIS) satisfying: - nilVnil and xVx. - pVr ^ pi.pVpi.r p\aT>r\a p{f)Vr{f) {recx. p) V {recx. r). - pVr&qVs =^ {p I q)V{l ::r\k::s), {p-\-q)V{r-\-s). If pVr we say that r is a distribution of p.
V/, k such that / y^ k
966
/. Castellani
Note that the same pair of locations may be used more than once in a distribution. We shall see in fact, at the end of this section, that distributions involving just two atomic locations are sufficient for describing the distributed behaviour of CCS processes in the static approach. This will not be the case for the dynamic approach of Section 2.5. 2.4.1. Static location equivalence. We shall now introduce an equivalence relation ^\ on CCS processes, which is based on a bisimulation-like relation on their distributions. The intuition for two CCS processes p, q to be equivalent is that there exist two distributions of them, say p and q, which perform "the same" location transitions at each step. However, we shall not go as far as to observe the concrete names of locations: the intention here is that locations should serve to reveal the degree of distribution of processes rather than to specify a placing of processes into a given network. Their precise identities should therefore not be significant. In fact, even if we want to observe distribution, we still aim, to some extent, at an extensional semantics. For instance, we do not want to observe the order in which parallel components have been assembled in a system, nor indeed the number of these components. We are only interested in the number of active components in each computation. Then we cannot require the identity of locations in corresponding transitions. For instance, if we want to identify the following processes: a\{b\c) a
and
and
{a\b)\ c,
a \ nil,
(2) (3)
it is clear that, whatever distributions we choose, we must allow corresponding transitions to have different - although somehow related - static locations. The idea is to compare transitions modulo an association between their locations. This was first proposed by Aceto for a subset of CCS called nets of automata [5], where parallelism is restricted to top-level, and then generalized by Castellani to full CCS in [38]. In the case of nets of automata the structure of locations is flat and the association is simply a partial bijection between the sets of locations of the two processes. For general CCS processes the association will not be a bijection, nor even a function. For instance, in order to equate the two processes (which should be both equivalent to a.b.c): a.{b.c\nH)
and
a.bXc\nil)
(4)
we need an association containing the three pairs {s, e), (/, e), (/, /'), for some /, V G LOC. In fact, the only property we will require of location associations is that they respect independence of locations. To make this precise, let <^ denote the prefix ordering on Loc"". If M «: f we say that v is an extension or a sublocation oiu.liu <^v and v i^u, what we indicate by M O U, we say that u and i; are independent. Intuitively, transitions originating from different parallel components will have independent locations. On the other hand, transitions performed in sequence by the same component (like a and b in the two processes of example (4)) will have dependent locations: the location of the second transition will be a sublocation of the location of the first. We shall sometimes by extension talk of independent or dependent transitions.
Process algebras with localities
967
We introduce now the notion of consistent location association, as defined in [38]. This is meant to express the requirement that independent transitions from one process be matched by independent transitions from the other process. DEFINITION 2.3. A relation (p c {Loc'' x Loc"") is a consistent location association (cla ) if: (M, V)
ecp SC
{U\ V')
e(p ^
{u o u' <^ V o v').
The following properties of cla's are immediate to check: 2.4 (Properties of cla's). (1) If(p is a cla, then (p~^ is a cla. (2) If (p is a cla and ^1/ ^cp, then x/r is a cla. (3) If(p and x/f are cla's, then cp o xj/ is a cla.
PROPERTY
We will see now that, for a given pair of distributed processes we want to equate, the required cla cannot in general be fixed statically, but has to be built incrementally. We will show that this is necessary to ensure such basic identifications as (2) and (3) above. For consider the two processes, which should certainly be equated if we want parallel composition to absorb the nil process, and -h to be idempotent, which is the very essence of a bisimulation semantics: (a\b)
and
(a \b)-\-{nil\ (a \ b)).
(5)
Any two of these processes will have the following form, where / ^ k and /, ^ /:, for / = 1,2,3: (l::a\k::
b)
and
(/i ::a\k\ :: b) + {h :: nil \ ki :: ih '• a \ k^ :: b)).
Suppose we want to equate these two distributions using a fixed location association (p. Clearly we will require cp to contain the pairs (/, l\), (k, k\), (/, k2h), (k, kik^). But then, \i(p is to be consistent, ki must be such that l\ <^ kih and k\ < kiky. however this would imply l\ =k2 and k\ =k2, contradicting the hypothesis l\ ^k\. Similarly, if we want parallel composition to be associative, we should identify the processes: a\{b\c)
and
a\{b\c)^-{a\b)\c
(6)
which have the following generic distributions, where / ^ k and /, ^ /:, for / = 1,2,3,4,5: {lv.a\k'.:{lx
::b\k\ ::c))
and
(/2 ::a\k2 :: (/3 :: b \ k^ :: c)) + (/4 :: (/5 :: a \ k^ :: b) \ k^ :: c).
968
/. Castellani
Here a global location association would have to contain the pairs (/,/2), {klx.kih), (kk\,k2k3), {1,145)J {kl\,Uk^)y {kk\,k4). But this would imply h = U and ki = k, whence the contradiction /2 = A^2These examples show that, at least if we want to retain a simple notion of location,^^ the location association cannot be fixed once and for all, but has to be built dynamically along computations. In example (5), depending on which summand is chosen in the second process, one will use the association (p\ = {(lj\),(k,k\)] or the association (p2 = {(/, k2h)^ (k, A:2^3)}- In example (6), one can choose (p\ = {(/, h), (kl\, kjh), (kk\, kik^,)} for one computation, and (p2 = {(l, Uls), {kl\, /4A:5), {kk\, k^)] for the other. Note incidentally that these situations are not due to the phenomenon- known as "symmetric confusion" in Petri nets, and exempHfied in CCS by the term {p\q) -\-r. Similar examples could be obtained in CCS with guarded sums (the language considered, e.g., in [118]), by just prefixing all summands in the examples above by an action d. Let us see now how these location associations can be built up dynamically. Let
(1) p=^s (2) q=^sq'
p' =^^q\vs}jichihdiiq^sq\ ^^p\us\xc\i\hdiip=^s
(p^[{u,v)}
e
p'S^U{{UA)}R'-
p\ ? U {(M, i;)} G 0 and/?'5^u{(//a')} ^'•
(3) p =^.9 p' =^3q' such that q = ^ v q' and p^S^pq'. (4) q =^s q^ =^3p^ such that p =^s p' and p'S^pq'. We may now define the location equivalence ^\ on CCS terms as follows: DEHNITION 2.6 {Static location equivalence). For /?, <7 € CCS, let p ^\ q if and only if for some p,q e DIS such that pVp and qVq, there exists a progressive bisimulation family S = {5^ \(p e
Let us prove that ^^ is indeed an equivalence relation. The reader may have noticed that the inverse V~^ of the distribution relation is a function. If we let n =def ^~\ then 7t{p) is the pure CCS process underlying the distributed process p. We start by showing that all distributions of the same process are in the relation Si/, for some progressive bisimulation family S. PROPOSITION
2.7. Let p\, p2e DIS. Then Tt{p]) = 7r{p2) =^ 3pbf S such thatp\S^p2-
One could envisage a more structured notion of location, incorporating information about the + operator; this would mark as conflicting (another form of dependency) the locations of the first and second summand in the right-hand process of examples (5) and (6). Then, identical locations would be allowed to be matched by conflicting locations and the counterexamples (5) and (6) would not hold anymore. In fact, this would bring us close to the notion of proved transition considered in [27], and would certainly complicate the theory as a new relation of conflict would have to be considered on locations.
Process algebras with localities
969
The proof of this proposition rehes on the following definition and lemma. 2.8. For any p\,p2 e DIS such that 7t(p\) = nipi), least relation on locations satisfying: DEFINITION
let (pipx^pi) be the
(p(nil,nif) = (p{x, x) = (pifi.ri, fi.rj) = (p{(r\ + ^ i ) , (ri +^2)) = {(£.s)}, (P(r\\a, r2\a) = (p(r\ ( / ) , riif)) = (p(r\, rj), (p{r\[recx. r\/x],r2[recx. (p{(li::n \ki::si),
ro/jc]) C (p(recx. rj, recx. ri),
{h :: ri \ k2 :: si)) = {{e.e)} U(hJ2)'(pin,r2) U (k],k2)
where for any relation (p, we let (/, /') • (p =:def {(luj'v)
•(p(S\,S2),
\ (u,v) ecp).
It may be easily checked that the relation (p(p\, P2) is a consistent location association. Note that (p(p\, P2) only relates those locations of p\ and p2 which are "statically exhibited", i.e., which do not occur under a dynamic operator. The following lemma establishes the relation between the association (p(p\, P2) and the transitions of p\, p22.9. Let p\, p2 G D I S be such that nip \) = 7r(/72). Then: {\) p^zA^, p\ ^ ^P2,v such that p2=^s Pi^ (Pip\. P2)^ {i^^'^)^^(p\^
LEMMA
P'2^ ^^d
7T(p\)=7t(p2)
(2) p\ =^s p\ =^ ^p'l such that p2 ^ s Pi. (p{p\, P2) ^ (p(p\. Pi) ^^d ix{p\) = 7r(p'2l By induction on the proofs of transitions of distributed processes. Note that in general (p(p\, p2) ^ (p{p\, P2) because new parallel structure may appear as the computations proceed. D PROOF.
We may now prove the above proposition. PROOF OF PROPOSITION 2.7. Define the family T = {T^p \ (p e 0} by letting:
Tcp = {(r\,r2) I 7r(ri) = 7r(r2) and (^ ^ (/?(ri, ^2)}. It is clear that r\T^r2 for any r\,r2 such that Tr(r\) = 7r(r2). Let us show that T is a progressive bisimulation family. Suppose that r\T^pr2. If ^i =^.s r[ then by Lemma 2.9 r2 =^s r'^. with (p{r\,r2) U (M, i;) c (^(rj, r^) and it{r\) = nirj) . We want to show that (p^ = (p\j (M, V) is a cla and that r\ T^r^. But this follows from (p c (p(r\, r2) and Lemma 2.9, since <^^ = (p\j (u, v) ^(p{r\,ri) U (M, V) C <^(r[,r-^). D Using this proposition, we can now show that:
970
/. Castellani
PROPOSITION
2.10. The relation ^^ is an equivalence on CCS processes.
PROOF. Reflexivity: Consider the family S = {S^\(p e0] defined by:
10
otherwise.
It is clear that S is a progressive bisimulation family such that {q,q)e 5*0 for any q € DIS. Hence p ^\ p for any p e CCS. Symmetry: Let p^\q. This means that for some p, ^ G DIS such that n{p) = p and n{q) = q, there exists a progressive bisimulation family S = {S^p\(p e0] such that pSi/^q. Define now a family R = {/?^ | i/r G 0} by: R^ =
{{r,s)\sS^-xr}.
Clearly qRi/^p. We show now that R is a progressive bisimulation family. Suppose (r, s) e R^: this is because sS^pr, with ? = i/r"'. Then r =>.s ^' implies s = > s -y', with 'y'5'^u{(u,M)}^'. Now [cp U {(u, «)}-• = V^~' U {(M, U)}, thus {r\ s') G /?^-iu{(//.i')}- ^^^ ^^^^ of unobservable transitions is similar. We can then conclude that q ^l p. Transitivity: Let p ^^ r and r ^J ^. This means that for some p.q,r\,r2 G DIS such that7r(^) = p,7z{q) =q,7x{r\) = n(r2) = r, there existpZ?/'^ R ' and R*^ such that ^/^^ri, r2R^q. Moreover, if T is the p^/introduced in the proof of Proposition 2.7, we know (from the same proposition) that r\ T^/^ri. Hence if we define a family S = {5',^ | <^ G 0} as follows: {s,s)eS^p<^=^
3ri,r2GDIS such that 7r(ri) = 7r(r2); Ipbfs
S\S^,
3clas(p\,\l/,(p2,
such that
(p^(P2 0\l/ o(p\ and sSlp^ t\ T^ t2S^^s' it is clear that pS^q. Moreover S is a progressive bisimulation family, since for any w, f, v\ w we have: (p U {(w, w)} C (^2 U [{v\ w)} oxj/U {(u, i;')} o(p\U {(w, v)}. D A pleasant consequence of Proposition 2.7 is that ^l is independent from the particular distributions we choose. If two CCS terms p and q are equivalent, then any two distributions of them are related by ^0, for some progressive bisimulation family S = {S(p\(p e0}. COROLLARY 2.11. Forany p,q e CCS: p ^l q
By virtue of this result, we can restrict attention to particular ''binary" distributions, systematically associating location 0 to the left operand and location 1 to the right operand of a parallel composition. A distribution of this kind will be called canonical. Similarly, elements of {0, 1}* will be called canonical locations. These are in fact the locations used in work by Mukund and Nielsen [118] and, with a slightly different notation, by Montanari and Yankelevich [116,171]. In fact, when applied to canonical distributions of CCS terms.
Process algebras with localities
971
the static transition rules give exactly the same transitions as the spatial transition system of [116,171] (except for r-transitions, for which these papers use pairs of locations). Note here that since canonical locations can be extracted directly from the structure of terms (in fact they are just a part of the proof of a transition, in the sense of the proved transition systems mentioned in Section 2.1), in the static approach the extension of the language with location prefixing is not really necessary. Using canonical locations only, the whole static location theory could be developed within the standard syntax of CCS. However, it would then not be possible to relax the theory to allow for the placing of more components into the same location, a point which will be discussed at p. 977 (in Section 2.5). We show now that location equivalence is finer than the ordinary (weak) bisimulation, and that introducing locations only adds discriminations between processes in so far as their distributed aspects are concerned. Let CCSseq be the set of sequential processes of CCS, built without the parallel operator. On this language location equivalence ^\ reduces to the standard weak bisimulation ^ : PROPOSITION 2.12. For any processes p,q e CCSseq: p ^l q <^=^
P^Q-
The proof that p^\q =^ p^q is straightforward and is left to the reader. We show here that p^\q 4= P^q- Let R be an ordinary weak bisimulation between p,q e CCSseq. Note that the distributions of processes in CCSseq coincide with the processes themselves, and therefore all their transitions have the form p -^s P- Let Si/i = [(p, q)}. Since the location association (p = {{s,£)} is consistent it is clear that the family of relations S = {50} U {S^\(p = {(e, 8)} and S^ = R}UIS^ \xl/ e 0\{0, cp}, S^ = 0} is a progressive bisimulation family. D PROOF.
We give next some simple examples. The reader acquainted with causality-based equivalences such as the causal bisimulation of [52], will notice here the difference between location equivalence and causality-based equivalences (the exact relation between these equivalences will be discussed in Section 3.3). EXAMPLE
2.13. a.b + b.a ^\ {a.y \Y.b)\Y ^(b.y \yM)\Y
^\
a\b.
By Corollary 2.11, to show ^\ it is enough to find a pair of distributions for which every association fails to be consistent. Using canonical distributions, it is easy to see that the computation a followed by b yields the association (p = {(e. 0), (s, 1)} between the locations of the first two processes, which is not consistent. On the other hand, for the second and third process we can build the consistent association (/?i = {(0, 0), (1, 1)} for the computation a followed by b, and the consistent association (^2 — {(0, 1), (1,0)} for the computation b followed by a. A related example is: EXAMPLE
2.14. [{a.y+b,y)\{y.b^y.a)]\y
^-\ a\b.
Again, these two processes are intuitively equivalent since they both perform actions a and b in either order at different locations. The construction of the appropriate associations is left to the reader.
972
/. Castellani
EXAMPLE 2.15. [(o?+ /?) | a . ^ ] \ a ^\
b.
Here the observable behaviour consists for both processes in just one action b occurring at some location. Although the first process may choose its action b from two different components, this cannot be detected by ^ J . The reader may want to check this fact using canonical distributions. These examples illustrate the extensional character of ^^: from Example 2.14 we see that equivalent processes do not need to be componentwise bisimilar, while Example 2.15 shows that equivalent processes need not even have the same number of parallel components. The following is an example of infinite processes which are not equivalent: EXAMPLE 2.16. recx.a.x
^\ (recx. a.x
\recx.a.x).
Note that in the standard CCS semantics these two processes give rise to isomorphic transition systems. We conclude this section by reconsidering the protocol and mutual exclusion examples discussed in Section 2.2. We let the reader verify the following. EXAMPLE
2.17. PSpec '^\ Protocol Sind Mutex '^\ MSpec ^t FMutex ^\ Mutex.
2.4.2. Static location preorder. We define now a preorder £ ^ on CCS processes, which formalizes the idea that one process is more sequential or less distributed than another. When deahng with noninterleaving semantics, which are more discriminating than the usual bisimulation semantics, it is interesting to have such preorder notions to be able to relate, for instance, a sequential specification with a distributed implementation. The location preorder £ ^ is obtained by slightly relaxing the notion of consistent association. The intuition for p^ q h that there exist two distributions p and q of p and q such that whenever p can perform two transitions at independent locations, then q performs corresponding transitions at locations which are also independent, while the reverse need not be true. This is expressed by the following notion of left-consistency: DEFINITION 2.18. A relation (p c {Loc"" x Loc"") is a left-consistent location association if: (M, V)
e(p
8L (U\ V')
e cp =>
(U O U'
=> V
O V').
Now, if ^ is the set of left-consistent location associations, we may obtain a notion of progressive pre-bisimulation family (ppbf) on distributed processes of DIS by simply replacing
It is easy to see that p ^ ) q => p ^'^ q. As may be expected the reverse is not true. We have for instance, resuming the examples from the previous section:
Process algebras with localities EXAMPLE
2.20. a.b + b.a £ ^ (a.y \y.b)\y
EXAMPLE
2.21. recx.a.x
EXAMPLE
2.22. PSpec £ ^ Protocol.
£
(recx.a.x
+ (b.y
973
\y.a)\y.
\recx.a.x).
The reader may want to check, on the other hand, that the two systems Mutex and FMutex in the mutual exclusion example of p. 961 are not related by £ ^. Having introduced both an equivalence ^\ and a preorder £ ^ based on the same intuition, we may wonder whether ^^ coincides with the equivalence :^^ =def £ ^ H ^ ^ induced by the preorder. It is clear that ^^ c 2^^, since we have both ^J c ^ ^ and ^^ ^ 5 ^ • On the other hand, the kernel of the preorder is weaker than location equivalence, as shown by the following example. Consider the two processes: a.a.a -\-{a\a\a)
and
a.a.a -\~a.a \a -\- (a \a \a).
These two processes are not equivalent with respect to ^J, but they are equivalent with respect to ^'l becmise a.a.a ^'^^a.a \a ^'^^a \a \a.
2.5. Dynamic approach We present now the dynamic approach introduced in [29],"' and in particular the dynamic versions of the location equivalence and preorder, noted ^^/ and £ ^ • In the dynamic approach, locations are associated with actions rather than with parallel components. This association is built dynamically, according to the rule: (Dl)
a.p-j^d
i'-'P
for any/GLOC.
In some sense locations are transmitted from transitions to processes, whereas in the static approach we had the inverse situation. Rule (Dl) is the essence of the dynamic location semantics. The remaining rules for observable transitions are just as in the static semantics, see Figure 2. Note that locations increase here at each step, even if the execution goes on within the same parallel component. In fact the location / created by rule (Dl) may be seen as an identifier for action a, or more precisely, for that particular occurrence of ^. By inspecting the rules, one can easily see that a generic transition has the form
where u e Loc*: here the string w is a record of all action occurrences which causally precede action a (through the prefixing operator), what we shall call the causal path (or access path) to a. The whole string ul will be called the dynamic location of a. An earlier variant presented in [28] will be discussed in Section 3.2.
974
/. Castellani
Let us see some examples of dynamic transitions. The first and third process of Example 2.13 may both execute an a action followed by a Z? action. The corresponding sequences of dynamic transitions are (for any choice of locations l\,h^ Loc): a.b + b.a -^d
h :: b —rr^d h '-'-1^ '-'- nil,
M
(7)
'I'2
a I b -f>d l\ :: nil \ b - ^ j /, :: nil \ h :: niL
(8)
The observable dynamic transitions p -^d p' are related to the static transitions p ~^s p' in a simple way. To see this, let us introduce a few notations. Let Ak{p) be the function that erases the atomic location k in p, wherever it occurs. Formally, A : (Loc x LCCS) -> LCCS is defined by the clauses: AUP)
= p.
^^^^'•'•P'^
ifpeCCS,
Akip) \l::Ak{p)
if/:=/, otherwise.
together with clauses stating the compatibility of Ak with the remaining operators (for instance Ak{p \ q) — Ak(p) \ Akiq), etc.). Also, for any p e LCCS, let Loc(p) be the set of atomic locations occurring in /?, defined in the obvious way. We have then the following correspondence between the two kinds of location transitions: FACT 2.23. Let p e LCCS, I i Loc{p). Then: (i) P^dP' ^ P^sAiip'). (ii) p -^s
p' ^ ^ p" such that p -~>d p" and Ai{p") = p .
The proof, by induction on the inference of the transition, is left to the reader. Because of rule (Dl), the dynamic location transition system is both infinitely branching and acyclic: it thus gives infinite representations for all regular processes. In fact, while the infinite branching may be overcome easily (through a canonical choice of dynamic locations [171,38], as will be explained later), the infinite progression is intrinsic to the dynamic semantics. For r-transitions, for which we do not want to introduce additional locations, we simply use the static transition rules. Although this last point differentiates our strong dynamic location transition system from that originally introduced in [29], where no locations were associated with T-transitions, the resulting weak {dynamic) location transition system is the same. The definition of the weak dynamic transitions ==^d and ^^d is similar to that of the static transitions = ^ s and = ^ s • For instance, the second process of Example 2.13 has the following sequence of strong dynamic transitions: {a.y I y.b)\y
+ {b.y \ y.a)\y
^ d ^ d
(h :: Y I y^b)\y
-^d
ili::nil\l2::niD\y.
(h :: nil \ b)\y
Process algebras with localities
975
From this one can derive (for instance) the following sequence of weak transitions: {a.y I y.b)\y
+ {b.y \ yM)\y
=^d (nil \ b)\y ^ j
(nil \ nil)\y.
(9)
We define now the dynamic location equivalence ^^1 and the dynamic location preorder £ ' i'. Because of the flexibility in the choice of locations offered by rule (Dl), these definitions are much simpler than in the static case. In [29] the relations ^^[ and £ ^^ were obtained as instances of a general notion of parameterized location bisimulation. We shall give here directly the instantiated definitions. 2.5.1. Dynamic location equivalence. The dynamic location equivalence ^^/ is just the ordinary bisimulation equivalence associated with the weak dynamic location transition system. 2.24 (Dynamic location equivalence). A relation R C LCCS x LCCS is called a dynamic location bisimulation (dlb) iff for ^\\ (p,q) e R and for all a G Act, u e Loc^: (1) p=^dp' ^ 3q'mchihdiiq==>dq' ^rid(p\q')eR. DEHNITION
(2) q =^d q' ^
3p' such that p ==>d p' and (p\ q) e R.
(3) p^^dP' =^ 3<3r'suchthat<7 = ^ j ( 7 ' a n d (/7',<7') G/?. (4) q =^d q' ^ 3p' such that p =^d p' and (p\ q') G R. The largest dlb is called dynamic location equivalence and denoted ^^^ For instance, the three processes of Example 2.13 are related as follows (as it is easy to check by looking at their transition sequences given in (7), (9) and (8) respectively): EXAMPLE 2.25. a.b + b.a ^f (a.y | y.b)\y
+ (b.y \ y.a)\y
^f a \ b.
In fact, all the examples given in Section 2.4 for the static location equivalence ^^ equally apply to the dynamic location equivalence ^^^ We refer the reader to [29] for more detailed examples of equivalent and unequivalent processes. 2.5.2. Dynamic location preorder. We consider now the location preorder £ ^. Here, instead of requiring the identity of locations in corresponding transitions, we demand that the locations in the second (more distributed) process be subwords of the locations in the first (more sequential) process. Formally, the subword relation ^sub on Loc"^ is defined by: V ^sub " '^=^ 3v\, ...,Vk,^w\,...,
Wk-^\ such that v = v\ -"Vk and
2.26 (Dynamic location preorder). A relation R c LCCS x LCCS is called a dynamic location pre-bisimulation (dlpb) iff for all (/?, q) e R and for all a G Act, u G Loc^: DEHNITION
976
/. Castellani
(1) p=^^p'
=> 3i;. i; ^sub «. 3<7'suchthat<7 =:^,/
(2) q ==^ci q' =^ 3 M. i; ^sub ", ^p' such that p ===>,/ p' and (p',q') e R. (3) p=^jp^ ^ 3q' such ihsii q ^=^(1 q' Sind (p,q') e R. (4) ^ =^d q' ^ 3p' such that p ^ , / /?' and (p', q')^R. The largest J/p/? is called dynamic location preorder and denoted £ . The intuition is as follows. If /? is a sequentialized version of ^, then each component of p corresponds to a group of parallel components in q. Thus the local causes of any action of q will correspond to a subset of local causes of the corresponding action of p. This may be easily verified for the following examples: EXAMPLE
2.27. a.a.a £ ^ a.a \ a and a.b-{-b.a £'^
a\b.
Let us briefly return to the Protocol example of Section 2.2. This example was already proposed for study under the static semantics (Examples (2.17) and (2.22)), but it is somewhat easier to handle in the dynamic semantics. We want to argue that: EXAMPLE
2.28. PSpec 76^ Protocol but PSpec £^^ Protocol.
Recall that the sequential specification PSpec was given by PSpec ^ while the system Protocol was defined as follows:
in.out.PSpec,
Protocol ^ (Sender \ Receiver)\a, P Sender <= in.a.p.Sender Receiver 4= a.out.fi.Receiver. To see that PSpec 76^ Protocol, consider the sequence of transitions of Protocol: Protocol Jf^d ^d
(/:: Sender \k\\ Receiver)\a, fi.
The specification PSpec can only respond by performing the sequence of transitions: PSpec Jf^d =^d I'-k:: PSpec. Clearly, this transition sequence does not match that of Protocol. Note however that the locations indexing the transitions of Protocol are subwords of those indexing the transitions of PSpec. This suggests how to build a dynamic location pre-bisimulation to prove that PSpec £ Protocol. All the other examples given in Section 2.4 for the static location preorder £ ^ also hold for £
Indeed, as we shall see in the next section, the dynamic relations ^^^ and £ ^
coincide with the static relations ~J and £ | introduced in the previous section.
Process algebras with localities
977
Discussion. We now briefly recount how the static and dynamic approaches to locations presented in this section emerged. The static approach may appear more natural than the dynamic one as it matches more closely the intuition behind locations as units of distribution for processes. However this approach was initially abandoned in favour of the dynamic one, as it was not clear how to define an equivalence based on static locations. In particular the idea of dynamic location association did not immediately come to mind. This idea was first proposed by Aceto in [5] for a class of CCS process with only top level parallehsm, called nets of automata}^ and then extended to the whole language CCS by Castellani in [38]. Similarly, the coincidence of the static notions of equivalence and preorder with the dynamic ones (which will be exposed in the next section) was first established for nets of automata in [5] and then for CCS in [38]. Because of the arbitrary nesting of parallelism and prefixing in CCS terms, and of the interplay between sum and parallelism, this extension was not completely straightforward. An intermediate step was taken by Mukund and Nielsen in [118], where a notion of bisimulation equivalence based on static locations was introduced for a class of asynchronous transition systems modelling CCS with guarded sums. This equivalence, similar to that of [38], was already conjectured to coincide with the dynamic location equivalence of [29]. The first definition of the dynamic location semantics appeared in [28]. In that formulation, rule (Dl) generated a location word u for each action, rather than an atomic location /. As it turned out, the resulting equivalence was slightly too weak,-*^ hence this first definition was replaced in [29] by the one presented here. In [28] a logical characterization is given for the early variant of dynamic location equivalence, which can be easily adapted to the later variant of [29]. An equational characterization for both the location equivalence ^^/ and the location preorder £ ^ is presented in [29]. This axiomatization makes use of a new prefixing construct {a@ux).p, whose semantics is given by: {a@ux).p -~>d pU/^]
for any / e Loc.
The idea is to reduce terms to normal forms by replacing the ordinary prefixing a.p with the new construct, according to the basic transformation law: a.p = {a@x).x :: p. In fact, the logical characterization is based on a very similar idea. Here modalities of the form {a)u are added to a classical Hennessy-Milner logic, with the following semantics: p \={a)u 0
if, for some /?', p =^j p' and p' \= 0.
Location equivalence also inherits axiomatic characterizations given on various subsets of CCS for other distributed equivalences.-'^ For instance an equational characterization was ~ For this class of processes a consistent location association is just a partial bijection between two sets of locations. ~^ An example of unwanted identification under this equivalence is given in Section 2.6, where this earlier variant is described. -"^ These equivalences will be discussed in Section 2.6.
978
/. Castellani
given for distributed bisimulation in [37,39], for a subset of CCS with communication but without restriction. This made use of auxiliary operators of left-merge and communication merge, taken from [14] and previous work on ACP (interestingly, however, the laws for these operators were somewhat different from those holding in ACP). A proof system for local cause equivalence, which also uses these operators (together with a new operator of cause prefixing, see Section 3.2) and covers all finite CCS processes, is presented by Kiehn in [99]. An axiomatization for a related equivalence may also be found in [66]. We conclude this section with a discussion on the choice of the language LCCS as a basis for the location semantics. The reader may have noticed that, while the relations ^^' and £ ^ have been defined on the language LCCS, the static relations ^\ and £ ^, on the other hand, have been defined only on CCS. In fact, these relations are defined on CCS by lifting them up from relations on DIS, which is itself a proper sublanguage of LCCS. We shall now briefly comment on this choice, and show that some results, like the coincidence of the static and dynamic notions of equivalence and preorder, would fail to hold on the whole language LCCS. At first sight, we could envisage to extend the static equivalence ^\ to the rest of LCCS by letting, for any terms p and q in LCCS\CCS: p ^\ q if and only if pS^/^q for some progressive bisimulation family S = {^^^ \(p e^P] (the notion of progressive bisimulation family being itself generalized). Note that in LCCS the distribution of locations may be quite liberal: we have for instance terms like {I w a \ I v. b) and {I :: a -\-k :: b). With our generalized definition of ^\ we would have the following identification: (l::a\l::b)
^l I:: (a.b-h b.a).
(10)
Now, if this could be argued to be a reasonable equation in a locality based semantics, it would not be compatible with our intended interpretation of ^ | , which is supposed to preserve the degree of parallelism of processes. In fact, these two processes would not be equated in the dynamic semantics: (l::a\l::b)
^'l l::(a.b-^b.a)
(11)
because the first has a computation: (/:: a I /:: b) -^j
I:: (h :: nil \ b) -^j
I:: (/i :: nil \ h :: nil)
which the second is not able to mimic. As it were, the dynamic semantics will always distinguish between parallel components, no matter what locations have been inserted in front of them. On the other hand the static semantics can only distinguish between parallel components that have been previously tagged with disjoint locations. This example also suggests that ^^ would not be preserved by parallel composition on LCCS: we would have for instance /:: b ^^ k :: b but (l::a\l:: b) ^l (l::a\k:: b). Therefore, it seems fair to say that the appropriate language for defining the static relations ^'l and £ ^ is DIS, rather than LCCS. On the other hand, a language larger than DIS is needed for the dynamic semantics: for example the term (a \l ::b) can arise in the dynamic semantics as a derivative of some CCS term, for instance of the term (a \ c.b).
Process algebras with localities
979
This is why LCCS was chosen as the basic language in [29]. It was kept as the reference language in [38], because it is a natural extension of CCS where the dynamic and the static location transitions can be defined in a simple and uniform way. Another point which is worth discussing is the possibility of relaxing the location semantics to allow for the placing of several parallel components on the same location. Clearly, this would slightly change the focus of the semantics: as it stands, the location semantics prescribes a maximal distribution of processes, identifying their degree of distribution with their degree of parallelism. In some cases however, it could be interesting to dissociate these two measures, allowing the degree of distribution to be lower than the degree of paralleUsm. For instance, one may describe in CCS a two-place buffer as a system made of two parallel components. As for the Protocol example discussed earlier, the location semantics would distinguish this system from its sequential specification (see [28] for a detailed description of the buffer example). On the other hand, it may seem excessive to view such an elementary system - representing a simple data structure - as being distributed over different sites. In this and similar cases we may want to allow different parallel components to be sitting together at the same location. To accommodate this possibility, the static location semantics would require very little modification. It would be enough to omit the requirement that parallel components have different locations in the language DIS. The dynamic semantics, on the other hand, would be slightly more difficult to adapt: since this semantics is sensitive to the degree of parallelism of processes, as shown by example (11), it would be necessary to introduce a kind of sequential encapsulation operator \p\, whose effect would be to conceal all locations in p. The semantics of this operator could be given by:
P-^dP
^
M^dlv-lp'}
forany/GLoc.
Then, for instance, the process \a \ b\ would have a sequence of transitions: {a \b\^dl::
Ih :: nil \ b\ -j^d l::k:: [/, :: nil \ h :: nilj.
Introducing this operator, however, would not have exactly the same effect as allowing processes of the form (/ :: p | / :: ^) in the static semantics, since in the latter case the sublocations of / could still be distinguished, while the operator {pj conceals locations in all the subterms of p. We leave this point open for speculation.
2.6. Equivalence of the two approaches This section is devoted to showing the equivalence of the static and dynamic approach. More precisely, we shall establish the following theorem. THEOREM 2.29.
(1) p^lq (2) P^\q
Let p,q
e
CCS.
^=> P^iq\ ^=^
P^%-
Then:
980
/. Castellani
To this end, we introduce a new transition system on CCS, called occurrence transition system, which in some sense incorporates the information of both location transition systems. This system will serve as an intermediate between the static and the dynamic semantics. The main point will be to prove that starting from a static or a dynamic location computation, one may always reconstruct a corresponding occurrence computation. This means, essentially, that all the information about distribution and local causality is already present in both location transition systems. The two location transition systems could also be compared directly, without recourse to an auxiliary transition system. However the occurrence transition system is interesting in its own right, since it provides a concrete level of description where the notions of occurrence of an action, computational history of an occurrence and computation state of a process have a precise definition. Moreover, as we shall see, it allows for the definition of a notion of local history preserving bisimulation, which turns out to be a third equivalent formulation of location equivalence. 2.6.1. The occurrence transition system. We define here a new transition system on CCS, called occurrence (transition) system, whose states represent CCS computation states with a "past", and whose labels are occurrences of actions within a computation. This system, which is based on a syntactic notion of occurrence of action, is essentially a simplification of the event (transition) system introduced in [27] to compare different models of CCS: it is simpler because we do not try to identify uniquely all occurrences of action in a term, as in [27], but only those which can coexist in a computation. Moreover, since we are interested here in weak semantics, we shall not distinguish between different occurrences of T-actions and we concentrate on abstract occurrences, in which r-actions and communications are absorbed. Formally, the set OT of occurrences is defined as Or = O U {r}, where the elements of (9, the visible occurrences, are given by: e ::= a \ ae \ Oe \ le. The meaning of the occurrence constructors is as follows: a denotes an initial occurrence of action a (possibly preceded or followed by some r actions in the computation), ae denotes the occurrence e after an action a, while Oe,\e represent the occurrence e at the left, respectively at the right of a parallel operator. Finally the symbol r is used - with abuse of notation - to represent any occurrence of a r-action in a computation. We use e,e\ .,Ao range over the whole set Or. We shall see that a visible occurrence e eO incorporates both its static and its dynamic location. Note that O could also be defined as: O = (Acr U {0,1 })*Acr. Then an occurrence e e Or is either r or a word aa, for some a e (Act U {0, 1})* and a e Act. The label of e e Oj is the action of which e is an occurrence: DEFINITION
2.30 (Label). The function A: Or ^ Actj is defined by:
A(r) = r,
X(aa) = a.
Process algebras with localities
981
This alternative presentation of O makes it also particularly easy to define the location and the causal path (also called access path in [38]) of a visible occurrence e. The location loc{e) of an occurrence e eO'is the canonical location obtained by projecting e onto {0, 1} (here we use proj^ {w) to denote the projection of a word w on an alphabet E)\ DEFINITION 2.31 {Location). The function loc.O-^
{0, 1 }* is defined by:
loc{e)=proj^Q^^^{e). The prefix ordering on O defines a relation of causality :< on visible occurrences: DEFINITION
2.32 {Local causality). The relation ;< c (O x O) is given by:
e <€' <<=> ^ = ^^ or 3 e" such that ee" = e'. We know that ^ is a partial ordering. We call :< local causality because it connects occurrences within the same parallel component: e <e' =^ loc{e) <^ loc{e'). Let e < e' stand for {e <e' Sie^^ e'). For ^ G O, we define ie = [e' \ e' < e) to be the set of local causes of e. Then the causal path of e is the sequence of such causes: T>E¥\mT\on2.?>3 {Causalpath). Vox e e O,path{e) =^Q{e\ = \.e and ei < ^,-f 1, I ^i
^„, where {^i,..., ^,2}
For instance, ife = Oa lObl Ic, then ie = {Oa, Oa \0b} and path{e) = {Oa) • {Oa lOb).Wt call e eO a.n initial occurrence if J,^ = 0 (equivalently/76(//2(^) = e). An initial occurrence has always the form e = loc{e) • X{e). More generally, \i rj' <^r] and r]lrj' is the residual of Tj after ri\ defined by r]lri' = r]" if 77 = r]'r]'\ we have the following characterization for visible occurrences: FACT 2.34. An occurrence e e O is completely determined by its label, location and causal path. Namely, ifX{e) = a, loc{e) = r] and path{e) = e\ Cn, n^ I, the occurrence e is given by e = {loc{e\) • k{e\)) • {loc{e2)/loc{e\) • X{e2)) {r]/loc{e,j) • a). If path{e) = e then e = r} -a. Note that loc{e) may be seen as the static location of an occurrence e, while path{e) • X{e) represents its dynamic location. We define now the relation of concurrency on visible occurrences: DEHNITION
2.35 {Concurrency). The relation ^ C (O x O) is defined by:
{
either or
e = aOeo & e'= a\e'^y, e— aleo & e'^crOe^Q,
where or e (AcrU {0,1})*, eo,e' e O.
982
/. Castellani
Clearly, the relation ^ is symmetric and irreflexive, and e ^ e' <=» loc{e) o loc(e'). The occurrences e will be the labels of the occurrence transition system. Let us now shift attention to the states of this transition system. As we said, these states are meant to represent processes with a past. The past records the observable guards which have been passed along a computation. Formally, the set S of computation states is given by: § ::= nil\ fi.p\
p-^q\x
\ recx. p \a.H \ (^ | §') \ H\ct I § ( / )
where p,q e CCS. The construct ^.^ is used to represent the state § with "past" a, that is, after a guard a has been passed. The idea is that any transition labelled by a visible occurrence will introduce a "hat" in the resulting state. The basic operational rule is: (01)
a.p
-^a^.p.
On the other hand an invisible occurrence r does not leave any trace in the past. This is expressed by the rule: (OV)
T./7^>/7.
The hats recorded in states are used to build up "deep" occurrences along computations, according to the rule: (02)
^-U^\
e:^T
=> a.^^^^.^\
Occurrences of the form /^, for / = 0, 1, originate from parallel terms § | ?':
(03) ^-ur,e^T =^ ^i^'^i'ii",^"i^-i^nr. For defining the whole occurrence system we need a few more notations. First, we extend action relabellings / to occurrences by letting: f(ae) == f{a)f{e) and f{ie) — if(e) for / = 0 , 1 . Moreover, we shall use an auxiliary function for defining the communication rule. In the occurrence system communication arises from concurrent occurrences with complementary labels. However the resulting r-occurrence should not contribute to the past, since this only keeps track of observable actions. Thus we need to take back the hats introduced by the synchronizing occurrences. To this end we introduce a function (5^(^), which erases the hat corresponding to occurrence ^ in ^ (somewhat similar to the function Ak(p) used in Section 2.4). The partial function 8:(0 xS)-^ S is given by: ^ai^-p) = P,
Sf(e)(Hf))
=
Se(^){f).
Process algebras with localities
983
We have now all the elements to define the occurrence system for CCS. The rules specifying this system are listed in Figure 3. Note that the condition X{e) ^^ {a, a] in rule (06) could be strengthened to proj^^^^^^{e) = e, to prevent transitions like a^.b.p - ^ a^.b.p. However this would make no difference for states § obtained via an occurrence computation from a CCS term (more will be said on this point below). The weak occurrence system is now given by:
•r
3|o, • • • - §«, w ^ 0 such that $ = ?o - ^ ti 3^1,^2 such that I = > $i f2=^r.
l»=l'
Let us examine some properties of this weak occurrence system. It is clear that any term § gives an intensional representation of a CCS computation state. In fact from each state ^ one may extract the set of visible occurrences that have led to it. Obviously, this set should be empty for a CCS term. Formally, the set of past occurrences of a term § is defined by: occ{p) = 0,
ifpeCCS,
occ(a.^) = {a}Ua ' occ{$), occ{^ I §') = 0 • occi^) U 1 . occ(^'), occ{^\a) = {e e occ(^) \ X(e) ^^ a, a), occi^if)) = f{occ{^)). For states ^ reachable from a CCS term, the clause for restriction reduces to occ{^\a) = occ{^). In fact, one may easily verify that such states, what we shall call CCS computation states, are exactly those § whose subterms ^\a satisfy a , a ^ X{occ{^')). Moreover for a CCS computation state ^ each relabelling / is injective on occ(^) (this justifies, for instance, the last clause in the definition of the function 8 above). REMARK
2.36. If 5^(§) is defined, then occ(8e(^)) = occ(^) - {e}.
The next statements explain how visible occurrences are generated along computations, and how they are related. LEMMA 2.37. Let ^ be a CCS computation state. Then:
(1)
^--^^\
(2)
^-^^'
e^T
\(\)occ{H') = occ{H)^{e]. =^ \(\\)^e'eocc{^)\ e' <eore' I (iii) | e C occ{^).
^occ{^')
2.38. Let pe CCS. (1) Vr. occ{^i) = [ex,...,ei}.
COROLLARY
(2) i < j =^ a < Cj or Ci ^ Cj.
^e),
= occ{^).
lfp=h^\-"
$„, where V/: Cj ^r, then:
984
/. Castellani
The following proposition shows how local causality may be recovered from static locations along a computation: PROPOSITION 2.39. Let pe CCS. if p z:^ ^i • - - J^
§„, where V/: ei ^ r, then:
ej < ej 4=^ i < j and loc{ei) 4C loc(ej). PROOF. (<=) Since / < y, by Corollary 2.38 either ei < ej or ei ^ ej. But it cannot be ei ^ ej, since this would imply loc{ei) o loc{ej). Thus ei < ej. (=^) Ifei < ej, then it cannot be j < /, because of Corollary 2.38 again. Moreover, since ei is a prefix of ej, also loc(ei) is a prefix of loc{ej). D
We proceed now to define a notion of bisimulation on the weak occurrence system. Once again we use a notion of consistency and progressive bisimulation family. DEFINITION 2.40. A consistent occurrence aliasing is a partial injective function g:0 ^^ O which satisfies, for any ^, ^' on which it is defined: (i) X{e) = X{g{e)). (ii) e' <e^^:^g{e')
2.41. ^progressive o-bisimulation family is a ^-indexed family of relations
over S,R = {Rg\ge
Q), such that if $o/?g?o ^^^^ ^^^ ^^^ ^ ^ ^ •
(1)§0^§1 ^
3^\§;suchthat§(;^§f,
gU{(^,e')}€^and?i/?,u{(.,.')}?;-
(2)§(^^§; ^ (3) § o ^ ^ i ^ (4) §(^ ^ §; ^
3^,§, s u c h t h a t § o = ^ ? i , gU{(^,^')}eaand§,/?,u{(...')}?[. 3§;G5suchthat §^ ^ §[ and ^i/?,?;. 3 5, G 5 such that §0 ^ §1 and §i /?,?;.
These relations induce an equivalence ^^^^^ on CCS processes as follows: DEFINITION 2.42 {Equivalence on the occurrence system). For any p,q ^ CCS, let p ^(^^^ q iff pR^/^q for some progressive o-bisimulation family R = {Rg \g ^G]The reader famiUar with the notion of history preserving bisimulation (cf., e.g., [75]) may have noticed the similarity with our definition of ^^^^^. In fact history preserving bisimulation is itself a "progressive" notion, and it is clear that a consistent occurrence aliasing g is nothing else than an isomorphism between two partially ordered sets of occurrences. In Section 3.3 we give a formal definition of local history preserving bisimulation on the occurrence system (so-called because the ordering is that of local causality), and show that it is a direct reformulation of the equivalence ^^^^'^'. The preorder £ ^^^ is obtained using the same definition, after weakening the notion of consistency as follows:
Process algebras with localities
985
2.43. A right-consistent occurrence aliasing is a partial injective function g'.O ^^ O which satisfies, for any e, e' on which it is defined: (i) X{e)=\{g{e)). (ii) g{e') < g(e) ^ e' <e. DEHNITION
The main result, presented in the next sections, is that the equivalence ~^^^' coincides with both ^\ and ^^, and similarly that £ ' ' ' ' coincides with both £ | and £ '^. The proofs rely on the above properties of the occurrence system, and on proving conversion lemmas between the different kinds of transitions. Most of these proofs will be omitted or only outlined. The reader is referred to [38] for a full exposition. 2.6.2. Occurrence semantics — static location semantics. We establish here the relationship between ^^'^^ and ^^. We saw in Section 2.4 that ^\ can be defined in terms of canonical distributions. We recall that these are distributions always associating location 0 to the left operand and 1 to the right operand of a parallel composition. Let GDIS denote the set of these canonical distributions, and ??, ^ € {0, 1}* range over canonical locations. With each state f, we associate a distributed process dis{^) € GDIS as follows: dis(^) = ^,
if ^ = nil or § = Jc,
dis{a.p) = a. dis(p), dis(p -{-q) = dis(p) -f dis(q), dis(recx. p) = recx. dis(p), dis(a.^)
=dis(^),
dis(^\^')=0::dis(^)\l::dis(^'), dis(^\a)=dis(^)\a, dis(^{f))=dis(^){f). Thus dis(^) is the canonical distribution of the GGS term underlying ^. We can now give the conversion lemma between occurrence transitions and static location transitions: 2.44 (Gonversion: static <^ occurrence). Let p, p' e GDIS and^, ^' € S. Then: (i) ^ ^ r =^ dis{^) ^ s disin (ii) p = ^ , p' => V^ such that dis{^) = p 3 ^ ' such that ^ :=^ ^' and dis{^') = p .
LEMMA
(iii) ^ ^ ^ '
^ dis(^) =>s dis{^'), where a = X{e) and r] = loc(e).
(iv) p =^s p' ^
V$ such that dis{^) = p 3e,^' such that X(e) = a, loc(e) = T],
dis{^') = p' and § =^ ^'. Using Lemma 2.44 and Proposition 2.39 we may now prove our equivalence result. THEOREM2.45. For any p,q e CCS:
p^lq
986
/. Castellani
PROOF OUTLINE. (=») Suppose p ^\ q. and let S = {5<^ | (^ G 0} be a progressive bisimulation family such that dis(p) Si/^dis{q). Define a ^-indexed family of relations R = {R^ I g G ^} as follows:
(^, $') G Rg <^==> there exist occurrence transition sequences
^ ==^ So =^
=^ S„ — ^
such that (1)
g=
[{e\.e\)^...Aen.e\,)]
(2)
J/^(^) 5<^ dis{^'), where <^ = {(/oc(e), loc(e')) \ (e, e') G g).
Clearly (/?, ^) G /?0. It may be shown that R is a progressive o-bisimulation family. ( ^ ) Suppose p ^^^^ q, and let R = {/?(, | g G G} be a progressive o-bisimulation family such that pR^q. Consider the family S = {S^p\(p e0} of relations over CDIS given by: (r, s) G Sep
dis(^) = r,
disi^')=s,
(2)
^ = {(/oc(^/),/oc(^;))|l^/^«},
(3)
§/?,r
forg = { ( ^ , , ^ ; ) | l ^ / ^ « } .
It may be shown that S is a progressive bisimulation family.
D
Using a variation of this proof, a similar result can be established for the preorders: THEOREM 2.46.
For any p,q e CCS: p^'^q
<^=^
P^^'^'q-
This concludes the comparison between the static location semantics and the occurrence transition semantics. 2.6.3. Occurrence semantics = dynamic location semantics. We turn now to the relation between ^^^" and ^f. To establish the coincidence of the two equivalences, we will use a property of ^^ which was first pointed out by Kiehn in [100], namely that ^^' only depends on computations where distinct atomic locations are chosen at each step. We start by recalling some definitions and results from [29]:
Process algebras with localities
987
DEFINITION 2.47. A location renaming is a mapping p: Loc -> Loc*. For any/? € LCCS, let p[p] denote the process obtained by replacing all occurrences of I in p with p(/), for any / e Loc.
We use the notation P{M//} for the renaming which maps / to u and acts like p on Loc \ {/}. Also, we shall abbreviate p[id{u/l]] to p{u/l}. In what follows, we shall mainly consider alphabetic renamings p: Loc -> Loc. Note that any partial function / : Loc -^ Loc may be seen as a location renaming p: Loc -> Loc, by letting:
'^
fi\ —\ ^ l/(/)
^^ /(^) ^^ ^^^ defined, otherwise.
For instance the empty function 0 corresponds to the identity renaming id. In the following we shall freely use the renaming notation p[f] whenever / is a partial function / : Loc -^ Loc. The following lemma relates the transitions of p[p] with those of p. 2.48. Let p eLCCS. Then for any alphabetic location renaming p . Loc -^ Loc: (1) (a) p -^d p' =^ 3v such that p{u) <^ i; and p[p] -^d p[p\
LEMMA
(b) p ^d p' => p[p] =^d p[pl (2) (a) p[p] -^d p' ^3u, p" such that p(u) < u, p"[p] = p' and p -^d (b) (3) (a) (b) (4) (a)
p"•
p[p] =^d p' ^ ^ p" such that p"[p] = p' and p =^d p"• p -^d p\ I ^ Locip) ^ Wke Loc, p[p] -^d p'[p{k/l}l where v = p(u). Same as (a), with weak transitions. p[p] -^d p' => 3w such that p{u) = v and V/: ^ Loc{p)3p' such that
p"[p[llk]^ = p' andp^dP"^ (b) Same as (a), with weak transitions. We recall now Kiehn's definition for ^^, and show that it is equivalent to the original one. NOTATION
2.49. Let LCCS^ be the set of LCCS processes whose atomic locations are all
distinct. 2.50 (v-dynamic location equivalence). A relation R c (LCCS" x LCCS'^) is a v-dynamic location bisimulation (v-dlb) iff for all (p, q) e R and for all a e Act, u e Loc*: DERNITION
(1) p=f^d p\l^Loc{p)ULoc{q)
^ 3q' suchihaiq ==>d q' ^r\d {p\q') e R.
(2) q ==^d q\ I ^ Locip) U Loc(q) ^ 3 p' such that p ==>d p' and {p , q) e R. (3) p=^d p' =^ 3q' suchihsitq:=^dq' 2^r\d{p\q')eR. (4) q =^d q' =^3p' such that p =^d p' and {p\ q') e R. The largest v-dlb is called y-dynamic location equivalence and denoted ^^'.
988
/. Castellani
FACT 2.51. For any processes p,q e CCS: p ^^j, q 4 = ^ P ^\ Q-
The =^ direction is trivial. For the ^ direction, Lemma 2.48 is used in a straightforward way. D PROOF OUTLINE.
We proceed now to show that ^ ^ " = %^'. To do this, we need to estabhsh a conversion between occurrence transitions and dynamic location transitions. We start by converting terms § into LCCS terms which represent the same state of computation. The idea is to replace every "hat" in ^ by a canonical atomic location representing uniquely the corresponding occurrence. The simplest way to do this is to take the occurrences themselves as canonical (dynamic) locations. We shall then assume, from now onwards, that O c Loc. We also introduce, for any y € Act U {0, 1}, a renaming py which prefixes by Y all the occurrences appearing as locations in /?, namely Py{e) = ye. Then the canonical LCCS process proc(^) corresponding to a computation state ^ e S is defined by: /7roc(?)=§,
iff 6 CCS,
procia^.^) = a ::proc(^)[pa], proc(^ I f') =proc(^)[po] proc(^\a)
\proc(^')[pil
=proc(^)\a,
proc(^{f))=proci^)[f]{f)Note that in the last clause the first / is a location renaming, while the second is an action relabelling. We have for instance: proc(a.b.nil \ c.nil) = Oa :: Oab :: nil \ c.nil. Similarly, if / is the relabelling given by f(a) =a\, f(b) = b\, f{c) = c\, thenproc{(a.b.nil \ c.nil)(f)) = (Oa :: Oab :: nil \ c.nil)[f]{f) = Oa\ :: Oa\b\ :: nil \ c\.niL It can be easily checked that Loc(proc(^)) = occ(^) and proc(^) e LCCS''. We give next the conversion lemma between occurrence transitions and dynamic location transitions, followed by the coincidence result: LEMMA 2.52 (Conversion: dynamic ^ occurrence). / / $ , ? ' € 5 , f:occ(^) -^ Loc, then: (i) § = ^ r =^ proc(^)[n ^clproc(^')[fl (ii) proc(^)[f] ^d p' ^^H' such thatproc(^')[f] = p' and f ^ ^'. (iii) 5 = ^ §' =^ V/ G Loc : proc(^)[f] =fd proc(^')[f{l/e}l where a = X(e) and u = f(path(e)). (iv) proc(^)[f] ==^d p' =^ ^e, ^' such that X(e) = a, f(path(e)) = w, § ^ §' and proc(^'){f{ile}] = p'. THEOREM 2.53.
For any p,q e CCS: p ^"'''' q <=» p ^i
q.
Process algebras with localities
989
PROOF OUTLINE. (=^) Let p ^ ' ' " q. Then there exists a ^-indexed family of relations R = [Rg \g eQ} such that pR^q. Define a relation S on processes by:
(r,s) e S <=^ there exist occurrence transition sequences
and there exist two functions: f]:{e\,...,en}^
Loc,
/2 : {^p . . . , <,} ^ Loc
such that (1)
V / G { l , . . . , n } : / i ( ^ , ) = /2(^;),
(2) proc(^)[fi] = r,proc(^')[f2] = s, (3)
§/?,r
forg = {(^1,^;),..., (^,„<)}.
It may be shown that 5 is a dynamic location bisimulation. ( ^ ) to prove this direction, we use the alternative definition ^J' of dynamic location equivalence. Suppose p ^l q. Define a ^-indexed family of relations R = {7?^, \g ^Q] as follows: ($, ^') G Rg ^^=^ there exist occurrence transition sequences P =^ ?o = ^ • • • => ?// = ?
such that (1) (2)
g = {(^i,^;),...,(^,„^;,)},
3 injection/ :{e\,...e'^j} -^ Loc such that: proc{^)[f o g] ^\
proc{^')[fl
Note ihdii proc{^)[f o g],proc{^')[f] e LCCS^', given that / and g are injections. Also, it is easy to see that (/?, q) e R^, since proc(p)[0] = p and proc(q)[0] = q (recall that the partial function 0 corresponds to the identity renaming id ). It may be shown that K — {Rg\geQ}hdi progressive o-bisimulation family. D We state now the analogous result for the preorders. To prove C d
r— occ /7 =b. 77 I—
n
990
/. Castellani
For each e eOx let - ^ c (5 x 5) be the least binary relation satisfying the following axioms and rules. (Ol)
a ^ a.p —> a.p
(Ol')
T.p-^
(02)
?-^r,
e^T
(03)
?-^r,
e^r
p
^ir'^n?" r'i?-^?"ir
(02')
?-^r
=^a4-^a.^'
(03')
? -^ r
^ ^ I r' ^> ?' I r' i"i?-^?"ir
(04)
^^ and
^0'
! i _ ' M ^ ?o I ?i ^
X{eQ) = X{e\)
5.o(?o) I ^^.(?i)
j
(05)
/7-^^
^p^q^^^
(06)
? - ^ ^\
(07)
?^r
^?(/)-^r(/>
(08)
/7[r^cjc. p / x ] - ^ ^
=> r ^ c x . / ? - ^ ^
X{e) i {a, a} ^ ^\a -U ^'\a
Fig. 3. Occurrence transition system. one uses a preorder £ (the obvious variant of ^J') in place of £ ^. The proof is an easy adaptation of that for the equivalences. THEOREM 2.54.
For any p,q
e CCS:
/? £ ^ ^ <^=)> p £ ' ' "
^.
This concludes our comparison between the dynamic location semantics and the occurrence transition semantics. Putting together Theorems 2.45 and 2.53, we obtain Theorem 2.29 (1), stating the coincidence of ^l and ^^. Similarly the coincidence of ^ ] and £ ^^, stated in Theorem 2.29(2), follows from Theorems 2.46 and 2.54.
Process algebras with localities
991
In the light of these results, the location equivalence and preorder will be simply denoted ^i and £ ^ in the following, unless an explicit reference to their specific definition is required.
3. Extensions and comparison with other approaches We compare here the location semantics presented in the previous Section with other noninterleaving semantics that have been proposed for CCS in the literature, all based on variations of the notion of bisimulation. An extension of the location semantics to the ncalculus is also presented in Section 3.4. This section is mainly addressed to readers with a keen interest in understanding the various noninterleaving semantics for CCS. The reader preferring to keep to the main exposition of location-based semantics may safely skip to Section 4.3, which surveys more recent approaches to process algebras with localities. To carry out our comparison we will rely on the local/global cause transition system of Kiehn [100], which records both local and global causes of actions along computations. This is a convenient formalism for our purpose, as it brings together the ideas of distributed and causal semantics. Intuitively, distributed semantics deal with local causality, which is induced by the structure of terms, while causal semantics are concerned with global causality, which is determined by the flow of control of computations. We shall see in fact that both the location semantics of [29] and the causal semantics of [51] can be characterized as particular instantiations of the local/global cause-semantics. As announced already in Section 2.2, distributed and causal semantics are in general incomparable. However they coincide over the communication and restriction-free fragment of CCS, a class of processes often referred to as BPP (Basic Parallel Processes). This convergence result, first proved for finite processes in [100,3], has been recently generalized to recursive BPP processes by Kiehn [97]. For easy reference we recall here the syntax of BPP: p ::= nil \ li.p \ (p \q) \ (p-\-q) \x \ recx. p. In BPP, communication is not allowed in parallel composition. The same language, where communication is allowed, is referred to as CPP (Communicating Parallel Processes). We will use BPPf (respectively CPPf) to denote the finite fragment of BPP (respectively CPP). We start by introducing the local/global cause transition system, which will serve as our reference model in this section.
3.1. The local/global cause semantics We present here the local/global cause (Igc) transition system, which was proposed by Kiehn in [100] (and further studied in [97]) as a unifying framework for studying distributed and causal semantics. This transition system also provides a new, stronger semantics arising from the joint observation of local and global causality. The /^c-semantics is defined on an extended syntax, which we call here LGCCS. This includes, besides the operators of CCS, a construct of cause prefixing {A, F) :: p, where
992
/. Castellani
A and F represent the sets of local causes, respectively global causes, of the process p. Intuitively, these causes have been generated along the computation leading to state p. Local causes correspond to actions witch precede p via the standard prefixing operator, while global causes may also be inherited from another component by means of a communication. Thus yl c r . A CCS process p is identified with the extended process (0, 0) :: p. Formally, A and F are sets of pairs of the form («,/), where ^ is a visible action in Act and / G N. For simplicity, a pair {a J) is rendered as ai (this will imply ai ^ aj for all / ^ j). We let K = {at \a e Act, i e N) be the set of all causes. By construction /C n Act = 0. We extend the complementation function to causes by setting (^, /) = («,/). We also use /CL(/?), respectively KQ{P), to denote the set of causes occurring in some A, respectively r , inside p. Finally, we let lC{p) = fC^ip) U JCcip) denote the set of all causes occurring in p. Note the formal similarity between cause prefixing {A, F) :: p and location prefixing /::/?. In fact the semantics will operate much in the same way as the location semantics, exhibiting the causes of actions in transitions. These transitions have the general form p ^—:—> p'^ representing an occurrence of action a with set of local causes A and set of global causes F. The most notable difference with the (dynamic) location semantics is in the rule for communication, which propagates the global causes of each communicating process to the other partner. Again, causes are only assigned to visible actions. Thus rtransitions have the form p —^ /?' and are inferred using the standard rules of CCS. Formally the semantics is given by the rules in Figure 4. We write p - ^ p' when the actual label of the transition is not important. In the communication rule (LG4) the notation {Fg/ai} is used to indicate the cause replacement of ai by T^ in p': this is the process obtained by removing A, from all local cause sets occurring in p^ and replacing ai by the elements of Fg in all the global cause sets in p\ Based on these transitions, one has the following notion of/gc-bisimulation: 3.1 (Local/global cause bisimulation). A relation R c LGCCS x LGCCS is a local/global cause bisimulation (/gc-bisimulation) iff for all (p, q) e R and for each label obs G {r} U (/C x 2^ x 2^): (1) p - ^ p' =^ 3q' such that q - ^ q' and (p\ q') € R. (2) q-^q' ^3p' such that p - ^ p' and (p\ q) e R. The largest /gc-bisimulation is called local/global cause (bisimulation) equivalence and denoted ^egc DEHNITION
Local/global cause equivalence requires the equality of both local and global causes in matching transitions. If this condition is relaxed by allowing obs = ai, (A, F) to be matched by another label obs^ = aj, {A, F'), one obtains a weaker equivalence notion called local cause equivalence and denoted by ^u-- Similarly, if obs = ai, {A, F) is allowed to be matched by obs' = ai,{A', F), one obtains a weaker equivalence called global cause equivalence and written ^^^. In [100] a parametric definition is given in place of Definition 3.1, where labels obs are filtered through an observation function. Then the three equivalences ^igc, ^tc and ^^^, as well as the ordinary bisimulation equivalence ~ , can be obtained as special instances of this parametric definition. In fact, the easiest way to
Process algebras with localities
(LGl)
993
ai i ICip)
a.p^^^^^!^{[a,]Aai))::p
(LG2)
p "•^^'•^\p'^(A,r)::p
(LG3)
p
V p\
"••<^u^'^^^'>> {A,r)::p'
ai i JCiq) => p\q
- ^
^ p Iq
q\p
P (LG4)
'—^p,q-^
ai^fC(q),
ohs
P
^P
q\p
-^^q P\q-^
aj^JCip).
JCLip)nK:L{q)
(LG5)
>
Pi^q/ai)
I
q'iPp/aj]
= ^
t
,
ohs
.
ohs
' p^q
/
>p
I
q + p —> p
(LG6)
P
—^p
p\oi
ai.{A,,Tc)
, > p \a
a ^ {of, a ) , Fq n {a, a} = 0
(LG7)
P
^-^
,^^^^/uo..(/(..)./(r,))^.^^^
P
fia)j^IC{p{f))
(LG8)
r
p[recx.
/ 1
p/x]
/
ohs
>p
recx. p
ohs
t
>p
Fig. 4. Local/global cause transitions.
Transitions p — ^ p' are inferred from (LG4) for communication, from the standard rules of CCS for the remaining operators, and from the following rule for cause prefixing: (LG9)
pJL^p'
^
(y^, r)::p-^
{A, F) :: p'
Fig. 5. Rules for r-transitions.
994
/. Castellani
look upon /c-equivalence and gc-equivalence is to regard them as the bisimulations associated with the reduced /gc-transition system where cause prefixing {A, F) :: p is replaced hy Av. p and F :: p respectively (and the operational rules are simplified accordingly). We shall call these reduced transition systems the /c-transition system and gc-transition system. The weak /gc-transitions are derived from the strong transitions in the standard way, and induce notions of weak /gc-equivalence, weak /c-equivalence, and weak gc-equivalence, denoted respectively ^tgc. ^tc and '^gcWe recall from [100] the main results concerning these equivalences. The first is a simple consequence of the definitions. PROPOSITION
3.2. Let p,q e LGCCS. Ifp ^tgc q then p ^u- q and p ^gc q-
The reverse of this proposition is not true. The following example, taken from [100], shows that ^tgc is strictly finer than the intersection of ^u- and ^^,c . EXAMPLE 3.3. For the following processes p and q, we have p ^u- q and p ^gc q but
not
p^tgcq: p = a\b.c + (a.y \ y.b.8 \ 8.c)\y, 8,
q = p + (a.y \ y-b.c)\y, 8.
In [100] it is also shown that local cause equivalence and global cause equivalence are incomparable, even on the simple sublanguage without restriction: PROPOSITION
3.4. Let p,q e LGCCS. Then p ^u- q ¥^ p ^gc q^ and p ^gc q ^
P^tcq^ The proof is given by the example: EXAMPLE 3.5.
{a.y\y.b)^a.b
tl'
{ci.y\y.b)^
^gC
(a.y I y.b) + (b,y \ y.a) -^o\b
J^" {a.y \ y.b) -h (b.y \ y.a).
On the other hand, the two equivalences coincide when no communication is allowed. This is expected since the only rule that differentiates the /c-transition system and the gctransition system is the rule for communication. PROPOSITION
3.6. Let p,qe BPP. Then p ^u- q <=> p ^gc q-
In fact this coincidence already holds for the strong equivalences ^tc and ^gc. The main results of [100] are the characterizations of location equivalence ^^ and causal bisimulation ^c [51] for CCS processes, respectively as the local cause equivalence ^tc and the
Process algebras with localities
995
global cause equivalence ^gc. We simply state here these results, referring to Kiehn's paper for the proofs. PROPOSITION 3.7 (Characterization of location equivalence). Let p,q e CCS. Then p^tq <=» p ^u- qPROPOSITION 3.8 (Characterization of causal bisimulation). Let p,q e CCS. Then p ^c q <=^ p ^gc qA couple of comments may be helpful here. As regards Proposition 3.7, we noted already the similarity between the /c-semantics and the location semantics. This becomes even more evident if we consider the /c-transition system to be given by the rules of Figure 4 where (71, T) :: /? is replaced by just A\\ p. There remain some differences though: in the location transition system locations are not required to be new at each step;^^ moreover, local causes (locations) are recorded together with their occurrence ordering, while in the /c-transition system they are just collected into a set. In fact for general LGCCS processes location equivalence is finer than /c-equivalence. For instance, using / :: /? as an abbreviation for ({/}, 0) :: /?, the two processes / :: k ::a and / : : : / : : a are local cause equivalent but not location equivalent. Indeed, the fact that ^t = ^tc for CCS processes does not mean that the occurrence ordering of causes is immaterial here, but rather that for cause-free processes this ordering is already accounted for by the bisimulation relations. The relationships between the gc-transition system and the causal transition system of [51,52] will be discussed in Section 3.3, where causal bisimulation is reviewed.
3,2. Comparison with other distributed semantics We examine here how location equivalence relates to an earlier version introduced in [28], called loose location equivalence. We also compare it with distributed bisimulation ([39, 37,98,48]), the first distribution based equivalence proposed in the literature, and with the local mixed-ordering equivalence of [ 171,117]. We shall arrive at the following picture for distribution based equivalences: for finite restriction-free processes of CPPf they all coincide; on the whole language CCS, distributed bisimulation equivalence and loose location equivalence are incomparable, and both are weaker than location equivalence and local mixed-ordering equivalence, which coincide. 3.2.1. Loose location equivalence. We start by comparing the dynamic location equivalence ^ ^ with its earlier formulation given in [28]. While the definition of the two equivalences is formally the same, the underlying location transition systems are slightly different. Transitions in [28] are more general in that the location allocated at each step is a word u 6 Loc"" instead of an atomic location / e Lac. To avoid confusion the transitions of [28] ^^ We have seen already in Section 2.6 that the location equivalence and preorder for CCS processes do not change if new locations are created at each step. Indeed, this was established by Kiehn in [1001 precisely for the purpose of comparing location equivalence with /c-equivalence.
996
/. Castellani
will be called loose location transitions, and denoted -^. For the loose transition system the rule (Dl) of Figure 2 is replaced by (LDl)
a.p-^uv.p
ueLoc*.
The rules concerning the other process constructors, the r-transitions and weak transitions are the same as for the dynamic location transition system of Section 2.5. We denote the weak loose transitions by p St p'. The location equivalence based on these transitions is u
called loose location equivalence and denoted :^£^ Although the difference between (Dl) and (LDl) may seem quite inoffensive (and indeed it was thought to be so when the formulation in [28] was chosen), it turns out that the loose transition system gives more freedom for relating process behaviours. While for the location equivalence ^£, based on atomic allocation, we implicidy require the equality of the last allocated locations, this is not true for loose location equivalence. The latter can introduce more than one atomic location in one step and thus is able to fill up "missing locations". The following example (due to Rob Van Glabbeek) shows that loose location equivalence ~££ can equate processes which are distinguished by location equivalence ^£. Let p and q represent respectively the processes (/:: a \ a.b)\a and (/:: (a +b)\ a.b)\a. Then the move of q (/:: (a-hb)\ a.b)\a -^
(/:: k :: nil \ a.b)\a
which is also a loose move, can only be matched by a loose move of /?, introducing the location Ik in one step: (/:: a \ a.b)\a ^ (/:: nil \ Ik :: nil)\a. Indeed we have p ^n q but p^t q- This also implies that the CCS terms {a.a \ a.b)\a and (a.(oi -\~b) \a.b)\a are loosely location equivalent but not location equivalent. Now, intuitively it is not desirable to equate these processes, since in the first process action b is not locally dependent upon action a. From this example we see that the two location equivalences are different for CCS terms. However the property of filling up "missing locations" only comes into play when processes containing the restriction operator are considered. It can be shown, in fact, that for finite restriction-free processes the two equivalences coincide [29]: PROPOSITION 3.9. Let p,q e CPPf. Then p :^n q <=» P ^i q-
On the full language, on the other hand, location equivalence is finer than loose location equivalence. PROPOSITION
3.10. Let p,q e CCS. Then p^^q=^
p ^^^ q-
Process algebras with localities
997
In conclusion, ~£ is stronger than ^^ti and captures more precisely the intuition about local dependencies. This explains why in [29] the first formulation of location equivalence —a was abandoned in favour of ^t. The interested reader is referred to this paper for more details on these results. 3.2.2. Distributed bisimulation. We now turn to the relationship between ^t and distributed bisimulation. Distributed bisimulation was the first attempt to define a semantics for CCS taking the distributed nature of processes into account. It was introduced by Castellani and Hennessy in [37,39] and further studied by Kiehn in [98,97] and by Corradini and De Nicola in [48]. The basic idea is similar to that of location equivalence. The capabilities of observers are increased so that they can observe actions together with the location where they are performed. However, locations are not explicitly introduced here; instead, there are multiple observers which can move from one location to another as the computation proceeds. When observing an action, the current observer moves to its location and appoints a new observer for the remainder of the process. Thus the number of observers increases by one each time a visible action is performed. In this way locations are observed much in the same way as in the dynamic approach, but without assigning names to them. We use here the original definition of distributed bisimulation, as given in [37] for the subset CPPf of CCS. This is based on a distributed transition system where transitions give rise to a pair of residuals, a local residual and a concurrent residual (or remote residual). Intuitively, the first represents what locally follows the action, while the second is the part of the process which is concurrent with the action.-^ We shall give here a slightly different presentation of the operational semantics of [37], which is taken from [98]. We will distinguish the local residual by including it in brackets [ ] , as for instance in {a.nil I [b.nil]) \ c.b.nil. The syntax for "processes with a local component'' is given by the following grammar, where p stands for any CPPf-term, Pv.= [p]
\{P\p)\{p\P).
Let P [ ] denote this language. We use C [p] ,V[q], ...io range over 7^[ ]. In C [p], p is the local process and C is its context. For example in {a.nil \ [b.nil]) \ c.b.nil the local process is /? = b.nil and the context is C = {a.nil \ .) | c.b.nil. We also use the notation C{p) to represent the CCS process obtained by simply embedding p'mC without the [ ] brackets. Processes in 7^ [ j are used to exhibit the location associated with the last visible action. Visible transitions have the form p -^d C[p']. The observer who sees action a moves to its location, and from then onwards only observes the local component p'. The newly appointed observer takes care of the remote component C{nH). The rules for (strong) distributed transitions are given in Figure 6. These rules apply only to restriction-free terms. Weak transitions are derived by the rule
(WD) p^px-^dC[p]^V[p"]
implies
26 An alternative formulation in terms of local and global residuals was proposed in [39].
p^,iV[p"].
998
/. Castellani
For each a eAct let - ^ j c (CPPf x V^ -] ) be the least binary relation satisfying the following axiom and rules. (Dl)
a.p-^d
[p]
(D2)
p-^^C[p']
implies
p-i-q-^dC[p] q-^p-^dC[p]
(D3)
p-^dC[p]
implies
p\q-^dC[p]\q q\p-^dq\C[p']
Fig. 6. Distributed transitions.
where transitions C[p'] = ^ V[p"] are defined in the usual way from the transitions —^, which in turn are based on the relations - ^ given by the standard operational rules of CCS together with the rule: (D4)
p^p'
implies
[p] ^
[p].
For example we can derive {a\a.b)\c.b
-^d
{a I a.b) I c.b =^d
(a\
[b])\c.b
(nil \ nil) \ [nil].
The main difference between the location and the distributed semantics does not lie in the underlying transition systems but in the way the equivalences work; in the first case observing a location results in assigning a name to it, while in the latter it results in splitting the process into a local part and a remote part. Note however that in the distributed case we have at each step only two "locations", while in the location semantics the number of locations appearing in a computation state is unbounded. 3.11 {Distributed bisimulation equivalence). A symmetric relation R C CPPf X CPPf is called a distributed bisimulation iff /? c D(R) where (p, q) e D(R) iff (1) p =L^ p' implies q =i=^ q' for some q' 6 CPPf such that (/?', q') e R. (2) p^^C[p'] implies ^ ^ , / 7 : > [ ^ ' ] for some r>[(7'] eV[ ] such that (p',^') G Rmd(C(nil),V{nil))eR. Two distributed processes p and q are said to be distributed bisimulation equivalent, p ^d q, if there is a distributed bisimulation R such that (p, q) e R. DEHNITION
As an example of non-equivalent processes consider a \ b and a.b + b.a. If a.b -{b.a =^d [^] then a \ b can match this move only with a \ b =^d [nil] I b. So we have to compare the local subprocesses, b and nil, and the remaining ones, i.e., Cinil) = nil and
Process algebras with localities
999
V(nil) = nil \ b. Obviously in both cases the equivalence does not hold. On the other hand we have p = (a\ a.b) I c.b -\-c.b\b ^d {a \ a.b) \c.b = q. For example the transition p = ^ j [b] \b can be matched q =^d nil\b\ [^]; it is obvious that the processes at the current locations are equivalent and so are the remaining processes nil \ b and nil \ b \ nil We next state the coincidence of ^t and ^d on CPPf. The main difference between these two equivalences resides in the fact that distributed bisimulation acts separately on the two residuals of a transition. The crux of the proof is a decomposition property for location equivalence, which allows located terms themselves to be split. This property says that if u \: p\q^tu :\r \s then p ^t r and q ^i s. A proof of this property, as well as of the following coincidence result, may be found in [28]. PROPOSITION
3.12. Let p,q eCPPf. Then p^dq
<=^
P'^tq-
A consequence of this proposition is that results available for distributed bisimulation can be reused for location equivalence. For instance, from [37,39] one gains a complete axiomatization for location equivalence on CPPf, which is significantly different from that given in [29]. In [98] the definition of distributed bisimulation was generalized by Kiehn to all finite CCS processes. We will not give the definition of this generalized distributed bisimulation here, but simply mention that this equivalence is weaker than ^t. This is shown by a rather involved example in [98], which we therefore do not report here. Intuitively the difference between the two equivalences is that distributed bisimulation may "forget" locations which have been observed in previous (not immediately preceding) states. Hence, a transition of some component of one process can be matched by a transition of a component of the other process which originally was "at a different location". This shows that location equivalence is a better choice than generalized distributed bisimulation when looking for an extension of distributed bisimulation to general CCS processes. A further proposal for generalizing distributed bisimulation to full CCS was presented by Corradini and De Nicola in [48]. Here distributed bisimulation is reformulated within the grape semantics of Degano, De Nicola and Montanari, allowing for a more symmetric treatment of the local and global residuals with respect to [98]. The resulting equivalence is finer than Kiehn's one, but still fails to recover the full power of location equivalence. An example is provided to show that the grape distributed bisimulation is coarser than location equivalence. Indeed, as observed by Kiehn in [97], this example illustrates quite clearly that using a pair of locations (which is essentially what distributed bisimulation does) is not enough to capture location equivalence. It is also argued by Kiehn that by suitably generalizing this example, one could show that no finite number of locations would be enough to capture location equivalence. Since Kiehn's example from [98] may also be used to show that generalized distributed bisimulation is weaker than loose location equivalence, which in turn is weaker than location equivalence, the relationships among these three equivalences can be summarized
1000
/. Castellani
as follows: for finite and restriction-free processes of CPPf they all coincide; on the whole language CCS, distributed bisimulation equivalence and loose location equivalence are incomparable, while location equivalence is finer than both of them. 3.2.3. Local mixed ordering equivalence. A notion of bisimulation based on canonical static locations,^^ for a class of asynchronous transition systems modelling a subset of CCS with guarded sums, was proposed by Mukund and Nielsen in [118]. The resulting equivalence notion is essentially the same as the static location equivalence reviewed in Section 2.4. Indeed, this notion was conjectured in [118] to coincide with the dynamic location equivalence ^^, a result which was to be subsumed by those of [38]. Another transition system labelled with canonical static locations, called spatial transition system, was defined by Montanari and Yankelevich for the whole language CCS in [171,117]. Here location transitions are used as a first step to build a second transition system, labelled by mixed partial orders (where the ordering is a combination of temporal ordering and local causality), which is then used to define the behavioural equivalence. This equivalence, a variant of the mixed-ordering equivalence of [55] called local mixed-ordering equivalence, was shown to coincide with location equivalence, applying techniques similar to those used in Section 2.6. In [171,117], the authors also consider the equivalence obtained by ignoring the temporal ordering and retaining only the local causality ordering: this equivalence, which they call abstract location equivalence and provide with some intuitive justification, does not seem to coincide with any other known notion. The local mixed-ordering equivalence is obtained in [117] as an instance of a parametric approach; it thus inherits some general results of this approach, such as a complete axiomatization [66]. We shall not elaborate further on the notions of [118] and [117] here, and refer the reader to these papers for further details. Let us only note that in both cases, since canonical locations can be extracted from the syntax of terms, there is no need to extend the language with a location prefixing construct. A disadvantage of such implicit locations, on the other hand, could be the difficulty of adapting the semantics to allow the placing of several parallel components in the same location (see discussion at p. 31 (in Section 2.5)). Another reformulation of the location semantics of [29] was given by Corradini and De Nicola [48], within the grape semantics of [56]. The resulting equivalence is called maximal distribution equivalence and shown to coincide with location equivalence. In fact, their formulation is conceptually very close to the original one, once it is observed that sequential components themselves {grapes in that approach) can be used to represent localities.
3.3. Comparison with causal semantics We compare here the location semantics, which is designed to reflect distribution in space, with a number of semantics aimed at reflecting global causality. This notion of causality covers both the local causality determined by the structure of terms, and the inherited That is, words over {0, 1}, see the definition at p. 25 (Section 2.4.1).
Process algebras with localities
1001
causality induced by the flow of control among different components, which may vary according to the computations. Semantics which are based on such notion of global causality will be collectively referred to as causal semantics. We shall see that, in general, equivalence notions based on causal semantics, such as pomset bisimulation and causal bisimulation, are incomparable with equivalences based on distribution. This is already apparent from the characterizations given by Kiehn [100], reviewed in the previous section. On the other hand, on the sublanguage BPP all these equivalences reduce to the same one, apart from pomset bisimulation which is less discriminating than the others. 3.3.1. Pomset bisimulation. We relate here the location equivalence ^t and preorder £ ^ with similar notions associated with pomset semantics. This semantics, where transitions are labelled with partially ordered multisets (pomsets) of actions, was studied in [23,24] for a subset of CCS without communication and restriction, essentially the class BPP (in fact, a variation of BPP with full sequential composition in place of action prefixing), and extended to the whole language in [25]. The partial ordering semantics proposed by Degano, De Nicola and Montanari in [59,60,54] were also designed to generate pomset transitions for CCS. On the language BPP, the pomset semantics can be defined directly by means of structural rules. We give the rules for finite processes in Figure 7. Note how rules (P2) and (P5) are used to build pomsets M, u of actions on top of transitions. As an operation on pomsets, prefixing a.u is interpreted as generating causality between a and the actions of M, and parallel composition w | f as generating concurrency between the actions of u and the actions of i;. Tho, pomset bisimulation on BPP, noted ^ponu is just the ordinary bisimulation equivalence associated with this transition system [23]. Weak transitions can then be defined by
(PI)
a.p—> ,
(P2)
P-^
(P3)
11
P
u
p—^
1
a.p'-^p'
t
p-\-q—^p
p
q + p—^ p (P4)
11
f
p—> p
p\q—^ q\p—>q
(P5)
p \q \p
p —> p .q —>q => p\q —> P \q
Fig. 7. Pomset transitions.
1002
/. Caste Hani
restricting to visible actions the pomsets labelling the strong transitions. The corresponding weak pomset bisimulation is written ^pomWe have seen in the previous section that on BPP location equivalence coincides with distributed bisimulation, which in turn was known from [37] to be finer than pomset bisimulation on this language. The following is an example of processes which are distinguished by location (and distributed) bisimulation but equated by pomset bisimulation. EXAMPLE
3.13.
p = a.{b -h c) + (« IZ?) J^
a.(b -^ c) •\-{a \ b)-{-{a.b) = q.
^^ pom
These two processes are pomset bisimilar because the behaviour of the additional summand of ^ can be simulated by p\ the transition q —% b can be matched by the summand {a I b) of p, while the transition q - ^ nil is matched by the first summand of p. Using the result of [37], the situation can be summarized as follows. PROPOSITION
3.14. Let p,q e BPP. Then p^^q
=^ p ^pom q but p ^pom qi^
P'^i
Intuitively, location and distributed bisimulation are stronger than pomset bisimulation on BPP because they also capture the property that matching computations should always be extensions of smaller matching computations. As soon as communication and restriction are introduced in the language, location equivalence becomes incomparable with pomset bisimulation. We have for instance: EXAMPLE
3.15.
p = (a.a-\-b.p \a.b + pM) ^^
(a.a-\-b.p \a.b + p.a)-\-(a
\b)=q.
T'pom
Similar examples were given in Section 3.2 to differentiate local cause equivalence from global cause equivalence (Example 3.5). These examples also hold for pomset bisimulation, replacing ^gc with ^pom- For general CCS processes we thus have the following. PROPOSITION
3.16. Let p,q e CCS. Then p^^q
^ p ^pom q cmd p ^pom qi>
p^t
qLet us now turn to the preorder relations. To our knowledge the first definition of a preorder expressing the idea that one process is more sequential than another was proposed by Aceto in [1] for a subset of CCS. This preorder is based on the pomset transition semantics: one process is more sequential than another, in notation /? £ q, when the pomsets labelling the transitions of p are more sequential than those labelling the transitions of q (this "more sequential than" ordering on pomsets had already been introduced by Grabowski [88] and Gischer [73]). Thus the intuition underlying Aceto's preorder is
Process algebras with localities
1003
different from that of the location preorder £ ., in the same way as pomset bisimulation is different from location equivalence. Indeed, for the preorders we have a similar situation as for the equivalences: the causality-based preorder £ ^^^^ and the distribution-based preorder £ ^ are already differentiated on BPP. The following example, suggested by Aceto and already reported in [29], shows that £ 2 £ ,. Let: pom '*~ ^^ t
p = a.b.c H- CM.b -\- {a q = p-ha.b\c.
\b\c),
Then p £ ^^^^ <7 but /? g, ^ <7 (while we have both q £ ^^^^^^ p and ^ £ ^ p). To see why P ^ i^ consider the move q - % I w b \ c, due to the summand a.b \ c of q. Now p has two ways to match this transition, namely p -j^ I v.b.c and p -j^ I :: nil \ b \ c, but neither of them is appropriate. Another example showing that p £ ^^^^^^ ^ 7^ P £ ^^ is Example 3.13. On BPP, it would be plausible that p ^ ^ q implies p £ ^^^^^^ q (although this has not been shown, to our knowledge). On full CCS, the two preorders £ ^^^^^^ and £ ^ are incomparable. Example 3.15 can be reused here. For the two processes p and q of this example we have ^ £ , P but ^ ^ p. In conclusion we have: PROPOSITION 3.11. Let p,q e CCS. Then p^^q
^
p £ ^^^^^^ q and p £ ^^^^^^^ q 7^
3.3.2. Causal bisimulation. The causal bisimulation semantics was introduced by Darondeau and Degano in [51], and further investigated in relation to action refinement in [53]. The causal transition system is again defined on an extended language. The new construct here has the form K =^ p, representing process p with set of (global) causes K. The set K is the exact analogue of the global cause set F in the /^c-transition system, which in fact was specifically designed to encompass both the causal and the location transition systems. As stated already in Section 3.2, causal bisimulation coincides with the global cause equivalence of Kiehn. Although the language is essentially the same as that considered by Kiehn, the transition systems present a number of differences. The first difference is that causes are introduced here in the form of backward pointers in a computation. A term K =^ p represents a CCS process in some computation state, where it has "accumulated" the causes K. A process in its initial state has the form 0 =^ /?. In K =^ p the set K consists of numbers n,m,... representing the positions of the causes of p (as backward displacements along the computation). This backward referencing requires an updating of pointers at each step, which is not needed in the gc-transition system. Assuming, for the sake of comparison, that backward pointers are replaced by uniquely named causes, as in Kiehn's system, there remain a couple of differences between the two semantics. In the causal transition system the new cause introduced for an action does not
1004
/. Castellani
appear in the label of the transition, but only in the resulting state. Instead of rules (LGl), (LG2), we have the following rule (CI)
K^a.p-^^
KiJ{ai]^p,
ai^K.
Finally, the rule for communication resorts here to an auxiliary transition system, whose transitions have the form P
a.K.K'
f
> P'
Intuitively, the set K' represents new causes which may be inherited from another component via a conmiunication. These new causes are "guessed" by a kind of early instantiation scheme through the rule: (CCl)
K =^ a.p JLJ^
KUK'^p.
Note that no new cause is created here to represent the action a in the rest of the computation. This is because the transitions p -^^^—^—> p' are only introduced in order to be used in the communication rule: (C2)
p
> p ,q
>q
imply
p\q —> p \q .
The remaining rules are essentially the same as in the global cause transition system. Because of these few differences in formulation, the coincidence of ^gc and ^c is not completely straightforward, although intuitively expected. This coincidence allows us to merge results obtained for the two equivalences. For instance, the examples given in Section 3.2 to differentiate local and global cause equivalence may be applied to location and causal bisimulation. A similar example is the following. Let r = {a.a -\- b.p \ a.b -f ^.a). Then r-i-(a\b)
^t r ^t r +a.b. ^,
^,
Note also that {a\b)^t{r\a,P)^,a.b + b.a. These absorption phenomena, respectively of {a \b)'\nr with respect to ~^, and of a.b in r with respect to ^c, clearly show the difference between the two equivalences: the former equates processes with the same parallel structure, while the latter equates processes with the same causal structure. Another interesting example, involving the restriction operator, is the following p = (a.a.c I b.a.d)\a
J^ (a.a.d \ b.a.c)\a = q.
Process algebras with localities
1005
Here p^cq since in both processes actions c and d causally depend on a and b. On the other hand pq^tq since in p action d is not spatially dependent upon action a. One can see that in a distributed view, the "cross-causalities" induced by communication are observed as purely temporal dependencies, while in the causal approach they are assimilated to local causalities. Let us now revisit the mutual exclusion and protocol examples from Section 2. It is easy to see that Mutex ^c MSpec ^c FMutex, because the synchronizations on p, u in Mutex and FMutex create cross-causalities between the critical regions of the two competing processes. The same holds for the protocol example, for which we have PSpec ^c Protocol. Causal bisimulation has been shown to coincide with history preserving bisimulation and with an instance of "NMS equivalence'' in [78]. The coincidence of causal and distributed bisimulations in absence of communication (on BPPf) was also shown in [4]. Finally, causal bisimulation has been studied in relation to action refinement in [52,53]. It was shown to be indeed robust with respect to action refinement. The model obtained by unfolding the causal transition system, called causal trees, has been used to define a direct "denotational" interpretation of CCS terms, which agrees with a standard event structure semantics; it has also been taken as the basis for a complete axiomatization for causal bisimulation [51]. Indeed, one of the initial motivations of Darondeau and Degano's work was the search for a tree-model on which standard results from the usual theory of bisimulation could be carried over. 3.3.3. History-preserving bisimulation. We noted already that the original definitions of history-preserving bisimulation were given on event structures or similar semantic domains. More precisely, history-preserving bisimulation was originally defined in [136] and [75] for prime event structures, and extended in [78] and [3] to flow and stable event structures respectively. More recently, this equivalence has also been studied on configurations structures [79]. Two variants of the notion of history preserving bisimulation have also been considered: hereditary history preserving bisimulation [16] and strong history preserving bisimulation [95]. Both are finer than the original notion. Using the occurrence transition system of Section 2.6, we may define a notion of local history preserving bisimulation for CCS processes. Essentially, a history-preserving bisimulation is a bisimulation which preserves, at each state of computation, the partially ordered set of events that led to that state. Moreover, it also accounts for the way this partial ordering is extended along a computation. The following definition, taken from [38], differs from that of [75] and [3] in two respects: it is "syntactic", in that it is defined directly on (an enrichment of) the CCS transition system, and it is based on the local rather than the global causality ordering. The occurrence system provides a notion of state (or configuration) for CCS terms. For p e CCS, define: States(p) = {§ I 3ei,^i such that p ^
§o ^
• • • = ^ ?/2 = §}•
Recall that each state § has an associated set of events occ(§), ordered by the local causality relation :<. Unlike the global causality ordering in flow and stable event structures, which is relative to a configuration, the local causality ordering <, which is essentially a static notion, is the same for all computations.
1006
/. Castellani
DEFINITION
3.18 {Local history preserving bisimulation). Let p,q e CCS. A relation
R C States(p) x States{q) x P(occ(States{p)) x occ{States{q))) is a local history preserving bisimulation (Ihp-bisimulation) between p and q if (/?, ^, 0) G R and whenever (§o, §o, g) ^ R then: (1) g is an isomorphism between (occ(^o), <) and (2) (a) fo ^
§1 ^
^e\ ?; such that §^ ^
(OCC(§Q), :<).
§[ and (^,, $[, ^ U (e. e')) e R.
(b) §^ ^ §; =» 3^, f, such that ^0 =^ §1 and (§i, §[, g U (^, ^0) G R. (3) (a) §0 ^ §1 ^ 3§; such that §^ = ^ §; and (§i, $[, g) e /?. (b) ^(^ =^ ?; ^ 3 ^ 1 such that §0 = ^ §1 and (§,, $[, g) G /?. We say that p and ^ are local history preserving equivalent, p ^^''^ q, if there exists a local history preserving bisimulation between them. We have then the following characterization: FACT 3.19. For any processes p,q e CCS; p ^^''f' q
S={{^,H\g)\H^States{p)^
^' eStates{q). gG^and $/?,§'}
is a Ihp-bisimulation between p and q. In fact, if H^^gH' for § G States{p) and ^' e Statesiq), then g is an occurrence aliasing such that occ{^) c dom(g) and occ(^') C range(g), that is an isomorphism between occ(^) and occ(^'). Similarly, if 5 is a Ihp-bisimulation between p and q then the family R = {Rg \ g eG} defined by:
/?, = {(?, t') I (t,r.?)e 5} is a progressive bisimulation family such that pR^q.
•
In the light of the results of Section 2.6, we have then also: COROLLARY
3.20. For any processes p,q e CCS: p ^f q <=> p ^^^'^ q ^^=> P^^q-
A similar notion of local history preserving preorder, £ , can be obtained by requiring g, in Definition 3.18, to be a bijection between (occ(§o), :<) and (OCC(5Q), :<) whose inverse is a homomorphism. This preorder may be shown to coincide with £ ^. Note that the local history-preserving bisimulation just defined is weak, in the sense that it ignores r-actions. This distinguishes it from the other notions of history-preserving bisimulation, which are strong. Indeed, as noted already in Section 2.1, the notion of
Process algebras with localities
1007
history-preserving bisimulation was designed to be robust under refinement, and most weak equivalences are not. Nevertheless, it could be worth investigating a similar syntactic definition for the usual notion of (global) history preserving bisimulation, by taking a slightly more concrete notion of occurrence where communications are pairs of visible occurrences, and adopting the corresponding global causality ordering (as defined in [27]). 3.4. Extension to the TT -calculus In this section we give an informal account of Sangiorgi's extension of the location equivalence ^i to the JT-calculus, as presented in [145]. An important result of this research is that the location machinery of [29] can be implemented in the TT-calculus by means of a fully abstract encoding, in such a way that the study of location equivalence ^t reduces to that of ordinary bisimulation equivalence. The TT-calculus is an extension of CCS proposed by Milner, Parrow and Walker in [ 114] to deal with mobile processes, building on earlier work by Engberg and Nielsen [64]. In the TT-calculus, processes interact by exchanging channel names (also called simply names) over channels. In particular, a restricted name can be sent outside its original scope, which is then enlarged to include the receiver process, a phenomenon-known as scope extrusion. The combination of channel transmission and scope extrusion is the most powerful feature of the TT-calculus with respect to its predecessor CCS. Using these mechanisms, it is possible to model the creation of unique names and simulate the transmission of resources and processes. For a formal definition of the TT-calculus, the reader is referred to Parrow's chapter [127] in this Handbook. The syntax of (a core version of) the language may also be found at p. 1017. The language used by Sangiorgi is in fact the polyadic variant of the TT-calculus, proposed by Milner in [112], which allows names to be transmitted in tuples rather than one at a time. This variant is particularly useful for writing programming examples as well as encoding other languages. The version of location equivalence used by Sangiorgi is a generalization of the dynamic location equivalence ^ ^ examined in Section 2.5 (hereafter referred to simply as ^i). To accommodate the definition of location equivalence, the syntax and operational semantics of the TT-calculus are enriched with location names, exactly in the same way as for the language LCCS examined in Section 2. This adaptation can be done quite smoothly, as name-passing does not introduce additional complications in this respect. We shall now give an outline of Sangiorgi's encoding, which maps located TT-processes into more complex jr-processes that incorporate the location information. This encoding exploits in a crucial way the TT-calculus ability to generate and transmit unique names. We shall use £^P^ to denote the encoding of the located process P. As can be expected, locations will be represented by in £[[P]]. Let a,b,x,y,z range over names, and {a) represent a tuple of names « i , . . . , «A . The idea is the following. Suppose that P -^^d P- Then £^P^ will send an additional name x which will serve as a "handle" for the observer, enabling him to access both the location ul and the causal
1008
/. Castellani
path u of action a. Assume that P is located at y. Then we will have approximately: SiPi
1 ^
(vzXLocixzy)
\ £\[P']i)
(12)
where the process Loc{xzy) implements the location mechanism and can be interrogated by the observer using name x. Here, y is the name representing the causal path u of action a, while z represents the location ul of the derivative P' in £^[[P']1. The process Loc(xzy) is defined by: Loc{xzy) =x{z) I !z.y. In fact, to avoid interference with the environment, the name x needs to be unique in (12). We give now the formal encoding for input and output processes, where the parameter y represents the location u of the encoded process (which is initially the empty string s): £\[a{b).P]i{y) = (vx)a{bx).(vzKLoc{xzy) £\[a(b).P]{{y) = a(bx).(vz)(Loc{xzy)
\£\[P'W))^
I £\[Pt{z)).
(13) (14)
These two clauses give the essence of the translation; further details are omitted. The main result is that this encoding is fully abstract, as expressed by the following theorem by Sangiorgi [145]. Here ^^ and ^^^ are the congruences associated respectively with the early bisimulation equivalence of the TT-calculus and with the location equivalence ^^. THEOREM
3.21. For any located n-calculus processes P, Q, P ^\ Q <=^ £lP]i ^ '
£lQ^ Note that this is essentially an expressiveness result about the TT-calculus. In this sense it falls in the same class as the results by Milner and Sangiorgi [113,143] on the encoding of the A-calculus and higher-order calculi, and that by Walker [163] on the encoding of object-oriented languages.
4. A concrete view of locations In this section we consider a concrete approach to the use of localities in process algebras, where location identities are significant and cannot be abstracted away as in the abstract approaches examined in Section 2. In the abstract approaches locations were used essentially to differentiate parallel components. Their exact names were immaterial, as long as they bore the same dependence or independence relation with each other. In the concrete approach we shall describe now, on the other hand, location names are important; indeed the topmost locations of a process may be viewed here as physical addresses in a network.
Process algebras with localities
1009
4.1. A concrete location semantics for CCS We start with the basic and most concrete approach to processes with exphcit locations, as was originally proposed by Murphy in [119] and further pursued by Corradini and Murphy in [49] and [46]. Although this concrete approach might be seen as the first step towards a theory of processes with locations, we postponed its presentation because it is easier to formalize once the general set-up of location equivalence has been understood. Indeed, this approach followed, chronologically, the more abstract approaches exposed in the previous sections. It also responds to a rather different concern: that of placing parallel processes onto a network of processors with a fixed geometry. In this context, the identities of locations are significant, as they may refer to physical processors. Accordingly, the semantics is very concrete: processes are equated if they reside on the same set of locations and present the same behaviour at each location. The language considered in [119] and [49,46] is a simple subset of CCS, essentially a finite combination of regular processes by means of the static operators of CCS, parallel composition, restriction and renaming.-^^ This is the same class of processes considered by Aceto in [5] under the name nets of automata, and we shall retain this terminology here. In this language all the occurrences of the parallel operator appear at top level, and locations are assigned to parallel components in the same way as in the static approach examined in Section 2.4, using the location prefix construct tv. p. The only difference is that here the two operands of a parallel composition are allowed to be placed at the same location. This is required for solving the placing problem, in case the number of processes is larger than that of processors. It is then immediately clear that locations will not serve as a measure of paralleUsm in this model. Also, since there is no nesting of parallelism in nets of automata, the structure of locations will he fiat. Formally, we have the following two-level syntax. The set of sequential processes is given by the grammar: p ::= nil | /x./? \ (p ^ p) \ x \ recx. p. Then the set of {distributed) nets of automata is given by: n : : = / : : p\{n\n)\
n\a \ n{f).
In concentrating on this simple language, the authors were motivated by implementation concerns: they wanted to rule out distributed choices like U :: p -\- k :: q), and also terms of the form (I :: p \\ k :: q) -h r, since in both cases a synchronization between possibly distant sites is required. The original work [119] presents a strong transition semantics for this language, with the associated strong bisimulation, while [49] and [46] consider the corresponding weak semantics, abstracting from r-transitions. We shall mainly consider the latter here. -^ The language studied in [119] and [49] is in fact a slight variant of CCS, with an asymmetric notion of communication where reception is directed (tagged with the location from which the value is expected to come) while emission is not. This choice was motivated by a similar asymmetry present in several synchronization protocols. Here, for the sake of simplicity and ease of comparison with other approaches, we take a more standard CCS-like language, as was done already by Corradini in [46].
1010
/. Castellani
Formally, the semantics of nets of automata is given by the same rules used for static location transitions in Figure 1: the transitions are simply indexed by the location at which they occur. Then the weak located equivalence of Corradini and Murphy [49,46], which we denote here by ^CA/. is defined as the ordinary weak bisimulation equivalence associated with these transitions. We have for instance: {Iv.aWlv.b)
^cM i::(a.b-^b.a).
(15)
(i::a\\k::b)
^CM (i::b\\k::a),
(16)
^CM ^ :: b.
(17)
{I ::{a-hb)\k
:: a.b)\a
Note that the nets of examples (16) and (17) are equated by location equivalence ^^ (we refer here to the static location equivalence ^l defined in Section 2). As for the nets of example (15), these are not admissible distributed processes in the static approach of Section 2.4, and therefore ^i is not defined on them.-^ In fact, it can be easily shown that the equivalence ^CM is stronger than location equivalence ^t on the intersection of the two languages, that is, on the language of nets of automata where parallel components have different locations). A proof of this fact may be found in [49]. In the light of this result it is fair to say that the model of Murphy and Corradini reflects a concrete view of localities. It may be remarked that this concrete model could very nearly be simulated in ordinary CCS, by using the relabelling operator to distinguish actions of different parallel components. This is only approximately true, because one should then adopt a slightly more flexible communication discipline to allow relabelled complementary actions like a, and ctj to synchronize. For instance one could use a communication function as in [14] or a synchronization algebra as in [166]. Modulo this little twist in defining communication, one would indeed be able to define a simple encoding f [[/i]) of distributed nets of automata into CCS, such that n\ ^CM«2<^=>f[[«l]l^f[[«2]l, where ^ is the ordinary weak bisimulation of CCS. Note on the other hand that this would not hold for location equivalence ^^, even in the simple setting of nets of automata, as shown by the example: [ia.y + b.y) \(y.b + yM)]\y
^t
ci\b.
It should be clear that any relabelling here would distinguish the two actions a (as well as the two actions b) in the first process, and therefore the two relabelled processes would be not be identified by ^ . Concerning located semantics, two additional results were presented in [119] and [49]: a calculus of efficient placings of processes into networks of processors, and an axiomatization, along standard lines, of the weak located equivalence ^CM-^ Note on the other hand that the dynamic location equivalence ^^j could be applied to these terms and would distinguish them.
Process algebras with localities
1011
An intermediary location semantics, which could be called "super-static", was also considered by Corradini in [46]: the idea was to use a static assignment of locations, as in the calculus here, but compare transitions modulo a static injective renaming of their locations. This semantics would equate the two systems of example (16) above, while still distinguishing the systems of example (17). Indeed, it not difficult to show that the resulting equivalence is strictly included between the located equivalence ^CM and the location equivalence ^t of Section 2. To conclude this section, let us mention another study on distributed CCS conducted by Khrisnan in [96], which is also based on a concrete view of locations. The author considers an extension of CCS with locations and explicit message passing primitives. The semantics he proposes for the language is rather different from those presented here, and we shall not attempt a detailed comparison; it is also more directly driven by practical concerns, like the limitations on the degree of parallelism imposed by a physical architecture. Applications of the calculus to the description of configuration and routing in distributed systems are also discussed. As pointed out already, the names of localities are important in the concrete approach, since localities are meant to represent physical sites in a distributed architecture. This leads quite naturally to the treatment of locations in more recent and powerful languages for distributed mobile computation. These languages will be the subject of Section 4.3.
4.2. The location failure approach In this section we briefly review the location failure approach, as has been developed by Amadio and Prasad in [12] and further pursued by Amadio in [9], and by Riely and Hennessy in [140]. Location failure has been considered also in other calculi, for instance in the distributed JOIN calculus [71]. In these latter calculi, however, locations have more complex meanings, hence their treatment is deferred to Section 4.3. The standpoint here is rather different from the one taken so far, where a global observer for a whole distributed system was implicitly assumed, and the issue was to identify the degree of distribution of the system. In the "location failure" approach, one starts from the hypothesis that locations - nodes in a distributed system - are liable to failure. The perspective adopted here is that of an individual programmer or process, wishing to have transparent access to resources irrespective of where they are located, at least as long as these locations are running. On the other hand, some awareness of locations is requested in case of failure: a process that has spawned activities at another location wants to be notified in case of failure of this location, in order to stop interacting with it and transfer activities to other locations. The language considered in [140] is based on pure CCS with no value-passing, while those of [12,9] build on more powerful formalisms, respectively the programming language FACILE of [157] and the asynchronous TT-calculus [94,21], which allow for the transmission of processes, respectively names, in communications. We will concentrate here on [140] and [9], which have been developed independently but appear to share several features. Common to both studies is the idea to enrich the
1012
/. Castellani
basic language (CCS and the asynchronous 7r-calculus'^^, respectively) with new operators for spawning a process at a remote location, killing a location and testing the status of a location. Locations I G LOC have two possible states, dead and alive. In the case of [9] locations are also transmissible values - in fact they are just a particular category of TTcalculus names. Formally, basic processes are built with the standard operators on the underlying calculus together with the following new operators (taking a blending of the constructs of [9] and [140]): • spawn (^, /?), which creates a new process p at location l\ • kill i, which kills location I, entailing the termination of all processes running at I; • if € then p else q, which evolves to either p or q, depending on whether i is alive or dead. Then distributed processes arc built on top of basic processes using the static operators of the language as well as an operator for locating processes, £::/?, which represents process p running at location i (this is analogous to the construct encountered in the previous sections, so we use the same notation). We therefore have a two-level syntax similar to that of [119,49], although with a richer basic language. The operational semantics, which we shall not report here, is then defined directly on distributed processes: as can be expected it makes use of the additional information about the state of locations (for instance the process i :: p can only execute if I is alive), but it is otherwise very close to the standard semantics of the underlying languages. In particular, unlike all the semantics considered so far in this paper, it does not record the location at which actions are performed. In fact, the common intention of the works [9] and [140] is that distribution should be completely transparent in the absence of failure. We should point out, however, that the names of locations are significant in this model, just like in the concrete approach of [119,49]: for instance the two systems (i :: a \\ k :: b) and (I ::b \\k ::a), which would be equated by the location equivalence ^^ of Section 2, can be distinguished here by an observer which has the capability of killing I or k. The semantic notion which is adopted in [9] and [140] is a form of contextual equivalence called barbed equivalence, essentially a bisimulation based on silent transitions and basic observations called "barbs", which is further closed with respect to contexts. For more details on this kind of equivalence see Parrow's chapter [127] in this Handbook. In [140] the barbed equivalence is given a more tractable formulation as a bisimulation relation called located-failure equivalence, noted ^LF- An example of distributed processes that are equated by ^LF is: Pi = {l::a \\ k :: (a.b))\a. Q\ =
l::{s^a\Nn{k,b))\a.
Intuitively, these are equivalent because even an observer capable of killing i is not able to tell them apart. In [140], located-failure equivalence is also given an alternative symbolic characterization (along the lines of [91]), which further improves its tractability. ^^ The reader unfamiliar with the TT-calculus is referred to Farrow's chapter [127] in this Handbook. However, knowledge of the TT-calculus is not strictly necessary for the discussion in this section.
Process algebras with localities
1013
Given the similarity of the underlying languages, the equivalence ^LF can be easily compared with the concrete located equivalence ^CM of [49] and the location equivalence ^i of [29]. It turns out that ^LF is neither stronger nor weaker than either of them. Here is an example, taken from [140], of processes which are both ^ CM-equivalent and ^tequivalent but are distinguished by ^LF\ P2 = (€::« \\k\:{6i + T.b))\a, Q2 = {l::{a +
T)\\k::(a.b))\a.
These are not ^LF-equivalent because if i is killed by some context, then P2 is capable of doing a Z^-transition which Q2 cannot match. In [140] one may find a slightly larger example, due to F. Corradini, showing that two ^/^/r-equivalent processes need not be ^CM-equivalent nor ^£-equivalent. Therefore ^LF reflects indeed a different perception of localities. The basic language considered by Amadio in [9] is a "disciplined" asynchronous ncalculus where for each channel name there is at most one receiver, which can be viewed as a server for that channel. Calculi of this kind are often said to have the unique receiver property. To emphasize this property, Amadio calls his language the TT 1-calculus, and its located version the TTI^-calculus. The TTI^-calculus will be further discussed in Section 4.3. In conclusion of this section, we can remark that in the location-failure approach, locations are units of failure as well as units of distribution; and while distribution in itself is not observable, failure may be observed (as the absence of certain communication capabilities) and thus reveal some parts of the distribution.
4.3. Combining locations and mobility We give now an overview of some recent work combining locations and mobility. Most of this work is still at an early stage and therefore our account will be essentially descriptive, trying to isolate those features that are more relevant to our subject of interest. We will only consider languages which are presented as process algebras or strongly based on them, namely distributed versions of the TT-calculus [114] and the JOIN calculus [70], the Nomadic TT-calculus of [151], and new calculi expressly designed with distribution and security concerns in mind, such as the AMBIENT calculus of Cardelli and Gordon [33] and the SEAL calculus of Castagna and Vitek [161]. We shall also briefly touch upon a distributed calculus based on the coordination language Linda, the calculus LLINDA of De Nicola, Ferrari and Pugliese [120]. It can be noted [148] that while most early work on process calculi was centered around modelling protocols (or other concurrent systems) and reasoning about them, these new process calculi have been more specifically designed to be the basis of programming languages. Indeed, a few of them have already given rise to prototypical programming languages such as the Join Calculus Language [72], NOMADIC PICT [152] and KLAIM [121]. With the advent of the network as a computing support, mobility is bound to play an important role in programming. However theoretical models for mobile computation, such as the TT-calculus [114] (see [127]), were already proposed and thoroughly studied before the
1014
/. Castellani
wide generalization of network programming that we witness today. This partly explains why, although the very idea of mobility seems to presuppose the existence of different sites among which to move, the notion of distribution among sites was not originally present in calculi for mobile processes. Only very recently have "distributed versions" of these calculi been defined and started to be investigated. In fact, there are two aspects to the notion of mobility as it is currently used: (1) The transmission of processes or links to processes as arguments of communication along channels. This form of mobility, which could perhaps be better qualified as "processpassing" and "name-passing" (or "link mobility"), is exemplified by the TT-calculus and its higher-order variants, CHOCS [156] and HOPI [143,144], as well as by the more practical languages derived from them such as FACILE [157] and PiCT [132]. (2) The actual movement of processes from one place to another, what is commonly called migration. This is the kind of mobility emphasized in formalisms such as the AMBIENT calculus and the SEAL calculus, and also accounted for in the distributed JOIN calculus [71,69] and in distributed versions of the TT-calculus such as [9,149,92] and NOMADIC PiCT [151,152]. Strictly speaking, only the second form of mobility requires an explicit distribution of processes among localities, as a kind of "reference frame" for the movement to take place. For the first form, it may indeed be sufficient to assume an implicit distribution given by the parallel structure of processes, since mobility is here only a facet of communication. To fix ideas, we will say that a model or language is "distribution-oriented" or simply "distributed" if it explicitly integrates some notion of site, locality or domain. In this sense, current developments of the TT-calculus such as Amadio's jri^-calculus [9], the distributed TT-calcuH dpi of Sewell [149] and DTT of Hennessy and Riely [141,92], the distributed JOIN calculus [71,69] and NOMADIC PICT [152] are distributed, and so are newly proposed calculi such as the AMBIENT calculus [33] and the SEAL calculus [161]. These are essentially all the models we shall examine in this section. Now, what exactly is a locality in these models? According to the model localities may have different attributes, but some common features can be identified: • A locality is the host of a number of processes and resources. Sometimes, the locality itself is assimilated to a particular process (the "locality process" of the TT^-calculus) which plays the role of a controller for the processes in its scope. • Localities can be observed or controlled. The need for controlling localities is often motivated by failure detection or security concerns. The observation of localities is required to implement migration. • A locality can be named, and as such designated as the target of a communication (if communication across localities is allowed) or the destination of a migration. Moreover, localities have a bearing on the handling of communication. In a distributed calculus there are two forms of communication: local communication, between processes at the same locality, and distant communication, between processes at different localities. Distant communication can be transparent - in the sense that distant destinations are reachable as if they were local (distributed JOIN calculus, Amadio's calculus, SewelFs dpicalculus), restricted to the immediate neighbourhood (SEAL calculus), or even completely forbidden (AMBIENT calculus, Hennessy and Riely's DTT-calculus). In the last case only local communication is possible, and processes have to convene in a common location in
Process algebras with localities
1015
order to communicate. Typically, a process wishing to send a message will have to move to the location of the destination process. Clearly this choice only makes sense in calculi with a migration primitive, where distant communication can be simulated. Depending on the form of distant communication allowed, one can distinguish between global communication, proximity communication and purely local communication models. In most of these models both local and distant communication are asynchronous (in the sense that the sending of a message is non-blocking,^' see also [127]). In general, distributed calculi have tended to adopt asynchronous rather than synchronous communication, as the former seems more primitive, easier to implement, and closer to the asynchronous message delivery mechanisms of actual networks. In the SEAL calculus, on the other hand, both local and distant communication are synchronous. This choice may be due to the fact that the primary concern of this calculus being security, a more rigid communication discipline is preferred (the implementation issue is less crucial here since only short-range communication is allowed). Similarly, communication is synchronous in the DTT-calculus of Hennessy and Riely, where only local communication is allowed. The structure of locations can b^flat or hierarchical, in which case they can be organized in two levels or arbitrarily nested in a tree. In a hierarchy of locations, the first level may be seen as representing physical machines^-^ while lower levels correspond to software agents. Locations are flat in Amadio's JTU-calculus, in Hennessy and Riely's DTT-calculus, and in NOMADIC PiCT. They have a two-level structure in SewelFs J/?/-calculus and a tree structure in the distributed JOIN calculus, the AMBIENT calculus and the SEAL calculus. Hierarchical locations have a relevance in the presence of failures, since the failure of a location entails the failure of all its sublocations. In a hierarchy of locations, moreover, locations may be themselves migrating entities: in this case a migrating location will bring together its sublocations. Structured locations also allow for a finer control of mobility and a more flexible handling of security issues when modelling networks partitioned into administrative or "trust" domains. Locations are the reference frame for migration. Migration is intended as the movement of processes or some other entity having executable content (such as locations themselves), as opposed to simple data transfer. One can distinguish between subjective and objective migration. In the first case the migration instruction comes from the migrating entity itself (possibly from a process enclosed in it, if this entity is for instance a location), while in the second it is outside its control. A further classification can be made into strong and weak migration. In the first case a process can be interrupted during its execution and moved together with its current environment to another location where execution is pursued. In this case, where "active" code can be moved, one often speaks of migrating agent. In the case of weak mobility, instead, only "passive" code can be moved. Finally, strong migration can be blocking for ^^ This is not to be confused with the use of "asynchronous" and "synchronous" in reference to Milner's calculi CCS and SCCS (Synchronous CCS) [110]. In SCCS synchrony means that parallel components proceed together in lock-step. ^^ Although, strictly speaking, this would imply a different treatment of topmost locations, to forbid them to move or be dynamically generated. This issue is explicitly addressed only in NOMADIC PiCT, where the flat space of locations is fixed from the start, and the J/?/-calculus, where new locations may only be created as sublocations of existing ones.
1016
/. Castellani
the migrating entity, in the sense that this has to suspend execution until the migration is completed, or asynchronous, as is the case for the migration of localities, which can still receive messages while being subject to a migration instruction. In the next sections, we shall examine in some detail a selection of these models for distributed mobile computation. 4.3.1. Distributed n-calculi. The TT-calculus does not have an explicit notion of location, although its constructs are powerful enough, as shown in Section 2.6, to simulate the location machinery of [29]. Indeed the jr-calculus, while being one of the most influential foundational calculi for mobility, does not provide for direct process mobility. The movement of processes is represented indirectly via the movement of channels that refer to them: roughly speaking, two processes move close to each other when they acquire a common channel. It could then be natural to view the notion of name scoping as an abstraction of that of location. However this analogy cannot be brought very far, since processes may share several names with other processes. For instance one cannot define two processes to be co-located whenever they share a private name, since this notion of "co-localization" would not be transitive. A more convincing interpretation of name scoping would then be as "trust domains" (that is, groups of processes that trust each other), since these are allowed to overlap and membership to a common trust domain is not expected to be transitive. To directly model distributed aspects such as migration of agents and failure of machines, one must add to the TT-calculus primitives for grouping processes into units of migration or units of failure. An early proposal was presented by Amadio and Prasad in [12], to model the distributed module of the FACILE programming language [157]. More recently, enrichments of the TT-calculus with explicit locations have been studied by Amadio [9], Hennessy and Riely [141,92,93,142], Sewell [149], and Sewell et al. [151,152]. The emphasis in this work is in developing type systems for mobile distributed computation, building on existing type systems for the TT-calculus. These type systems may serve a variety of purposes. For instance, Amadio's type system is used to ensure the uniqueness of receptors on communication channels. The type systems of Hennessy and Riely's [141,92] aim at regulating the use of resources according to permissions expressed by types; these type systems are further refined in [93,142], to deal with the case where some components of the network, representing malicious agents, may not be assumed to be well-typed. The goal of Sewell's type system [149] is to distinguish local and remote channels in order to allow efficient implementation of communication. The language Nomadic Pict [151,152] stands a little aside from this track: it is conceived as a distributed layer over the language Pict, offering high-level global communication while providing at the same time its implementation in terms of low-level located communication. Most of these distributed TT-calculi use a flat space of locations, and a primitive for the migration of processes. In the DTT-calculus, this primitive is coupled with a purely local communication mechanism, while in the other calculi communication is global. Other models like the distributed JOIN calculus, the SEAL calculus and the AMBIENT calculus, although strongly inspired by the TT-calculus, have rather distinct characteristics. Here the space of locations is tree-structured, and the hierarchy is relevant for migration as the units of migration are locations. In these calculi the emphasis is put respectively on implementa-
Process algebras with localities
1017
tion, security and administration^-^ issues. Regulation on the use of channels and migration is imposed mostly by syntactic means. Type systems have not been a main concern in these models, although they are starting to be actively investigated for the AMBIENT calculus. We proceed now to a more detailed description of the various models. Most of them are based on the mini TT-calculus studied by Milner in [113], or on its asynchronous version [21,94]. For convenience we recall here the syntax of these calculi, referring to Parrow's chapter [127] in this Handbook for more details. The syntax of the mini :7r-calculus is given by: P. G ::= 0 I x{u).P I x{u).P \P\Q\
{vx)P \ IP.
The asynchronous TT-calculus is obtained by replacing the output prefix construct 'x{u).P by simple messages J(w), thus preventing output actions from blocking a process. Syntactic variants may be used: for instance replication may be replaced by general recursion or by replicated inputs, that is processes of the form \x{u).P. The polyadic version may be preferred, where input and output prefixes are generalized to allow transmission of tuples of names, noted J C ( ^ ) and 'x{~f). The semantics of these calculi is given by first defining a structural congruence =, which is used to predispose terms for communication, and then a set of reduction rules describing process execution. This kind of semantics, which factors out structural rearrangements of terms, was first proposed by Milner in [113], taking inspiration from the Chemical Abstract Machine {CHAM) style of semantics advocated by Berry and Boudol [18]. The 7t\t-calculus. The first extension of the TT-calculus with locations was proposed by Amadio and Prasad in [12], to model an abstraction of the failure semantics of the language FACILE. The language considered in that paper, called the 7tt -calculus, is based on a variant of the synchronous polyadic TT-calculus with guarded sums; moreover, diflat space of locations is introduced, and failure primitives similar to those described in Section 4.2 are provided. We shall not describe the calculus in detail, but only mention its main features, some of which reappear in later calculi. In the 7r£-calculus locations are added as a new category oi names, which can be dynamically created and transmitted in communication; all channels and processes are located. The reduction semantics of the TT^-calculus is defined relative to an environment £, describing the assignment of locations to channels. Communication is global: it may occur between any two complementary channels irrespective of their location. In general, locations intervene only in the failure semantics of the language. Although all locations are "failure-independent" from each other (since they are unstructured), channels are dependent on the location where they are placed: the failure of a location prevents any further communication on its channels. The abstract semantics of the calculus is given by defining a barbed equivalence (see Parrow's chapter [127] for a definition of this notion) on configurations (£, p). Although the observation with failures is rather different from the usual observation of the ncalculus, an encoding of the TT^-calculus into the TT-calculus is given, which is proved adequate with respect to the barbed equivalences of the two languages. • ^ In the sense of modelling navigation through administrative domains.
1018
/. Castellani
The 7ri£-calculus studied subsequently by Amadio in [9] (this is the version of the calculus we shall refer to in the following) is based on the asynchronous rather than the synchronous TT-calculus. More precisely, the jru-calculus builds on the TTI-calculus, a typed asynchronous TT-calculus satisfying the unique receiver property. This property, which requires each channel to have at most one receiver, was already mentioned in Section 4.2. As we shall see, it is a common requirement in mobile distributed calculi, as it simplifies the implementation of distant communication. It also brings the TT-calculus closer to objectoriented programming, where interaction arises when an object calls a method of another uniquely determined object. In the 7T\ -calculus, the unique receiver property is enforced by means of a simple type system. A barbed congruence is also defined on the TT i-calculus, which is characterized as a variant of the asynchronous bisimulation of [11]. The located 7ri£-calculus adds to 7t\ the model of locations and failures of the TCt -calculus, together with a primitive spawn {I, p) for process migration. The failure primitives of the TTR-calculus have already been discussed in Section 4.2. We shall only add here a few remarks about semantic and typing issues. The spawn {i, p) construct provides a form of objective migration: the process containing the instruction causes process p to move to location t. A distinctive feature of the 7ri£-calculus is that locations have an associated controller process, called locality-process, which records the status of its controlled location and handles messages addressed to the location, in particular all spawn, test and halt requests.-^"^ In the TTH-calculus communication is global, just like in the :T^-calculus. However the asynchronous setting allows for a more elegant communication rule. In fact, the movement of a message towards its destination is described in two steps: first, the message is exported in the ether (that is, out of its current location^^), and then it enters the location of the destination process (which is uniquely determined, because of the unique receiver property). Although divided in two steps, the routing of messages is completely transparent: indeed, local communication is implemented in exactly the same way. Note that the movement of messages towards their destination provides another implicit form of migration, besides that given by the spawn (£ , p) primitive. To conclude, let us mention a few results established for the TTH -calculus. The type system proposed in [9] ensures both the unique receiver property and the invariability of the location of channel receivers. Similar properties, as we shall see, will be imposed by syntactic restrictions in the distributed JOIN calculus. Indeed the TTI^-calculus shares several ideas with the distributed JOIN calculus, like the localization of receptors and the transparency of distant communication and migration in the absence of failures. Another notable result of [9], which extends the analogous result for the jr^-calculus recalled earlier, is that the TT i rcalculus can be encoded into the IT\ -calculus, which in turn is sufficiently expressive to encode the full asynchronous :T-calculus. Although appHed to different models of locations, these results are also similar in spirit to the encoding of the location semantics of [29] into the TT-calculus, given by Sangiorgi in [145] (see Section 3.4). ^"^ In Section 4.2 we omitted the controller process, for the sake of simplicity. In fact, this controller may be seen as a way of implementing side-conditions on the status of locations in the semantic rules. ^^ What requires this location to be alive, a condition ensured by the controller process. In general, liveness is required for the source location of a communication or a migration, but not for the target location.
Process algebras with localities
1019
The Djt-calculus of Hennessy-Riely. The DTT-calculus of Hennessy and Riely is a typed synchronous TT-calculus where types are used for resource access control. The calculus offers constructs for process migration and local communication. In its simplest form [92], a flat space of locations is introduced. In the richer variant presented in an earlier paper [141], which we may call the DTT "^-calculus, structured locations and a primitive for moving locations were also considered; in addition the issue of site failure was addressed there. Since the treatment of structured locations and failures in [141] is essentially the same as in the distributed JoiN-calculus described in Section 4.3.2, we shall concentrate here on the simpler version of [92], which is also the one retained by the authors in subsequent papers [93, 142]. At the end of this section we will briefly discuss an asynchronous "receptive" version of the DTT-calculus, recently studied by Amadio, Boudol and Lhoussaine [10]. The basic entities of the DTT-calculus are threads (or processes), systems and resources. Threads p,q arc processes of the polyadic TT-calculus, with an additional operator go t o £./7 to allow movement of code p towards location i. This operator is similar to the construct spawn (£ , p) considered by the authors in [140] and by Amadio in [12,9] (see Section 4.2). Locations i,k have a flat structure. They are just a particular category of TT-calculus names, and can be created via the operator (vi)p and transmitted in communication. Systems P, Q are collections of located threads of the form £[/?], also called agents. More precisely, systems are obtained by combining located threads via the static operators of parallel composition and name creation (new M : 7) P, an operator similar to restriction which allows sharing of information among different locations. The resources of the calculus are channels, supporting synchronous communication between agents. Channels are also located and communication is restricted to being purely local: it is only allowed between agents placed at the same location, using channels that have been allocated at that location. Thus processes wishing to interact first have to move to a common location. This means that in the DTT-calculus, as in other languages adopting the "go and communicate" paradigm, locations are used as units of communication. The reduction semantics is given directly on systems f. It is defined modulo a structural congruence = that allows co-located threads to be split and reassembled, that is i[p \ q] = i[p] I l[q], and empty agents to be garbage collected, i[0] = 0. The rules for code movement and communication^^ are the following: i[goto
k.p] -^ k[p],
l[a{u).p]\l[a(x).q]->
ilp]\
I[q{^'/.}1
Then, assuming a is 3. channel declared in location /:, remote communication can be "implemented" using migration and local communication as follows: ilgoto
k.a{u).p\r]\k[a{x).q]
->* l[r]\ k[p \q{^'/.]].
Note that in Dn, the units of migration are simple threads of the form £[goto k.p]. If such a thread runs in parallel with other threads located at £, these will stay put while 36 For simplicity we consider here the monadic version of the calculus.
1020
/. Castellani
p moves to k. Moreover process p will only be activated when reaching its destination. Hence migration is weak in Djr, that is, only passive code can be moved. This makes a difference with other calculi such as NOMA Die PiCT, where migrating agents may contain several threads in parallel, which continue to run until the migration takes effect. Local communication is the main parting point of the DTT-calculus with respect to Amadio's 7ri£-calculus (examined in the previous section), at least as far as the untyped languages are concerned. The type systems of the two languages, on the other hand, are rather different. While Amadio's type system is used to ensure uniqueness of receptor channels, types in the DTT-calculus are designed to control the use of resources. The idea is that agents should not be allowed to use a non-local resource before being granted the appropriate capability. The type system of DTT is based on a new notion of location type, which describes the set of resources available to an agent at a particular location. Resources, that is channels, are themselves equipped with capabilities described by types. The types of channels describe the values they can transmit. They may be further refined to prescribe the way in which channels should be used, thus extending the input/output types studied in previous work by Pierce and Sangiorgi [131]. More formally, a location type has the form l o c C ^ : A }, where "^ is a tuple of distinct channel names and A is the associated tuple of capabilities. For instance the location i\loc{a: A,b: B) offers two channels a and b with capabilities A and B respectively. A simple channel type has the form c h a n ( r ) , where T is the type of the transmitted value. This value may be a location name, a local channel name, or a remote channel name marked with its location of creation, written l[a]. Compound names t[a] may only be used as arguments in communication (not as transmission channels), and their types are of the form loc[A]. The syntax is then enriched with type information for received values and created names. The structural congruence = allows manipulations on these terms, like for instance £[(new a. A) p] = (new £[«]: loc[y4])^[/?]. A new semantic rule for communication of remote channels is added: t{a{km).p]
I i[a{z[x\: loc[.4]).^] ^ l[p] \ £[^{^Vc..v}].
For process q{^'^/z,x] to be well-typed, it is necessary that the types of names k and b match those of z and x. Thus the typing ensures that names are received with the same capabilities they are sent with. In fact, thanks to subtyping, names can be more generally transmitted with a subset of the sender's capabilities. This means that a process sending a name can control the use that will be made of it, which is indeed the property the calculus was trying to ensure. A remote procedure call may be described in the calculus as follows: i[{vr) g o t o k.a{t[r]) \ r{X).p] \ k[a(z[x]: loc[A]). g o t o z.x(V)]. We shall not elaborate further on the type system of [92] here. Let us just recall that this type system, which is rather sophisticated, satisfies the standard soundness properties of subject reduction (type preservation) and type safety. In later work [93,142] the authors have adapted this type system to guarantee that even a partially typed system (such as can
Process algebras with localities
1021
be an open network with untrusted components) will continue to satisfy the same property of safe access to resources. To conclude, we will mention a result established in [ 10] by Amadio, Boudol and Lhoussaine, for an asynchronous version of the DTT-calculus. Combining ideas from previous studies by Amadio [9], Boudol [22] and Sangiorgi [146], the authors propose a simple type system for this calculus, ensuring localization of receptors and receptiveness of channel names (a kind of input-enabledness). They show that well-typed systems enjoy a local deadlock-freedom property called "message deliverability". This property, which states that every migrating message will find a receiver at its target locality, is particularly desirable in an asynchronous setting, where there is no control on message consumption. The dpi calculus of Sewell. The dpi-ca\cu\us studied by Sewell in [149] is an asynchronous TT-calculus extended with location and migration primitives similar to those of the DTT-calculus. Its hierarchical model of locations, on the other hand, as well as its global communication discipline, are inspired from those of the distributed JOIN calculus. A few syntactic variations with respect to the DTT-calculus and the distributed JOIN calculus are worth mentioning: (1) the c//7i-calculus adopts a two-level rather than a tree-structured hierarchy of locations; (2) locations are associated with each elementary subterm of a system, for instance every prefix is located; (3) when used for a location w, the construct for name creation (new u \ @t T) only allows the creation of w as a sublocation of an existing location t. This means that new locations cannot be created at the topmost level, which is interpreted as a set of physical addresses. We shall not dwell longer on the description of the language here, but rather sketch the main contribution of the paper [149], which is the study of a type system distinguishing local and global channels with the aim of localizing communication whenever possible. The idea is that restricting the use of some channels to be local may be useful both for efficient implementation (these channels do not need to be globally unique nor registered with a central name server) and for robustness against external attacks. The proposed type system generalises that of Pierce and Sangiorgi [131], where channel types are annotated with input and output capabilities. Here the input/output types of channels are refined to indicate whether their use is allowed to be global or restricted to be local. Formally, a channel type has the form XCIM) T, where the input and output capabilities / and o are taken from the set {G, L, - } . In such a channel's type the input (respectively output) capability can be global (G), in which case it can be exercised at any location, local (L), in which case it may only be exercised at the channel's location, or absent (-), in which case the channel cannot be used at all for input (respectively output). For instance, if x is a channel located at I of type tih.G) T, then x can be used for output anywhere, but for input only at location i. Such a channel may be used, for instance, to send requests to a server located at i. Note that in calculi enjoying the unique receiver property^ such as the 7ri£-calculus and the JOIN calculus (see next section), all channels would have such a type. The type system ensures that channel names are used with the appropriate capabilities and that local capabilities are not sent outside the location they refer to. Subtyping allows
1022
/. Castellani
for the transmission of subcapabilities. A type preservation result (subject reduction) is proven, and a method for inferring the most local capabilities of a channel is proposed. In the light of these results, it can be said that the J/7/-calculus allows for compile-time optimization of communication, while retaining the expressiveness of global channel communication. The same idea of offering both local and global communication while clearly distinguishing between them, may be found also in the language NOMADIC PICT [152]. 4.3.2. The distributed Join calculus. The JOIN calculus was introduced by Foumet and Gonthier in [70], followed shortly later by its distributed version [71]. As it was presented by its authors in [70], the JOIN calculus is "an offspring of the TT-calculus, in the asynchronous branch of the family".^^ This calculus was specifically designed to facilitate distributed implementations of channel mechanisms. Compared to the asynchronous ncalculus, it offers a more expUcit notion of places of interaction. The distributed JOIN calculus [71,69] goes farther still, adding to the original calculus notions of named location and distributed failure. We start with a description of the basic JOIN calculus, and then move to its distributed version. We will mainly follow the presentation of [104], which gives a good overview of the two calcuh and the initial results that have been established for them. The main feature of the JOIN calculus is that every input channel is persistent and enclosed in a definition, a construct that combines scope restriction and replicated reception. In the TT-calculus, there is no constraint on the use of receptor channels, and it is possible to write: x{y).P\x{z).Q\xa. In practice, if the two receptors x{y).P and x{z).Q are far from each other, one faces a distributed consensus problem, since the two processes have to agree about who takes the value. The JOIN calculus tries to avoid this problem by forcing all the receptors on a given channel to be grouped together in a definition of the form: def(jc(j) > P)A{x{z) > Q)inx{a).
(18)
In a definition d e f DinR the notation x{y) is overloaded to mean reception of y on x in the Z)-part (declaration^^ part) and emission of y on x in the R-part (the running part, or body of the definition). The d e f construct delimits the scope of its defined names, that is the receptor channels declared in the D-part. Moreover, the receptors x{y) are permanently defined and correspond to :7r-calculus replicated inputs \x{y).P. Thus the analogue of definition (18) in the TT-calculus is: {vx){\x{y).P\\x{z).Q\xa). An important point to note is that in the JOIN calculus every receptor channel is statically defined. Since their names are bound by their definition, receptors cannot be renamed: ^^ This branch was to grow quite loaded in subsequent years. ^^ The D-part of a definition construct was also called definition in [70,71]. For clarity, we prefer to use "declaration" here.
Process algebras with localities
1023
two different receptors will never be equated/^^ Moreover, receptors are replicated in the definition where they occur, and thus are always available. This gives a precise meaning to the statement that receptors are localized in the JOIN calculus (even in its basic version). As in the asynchronous TT-calculus [21,94], communication is asynchronous in the JOIN calculus: the syntax only allows simple messages Jc(^>, without continuation. To provide some synchronization mechanism, the calculus dWov^s join-patterns in definitions. These are groups of guards expecting to receive a corresponding group of messages atomically. A join pattern J is either the reception of a tuple of names, jc(lf), or a composition J' \ J" of such receptions. In a join pattern, the names of the receptors are supposed to be all distinct. A declaration D can then be an elementary declaration J > f*, or a conjunction D' A D" of such declarations. It can also be empty. In each conjunct J > P, the names of the join pattern J are binding for the continuation process P. Join patterns in different conjuncts need not have disjoint receptor names. For instance, in example (18) above, the same receptor x was used in two different conjuncts. Besides messages and the construct d e f D i n R, the calculus has constructs for termination and parallel composition. An example of a JOIN process is the following: def(x{y>|r(u> > P)A{x{z)\t{v)
> Q) in x{a) \t{c) \ x{b).
According to our informal description of the d e f construct, this process may reduce to: def(x{y)
I t{u) > P) A (X(Z) \ t{v) > Q) i n P{^'-7y."} I ^ W -
The notation Pf^^'^/y.w} indicates the simultaneous substitution of a for y and c for u. In this reduction the two messages x {a) and t (c) have been consumed by the first join-pattern, triggering the process P. Alternatively, the two messages x{a) and t{c) (or also x(b) and t{c)) could have been used to trigger process Q. Thus join-patterns may be a source of nondeterminism in the language. Note on the other hand that if another message on t had been available, both P and Q could have been triggered in two successive reduction steps. The general form of the reduction above is given by the following rule: d e f D A 7 > P i n / a I Q -^ d e f D A y t> F i n Por I e
(19)
where the substitution a is an instantiation of the received values of the pattern J. The semantics of the JOIN calculus is completely determined by the reduction rule (19), together with standard contextual rules and the use of a structural congruence = which allows, for instance, all occurrences of d e f to be pushed in front of a term."^^ The distributed JOIN calculus (DJoiN for short) extends the basic calculus with explicit locations and primitives for migration. Locations a, b,... are introduced in the syntax by ^^ Indeed the JOIN calculus satisfies a property similar to the output only capability introduced explicitly in later calculi [108]. This property says that a transmitted channel name can never be used by the recipient as a receptor channel. ^^ In fact, the semantics of the JOIN calculus was originally defined using a Chemical Abstract Machine (CHAM) in the style proposed by Berry and Boudol [18]. The CHAM for the JOIN calculus is said to be reflexive in that the definition mechanism of the calculus allows new sets of rules to be added to the reduction rules of the machine.
1024
/. Castellani
adding a new clause for declarations, the located declaration a[D : JP], which represents a declaration of input channels located at a. The process P is used to "initialize" location a when it becomes active. Just like channels, locations are defined together with their code: in «[D : P], the name a is a declared name, whose scope ranges over the whole d e f expression which contains it. Unlike a receptor, however, a location can only be declared once in a definition. For instance, the syntax does not allow the expression d e f a[D : P]r\a[D' \ Q\> R i n 5. Receptors are required to be declared in the join-patterns of a unique location. For instance, the expression d^t a[x{y) \> P \ Q]/\ b[x{z) > Q. R]inT is forbidden. On the other hand d e f a[jc(y) > P Ax{z) > Q : R] in S is a. correct definition. Like in the distributed TT-calculi examined previously (see Section 4.3.1), in the DJoiN calculus locations are first class objects and can be transmitted in communication. It is worth stressing that locations are globally declared in the DJOIN calculus: just like a receptor channel, a location a declared in some definition cannot be declared in any other definition. It can only be used by a process in another definition if it has become known to it (by effect of a communication). Distant communication is transparent in the calculus: a message located at b will automatically move to the unique location a of its receptor. As the syntax allows nested located declarations, locations are hierarchically structured in a tree. At the top of the tree, there is an unlocated root. Since location names are required to be globally unique, every proper node in the tree corresponds to a different location a."^^ The location path (pa from the root to a node a represents the position of a in the location tree. If location b has position (pa^/zb, then ^ is a sublocation of a. The path (pa is not necessary to identify a location a (the name a is sufficient, by the uniqueness assumption); it is useful however to express consistency conditions in the semantic rules, like the fact that a location does not migrate to a sublocation. Migration is expressed by a new process construct go {a,k). A process executing the instruction go (a, k) causes its current location , say b, to become an immediate sublocation of location a; a null message k{) is emitted on channel k upon termination of the migration. This message notifies that the migration is completed: it can be used, for instance, to render a migration blocking. If the position of a in the location tree is given by (pa, the new position of location b will be (pab. For the migration to take effect, it is necessary that b does not occur in (pa, that is b is not a superlocation of ^. This is because in the DJOIN calculus, like in other calculi with structured locations, a migrating location b moves together with all its sublocations (the subtree rooted at b). This means that the location tree may be substantially reconfigurated at each migration. Note that migration is subjective (since the go instruction applies to its enclosing location), and that the units of migration are the locations themselves.^^ Let us consider an example of reduction in the DJoiN calculus. Without entering into technical details, and borrowing ideas from [141] and the open JOIN calculus [20], we may assume a runtime environment C which records the position of locations and declarations at any given time. Then the reduction relation would be defined on configurations (C, P). "^^ This contrasts with other models with structured locations, where a general location is represented by the whole path from the root to a node and an atomic location may appear in different paths. In fact, the movement of messages towards their receptor's location could also be seen as a simple form of process migration. This point will be discussed further in Section 4.3.5.
Process algebras with localities
1025
For instance, supposing the environment £ defines the position of ^ to be i/^^, and the position of a to be a string ipa not containing b, we would have the following reduction: (£, d e f b[D.P\
go (a, k)] A D' i n /?) ^
{C\ d e f Z7[D : P I j^()] A D' i n /?)
(20)
where C is obtained from C by replacing all positions of the form ^|fb'^' by (pab\(;'. In other words, the effect of this reduction is to move the tree rooted at b to become an immediate subtree of the tree rooted at a. To summarize, the DJoiN calculus offers global access to locations as well as to channels. Once a process knows the name of a channel (respectively a location), it can make direct use of it independently of its location (respectively its position in the location tree). The distributed infrastructure required to implement such global mechanisms is simplified by the assumption of global uniqueness of locations and localization of receptors. In other calculi, such as Amadio's TTI^-calculus considered in the previous section, the localization of receptors was ensured by means of a static type system. The DJoiN calculus makes the choice of handling locations directly, without recourse to a type system. In calculi with global communication and migration one expects a network transparency result in the absence of node failures. As for the location failure calculi examined in Section 4.2, this result also holds for the DJoiN calculus, on the condition that systems are free oi circular migration (such migration would appear, for instance, in the process of example (20) if location b were replaced by a). More precisely, under this condition two processes of the DJOIN calculus are equivalent if and only if they are equivalent in the basic JOIN calculus once stripped of all location information. Clearly, one cannot hope for transparency results in the presence of location failures. Like the calculi for location failure discussed in Section 4.2, the DJoiN calculus has been equipped with a way of marking locations (as dead or alive), and constructs for halting a location and testing its status. As in Amadio's TTH-calculus, it is still possible to send a message or migrate to a dead location. On the other hand emission or migration from a dead location is ruled out. Rules for communication and migration are then conditioned on the liveness of the source location. As in other models where locations are structured, a location fails with all its sublocations. Thus the dependence between locations is meaningful for failure as well as for migration. While the location failure calcuH in [12] and [140] are synchronous, Amadio's 7T\tcalculus and the DJoiN calculus are asynchronous. As observed in [104], in an asynchronous world the assumption of a global knowledge of the liveness of every location may be unrealistic. For a detailed discussion about the treatment of failures in the DJOIN calculus, and more generally about results concerning the calculus, the reader is invited to consult Foumet's thesis [69]. Compared to other calculi described in this section, the JOIN and DJoiN calculi have a relatively developed theory. Standard equivalence relations (barbed equivalences) have been defined, although reasoning techniques still have to be worked out. Encodings of the JOIN calculus into and from the asynchronous TT-calculus have been given in [70,71,69]. The paper [20] presents a characterization of the barbed congruence of the JOIN calculus as
1026
/. Castellani
an asynchronous bisimulation, inspired from [11]. A language based on the JOIN calculus has been implemented, the Join Calculus Language presented in [72]. 4.3.3. The Ambient calculus. The ambient calculus of Cardelli and Gordon [33] is a process calculus which emphasizes process mobility rather than communication. In fact, it appears that the mobility primitives are sufficient to give the calculus its full expressiveness, and the communication primitives are mostly added for convenience. An ambient is an area delimited by a boundary, where multi-threaded computation takes place. Each ambient has a name, a collection of local processes (or threads) and a collection of subambients. Thus ambients can be arbitrarily nested in a tree structure. Processes may cause the enclosing ambient to move inside and outside other ambients. The form of migration provided by the calculus is therefore subjective^^ Processes may also "open" an ambient at the same level, that is dissolve its boundary causing its contents to spread into the parent ambient. Finally, processes within the same ambient may communicate with each other asynchronously, by releasing and consuming messages in the local ether. The arguments of communication may be names, capabilities (that is, permissions to operate on ambients with a given name), or sequences of such arguments. We shall not consider further the communication primitives here. Ambients move as a whole, bringing together all their threads and subambients. They are therefore units of migration. The tree structure of ambients allows for a close control of mobihty: an ambient can only enter a sibling ambient and exit a parent ambient. Similarly, a process can only open an ambient which is enclosed in the same parent ambient. This form of mobility, which could be called projc/m/ry mobility, is well-suited to model navigation through a hierarchy of administrative domains, which was the original inspiration for the calculus. The ability to move and open ambients is regulated by capabilities, possibly acquired through communication. These capabilities model the notion of authorization, necessary to regulate access to resources and, before that, the crossing of administrative domains. Formally, an ambient is written n[P], where n is the name of the ambient and P its contents, described by the following syntax, where M represents one of the capabilities i n «, o u t «, open n (and the communication primitives are omitted): P,Q.\={)\M.P\
P\Q\
{vn)P I \P \n[P].
In n[P], it is understood that P is actively running, even when the surrounding ambient is moving. This fact is expressed by a semantic rule saying that any reduction of P can also take place within n:
P-^Q^n[P]^n[Ql The mobility constructs are i n ^2.P (to enter an ambient named n), o u t n.P (to exit an ambient named n), and open n.P (to open an ambient named n). Their semantics is given "^^ Indeed the terminology "subjective/objective" for migration was introduced by Cardelli and Gordon.
Process algebras with localities
1027
by the following reduction rules: n [ i n m.P \ Q] \ m[R] -^ m[n[P | Q] \ R], m[n[out m.P \Q]\R]
-> n[P \ Q] | m[Rl
open m.P \m[Q] -^ P \ Q. Clearly, the i n and o u t operations are duals of each other. The o p e n operation, on the other hand, has a more definitive and disruptive effect. However, its use is regulated by a capability which must have been given out by the ambient to which it is applied."^"^ Ambient names can be created, and used to name multiple ambients. Ambients with the same name may coexist both at the same level and at different levels in the hierarchy. In case a mobility instruction matches several ambients, one of them is chosen nondeterministically. Ambients with the same name have separate identities, and an empty ambient is still observable through its name. This is expressed by the following inequalities (where = stands for semantic equality): n[P]\n[Q]
^n[P\Ql
n[0] # 0. An interesting equality which holds for ambients is the so-cdA\cd perfect firewall equation:
(vn)n[P]=0
if
n^fn(P).
This law says that a process enclosed in an ambient whose name is not known by the environment (and cannot be used by the process itself) is equivalent to the terminated process. In many ways, an ambient resembles a named location. Like a location, it supports internal communication and can receive ambients and messages (represented themselves by ambients) from other places. However, ambients have a more general meaning. For instance, they can move across places while carrying their running contents with them. In this respect they behave rather like mobile agents. Moreover, as we have seen, the handling of names is rather liberal: the same name can be borne by several ambients within the same scope. In this way, ambients may be used to model service providers, of which there may be more than one, as long as the same service is granted. As mentioned earlier, one of the initial motivations for the AMBIENT calculus was to model firewall crossing in large networks. In fact, the calculus is rather ambitious, and intends to model a variety of distributed programming concepts such as channels, network nodes, packets, services and software agents. Some examples may be found in [33]. In the same work, it is also shown how the calculus can be used to encode languages such as the asynchronous TT-calculus and some X-calculi. Current work on the AMBIENT calculus is focussed on type systems for controlling the type of values transmitted within ambients [32] and controlling mobility. In [103], a modified calculus called Safe Ambients is ^ Note that the o p e n operation provides a form of objective migration, of the contents of an ambient into its father ambient.
1028
/. Castellani
proposed, with a type system for controlling mobility and preventing so-called "dangerous interferences". Modal logics accounting for the spatial structure of ambients via the use of "spatial" modalities are also under investigation [34]. 4.3.4. The Seal calculus. Like the AMBIENT calculus, the SEAL calculus of Castagna and Vitek [161] is designed to model distributed computing over large scale open networks. As some of the previous formalisms examined in this section, the SEAL calculus takes the stand of exposing the network topology and handing over control of localities to the system programmer. However, compared to other calculi, the SEAL calculus focusses more particularly on the security issues raised by the new paradigm of network programming: it also aims to provide programmers with protection mechanisms for their resources and against malevolent hosts. Among the calculi we have seen, only the DTT-calculus of Hennessy and Riely and the AMBIENT calculus had a strong concern in security. The SEAL calculus may be concisely described as a polyadic synchronous TT-calculus with hierarchical mobile locations and resource access control. The main entities of the calculus are processes, locations and resources. A process P is a term of the mini synchronous TT-calculus, where channels are tagged with the relative location to which they belong. This will be explained more precisely below, when discussing the use of channels for supporting communication and mobility. Moreover a process can also be a named location containing a process, that is a seal n[P]. Locations are called seals in the calculus. A seal is written n[P], where A? is a name (not necessarily unique) and P is the process running inside the seal. Like channel names, seal names can be transmitted in communication and restricted upon. Since a seal encapsulates a process, and a seal is itself a process, it is clear that seals are hierarchically structured. Processes which are not contained in a seal are assumed to be placed at the root's location, thus all processes are - explicitly or implicitly - located at some seal. In n[P], the seals contained in P are called the children of M, while n is called iYitiv parent. Seals are also the migration units of the calculus. The migration of a seal is ordered by the parent seal, and a seal can only be moved one level up or one level down the hierarchy. This is achieved, as we will see, by transmitting the name of the seal to be moved. As in the DTT-calculus, the only resources of the SEAL calculus are channels. Channels are used, as usual, for the communication of names. The SEAL calculus provides both local communication, between processes running in the same seal, and linear proximity communication, between processes placed in the parent-child relationship. No direct communication is possible, for instance, between sibling seals. For distant communication, the routing of messages in the hierarchy of seals must be explicitly programmed. Channels are located in seals (inherited from the enclosing process),'^'^ and processes have access to local channels as well as to their parent's and children's channels. To enable processes to refer to proximity channels, channel names are annotated with tags referring to their relative place in the hierarchy. Formally, tags are defined by ry ::= • 111«. denoting respectively the current seal, the parent seal, and a child seal bearing name n. Then input and output actions for transmitting channel names are given by:
av.=
x\-f)\x\-f).
^^ Thus channels may be located in different seals.
Process algebras with localities
1029
Two co-located processes communicate via a local channel. We have for instance:
r(^).p
I x*(^).e ^ p I Q{^/f}-
For immediate upward or downward communication, a channel of either of the two partners may be chosen. Therefore the communication will always involve a channel tagged • and a complementary channel tagged with t or some name n. For instance we have: n[xH~t)^P] I x^•>^).e ^ n[P] I Q{^/y}.
(21)
In fact, this is only approximately true. Because of the security orientation of the calculus, a further ingredient will be required for non-local communication to take place. The idea is that allowing non-local processes (like 'x^Ct).P in this example) to use local channels (like channel x of process x*(y').Q) constitutes a threat to security. Indeed the first process may have migrated to location n from some untrusted location. Then it should not be allowed to access the local channel x, unless it is given explicit permission to do so. To control inter-seal communication, the calculus proposes a protection mechanism called portal. The idea is the following: for seal A to be able to use a channel x of seal B, seal B must first open a portal for A at jc. A portal is a linear access permission for a channel: it can only be used once. Formally, a new construct open,^ x.P (respectively open^ x.P) is introduced: it denotes a process which opens a portal for seal ri allowing it to perform an input (respectively output) on local channel x, and then continues like P. The correct reduction replacing (21) is then: n[xH~t).P]
I x'(y).Q
I open,, x.O -^ n[P] \ e i T / T ) I 0.
(22)
The last important point to examine is mobility of seals. As mentioned earlier, seals may be transmitted over channels, and that is the way mobility is modelled in the calculus. The prefixing actions for exchanging seal names will be written T^{y} and x^^{~f}, to distinguish them from the actions used for transmission of channel names. Note that an output action can only send a single seal name, for a reason that will soon be made clear. The complete syntax for prefixing actions is then: a::=xHy)\xHy)\x'^{y}\xH-f}. A seal can only be moved by a process contained in the parent seal. A seal move action, represented by an output 3c''{j}, requires that a seal with name y be present in the current seal, otherwise it blocks. If several seals match the name, then one of them is chosen nondeterministically. Note the difference with the ambient calculus: migration is objective here (a process causes a seal at the same level to move), while it was subjective in the ambient calculus (a process was causing the whole enclosing ambient to move). The synchronization of a move action T^{y} with a receive action x''{~f} where ~t = z\, ...,Zk has the effect of creating k copies of seal y under the names z i , . . . , ZA . The seal y will disappear from the location of the sender and the copies z\, •. .,Zk will appear at the location of the receptor. Thus seals may be both renamed and duplicated during a migration. This may be useful respectively for protection and fault tolerance.
1030
/. Castellani
Regarded as a tree rewriting operation on the hierarchy of seals, a move T^[y] has the effect of disconnecting a subtree rooted at seal y and grafting it either onto the parent oiy, or onto one of y's children, or back onto y itself. Each of these moves can be accompanied by renaming and introduce copies. For instance, suppose P = Jc^ [y]'P' and R = x*[z}.R'. Then we have the following reduction: R\n[P\
m[Q] I y[S]] ^ R' \ z[S] \ n[P' \ m[Q]]
(23)
where P causes the seal named y to move into its parent seal (the root seal in this case) renaming it with z^^ This is an example of upward migration. Note that the location of the transmission channel is not important: the same reduction would have taken place if P ==x*{y].P' and R = x"{z}.R'. The direction of the migration is always from the sender to the receptor seal. The following is an example of downward migration, assuming P = x"'{y}.P' mdQ=x^z}.Q': P\m[Q]\y[S]^P'\m[Q'\z[S]l
(24)
The two reductions (23) and (24) show that the transmission of a seal name is really a spawn operation in disguise. Its semantics is rather different from that of channel transmission. The protection mechanism by means of portals, on the other hand, is the same as for channel names, thus the formulation of migration as a form of communication is convenient. Note that as regards protection, the direction (upward or downward) in the hierarchy of seals makes no difference: portals are used in the same way to protect a seal from its parent seal or from a subseal. For migration instead this direction is important, since a (process in the) parent can instruct a child to move but not vice versa. The SEAL calculus was designed to provide protection against attacks from visitor hosts as well as attacks from the environment. A detailed discussion about the protection mechanisms of the calculus against various kinds of typical attacks (like disclosure of information, denial of service and Trojan horses) may be found in [160]. Some programming examples are presented in [161]. An implementation of the calculus is also under development. We conclude with a brief comparison with the AMBIENT calculus, which was one of the sources of inspiration for the SEAL calculus. We have already remarked that seal mobility is objective while ambient mobility is subjective. Moreover, mobility of ambients is controlled by capabilities which can be transmitted and used more than once. By contrast, the SEAL calculus gives full control of mobility to the environment; moreover, this control is fine-grained since permissions must be renewed for each non-local access. Furthermore, the SEAL calculus does not allow boundaries to be dissolved: the open operation of the AMBIENT calculus is considered dangerous in that it allows a lower-level agent, which should be subject to some control, to step at the local level. Finally, while the AMBIENT calculus focusses on migration rather than communication, the SEAL calculus gives priority "^^ Again this is not completely exact, and a portal is needed to authorize the use of non-local channels, just as for channel name transmission.
Process algebras with localities
1031
to communication, and indeed implements migration via communication. Like the AMBIENT calculus, the SEAL calculus also satisfies the/7^//(:r^r^wfl//^^M«r/c>« {vx)x[P] = 0, which in this case holds without requirements on P. This equation states that an arbitrary process can be completely isolated from the rest of the system, i.e., prevented from any communication with it. It is a useful security property as it guarantees that a seal trapped in a firewall cannot disclose any information. 4.3.5. Nomadic Pict. The language NOMADIC PiCT [152]of Sewell, Wojciechowskiand Pierce is an extension of PiCT, a strongly-typed high-level concurrent language based on the asynchronous TT-calculus [114,94,21], which was developed by Pierce and Turner [158, 132]. PiCT supports a wide range of high-level constructs including data structures, higherorder functional programming, concurrent control structures and objects. The vocation of NOMADIC PICT is to "complete" PICT to make it suitable for wide-area distributed programming. In particular, NOMADiC PiCT accommodates notions of location, agent and migration. The language is layered in two levels of abstraction: • A low level that makes distribution and network communication clear; at this level one has location-dependent constructs, like agent migration and asynchronous communication between located agents. • A high level where the distributed infrastructure can be ignored; this level provides location-independent constructs to allow mobile agents to communicate without having to explicitly track each other's movements. In this brief description we shall not make a sharp distinction between the language NOMADIC PiCT itself [152] and the underlying calculus, the Nomadic TT-calculus studied in [151]. We shall essentially present the calculus, but using mostly the notation of [152]. The main entities of the language are sites, agents and channels. Sites may be thought of as physical machines: they are unstructured and each site has a unique name s. Agents are units of executing computation that can migrate between sites. At any moment, an agent is located at a particular site s. Every agent has a name a, which is unique in the whole network. Channels are the support for communication: they are used for asynchronous communication both within an agent and between agents (possibly located at different sites). Channel names c can be created dynamically, as in the TT-calculus. New names of agents can also be created dynamically, while names of sites are fixed once and for all. All names can be transmitted in communication. Low-level language. The syntax is rigidly structured into the three categories of sites, agents and processes. Sites are assumed to be given: they are the set of machines, or rather an instantiation of the runtime system on these machines. Sites contain a number of agents running in parallel: the initial assignment of agents to sites is also supposed to be known. Finally, processes always appear as the body of some agent. They are built with the usual constructs of the asynchronous TT-calculus (with typed channels), together with two new primitives for agent creation and migration: a g e n t a = P ±nQ
agent creation
m i g r a t e to s.P
agent migration.
1032
/. Castellani
The effect of the first instruction in the body of some agent b is to create a new agent (2 [/^] at the same site, with name a and body P. After the creation, both P and Q start executing in parallel with the rest of agent b. The new name a is unique and is binding in both P and QThe execution of the second instruction in an agent a makes the whole agent move to site s. After the migration, P starts executing at site s in parallel with the rest of agent a. More formally, assuming an environment C recording the sites of agents, with C{a) = Sa, the semantics of these constructs is given by: (£,fl[(agent/7=Pin(2)|/?]) ^
{CAvb@Sa){b[P]\a[Q\
R])).
(£, ^ [ ( m i g r a t e t o s.P) \ Q]) -^ {C[a ^ s), a[P \ Q]). The notation {vb@Sa) represents creation of a new name b at site Sa, while C[a h-> s) is environment update. The semantics of the construct {va@s) is given by the rule: {C[a i-> s], P) -^ {C'{a ^ s'], P') (£, (va@s)P) -> (C\ (va@s')P')' Note that migration is subjective, as in the AMBIENT and DJOIN calculi. It is is also asynchronous, since processes inside the moving agent a - other than the prefixed process P continue to run until the migration takes place. Note also that the m i g r a t e instruction is the only means provided by the syntax to explicitly specify the site of an agent. Direct communication on channels is only supported between processes running in the same agent. For interaction between agents, the low-level language provides two distinct constructs for local and distant communication: {a)c\v {a@s)c\v
send to local agent 1 > send to distant agent J
send to located agent.
The construct {a)c\v in an agent b attempts to deliver the message c\v ("value" v on channel c) to agent a on the same site as b. The construct (a@s)clv, instead, tries to deliver the message civ to agent a on site s. Both operations fail silently if agent a is not found on the expected site. The implicit assumption is that at the low level agents must know each other's location in order to communicate successfully. In fact, these two constructs can be derived from another instruction available in the low-level language: i f l o c a l {a)clv t h e n P e l s e Q
test-and-send to local agent.
This instruction in the body of an agent b has two possible effects: if agent a is present on the same site, the message civ is delivered to a and process P is spawned in parallel with the rest of b ; otherwise the message is discarded and Q is spawned in parallel with the rest of b. This construct, which reintroduces some implicit synchrony in the language.
Process algebras with localities
1033
is mainly used for implementing the global communication mechanism of the high-level language. Formally, its semantics is given by the rule: (£,fl[if l o c a l {b)c\v t h e n P e l s e Q]) -^ { \(C.a[Q])
otherwise,
where again a structural congruence is used for splitting and grouping parts of an agent: b[R\ I b[S] = b[R I S]. The test-and-send is the only primitive communication construct of the low-level language, as the previous two constructs can be encoded as follows: (a)c\v = i f l o c a l {a)c\v t h e n n// e l s e nil (a@s)c\v = i f l o c a l {a)c\v t h e n nil e l s e a g e n t b = m i g r a t e t o s.(a)c\v i n nil. High-level language. The high-level language is obtained by adding a single locationindependent construct to the low-level language, namely one for global communication: (a@l)c\v
send to agent anywhere.
The effect of such a global output is to deliver the message c\v to agent a, no matter what its current location and what further migrations it can undergo. The idea is that at the high level an agent must be able to access all other agents uniformly, without having to locate them explicitly. It is important to note, on the other hand, that the global communication construct is not primitive in the language, and has to be implemented using the low-level communication primitives. The low-level primitives remain available in the high-level language, for interacting with agents whose locations are predictable. This possibility of choice is interesting since global communication is potentially expensive to implement. As can be seen, the model of NOMADIC PICT is very simple. The units of migration are agents, while sites are simply units of distribution. The calculus LLinda. Linda [35] is a coordination language where processes share a global environment called a tuple space, and interact by fetching and releasing tuples asynchronously in this space. Distributed versions of Linda have been proposed, where multiple tuple spaces are introduced and remote operations on them are provided. A variant considered in [36] also allows nested tuple spaces. The calculus LLinda of De Nicola, Ferrari and Pugliese [120] combines a core distributed Linda with a set of operators borrowed from Milner's calculus CCS. Both tuple spaces and operations over tuples are located. A primitive for spawning a process at a remote tuple space is added (generalizing an existing operation on tuples). The located tuple spaces of LLinda have a flat structure, and can be accessed from other tuple spaces without restrictions. Some typical examples (like a remote procedure call and a remote server) are provided to illustrate the use of the language for remote programming. An evolution of LLinda, the calculus KLAIM studied subsequently by the same authors [121], is also equipped with a type system for checking access rights of mobile agents. A prototype language based on KLAIM has been implemented.
1034
/. Castellani
Discussion. To summarize, the models reviewed in this section can be broadly divided in two classes as regards their treatment of locations: • Models based on a flat space of locations, where the migrating entities are processes or agents. These are essentially the distributed TT-calculi, excluding the fi(p/-calculus. Migration is mostly weak in these calculi; it is only strong (and asynchronous) in NOMADIC PiCT. Research has focussed on type systems guaranteeing a correct or safe use of names, be they locations or channels. In some cases, as in the DTT-calculus and in its asynchronous version, locations are also units of communication. In the TTH-calculus, the only calculus in this category to account for failure, locations are also units of failure. • Models based on hierarchical locations, where the migrating entities are locations themselves. The representation of migration is more sophisticated here, and better suited for handling failure and security issues. In all these models locations are units of migration and migration is strong and asynchronous. In the DJOIN calculus,"*^ locations are also units of failure. In the AMBIENT calculus and the SEAL calculus the issue of failure is neglected (or judged inappropriate for large networks), and priority is given to security questions. In the SEAL calculus locations are clearly treated as units of security. In the AMBIENT calculus locations are units of communication and it is more debatable whether they can be seen as units of security. In some of these models, a form of process migration is also provided. This is the case for instance in the DTT "^-calculus. In the AMBIENT calculus, process migration is introduced by the open construct, which allows processes at one location to diffuse into their father's location. In the DJoiN calculus and in the JpZ-calculus, message movement towards a distant destination may be seen as an elementary form of process migration. All these languages provide an explicit migration primitive (which in the SEAL calculus is rendered as communication of location names). In all models locations have names which can be transmitted in communication. In all cases except for NOMADiC PiCT, where they are fixed, locations may also be dynamically created; the J/7/-calculus forbids creation of new locations at the top level, since this is meant to represent a fixed architecture of physical machines. The main sources for this survey on distributed calculi for mobility were the original papers cited in the various sections. The references [30] and [148] were also of help.
5. Conclusions In this chapter we have reviewed two main approaches to process algebras with locations, which we called abstract and concrete. These approaches respond to different concerns: in the first case locations are introduced to distinguish parallel components, as the basis for particular noninterleaving semantics. Locations are treated here as "units of sequential computation", although parallel subcomputations may be spawned at sublocations as the execution proceeds. In the second approach locations are used to support a new style As in other calculi inspired from it, like the Jp/'-calculus and the DTT ^-calculus.
Process algebras with localities
1035
of network-aware programming. In general, locations contain multi-threaded computation here, and their space may vary as a consequence of location creation and migration. In the first approach transitions are indexed by the location where they occur, while in the second approach there is a variety of possible observations of locations, ranging from indexed transitions (as in Murphy and Corradini's model) to more implicit observations. Locations may even become completely unobservable under certain conditions (for instance in the DJOIN and TCM calculi in the absence of failures). Since locations are directly reflected in the semantics in the abstract approach and not in the concrete approach (if we except Murphy and Corradini's work), the reader might be puzzled by our terminology ''abstract vs concrete": this refers to the fact that in the "abstract" case locations are observed modulo a relabelling of their names, while in the "concrete" case the names of locations, even though their observation is more restricted, have an absolute meaning and cannot be abstracted upon. Although locations do not have the same role in the two approaches, the models used to represent them, be they flat or structured, are not substantially different. Within the abstract approaches, techniques have been developed for reasoning about traditional (CCSlike) process calculi enriched with locations, and a body of results have been obtained. As regards the integration of locations and mobility, on the other hand, interesting calculi have been proposed, with various foci, but the theory has not yet stabilized. The question is then: to which extent can techniques and results developed for a simple process calculus (CCS) in the first approach be extended to the more sophisticated calculi for mobile computation addressed by the concrete approach? In exposing the abstract approach, we have concentrated on two different presentations of location semantics, based respectively on static and dynamic notions of location. The relation between the two formulations has been examined in full detail. The connection with other work on noninterleaving semantics for CCS has also been discussed in some depth. Equational and logical characterizations for the location equivalence and preorder were also mentioned. Very little has been said, on the other hand, about questions of decidability and verification for location equivalence and other distributed equivalences. We shall briefly touch upon such issues here. As regards decidability, a first decision procedure for distributed bisimulation, based on a tableau method, was presented by Christensen in [42], for a recursive fragment of CCS with parallelism known as BPP (Basic Parallel Processes, see Section 3.2). The correctness of this procedure was based on a cancellation property of the form p\q ^d p\r ^ q ^d r, which does not hold for other noninterleaving equivalences such as location equivalence or causal bisimulation. Building on work by Christensen et al. [43,44], an alternative method for the decision of such equivalences over BPP was proposed by Kiehn and Hennessy in [101]. An extension of this decision procedure to the weak versions of the equivalences over representative subclasses of BPP is also offered in the same work. Another concern was to find compact representations for the location transition system and efficient verification procedures for location equivalence. In its original dynamic formulation of [29], the location semantics associates an infinitely branching transition system with any non-trivial CCS process. As soon as recursion is involved, this transition system also becomes infinite state. We thus lose the correspondence between regular behaviours and finite transition system representations that we have in the standard CCS semantics.
1036
/. Castellani
Now, while infinite-branching can be easily removed by choosing canonical locations at each step (as in the numbered transition system of Yankelevich [171] or the occurrence transition system considered in Section 2.6), the infinite progression is really intrinsic to the dynamic location semantics (as to any other history dependent semantics). In its dynamic formulation, location equivalence involves the creation of new locations at each step. It thus requires the use of specific algorithms. In particular these algorithms work only on pairs of processes - following the so-called on the fly verification technique - and do not allow for the definition of minimal representatives for equivalence classes of processes. To overcome this problem, Montanari and Pistore have proposed in [115] a model called location automata: these are enriched transition systems where the information on locations appears on the labels, and is used in such a way that location equivalence on terms can be reduced to the standard bisimulation on the corresponding location automata. Moreover, location automata provide ^zn/r^ representations for all finitary CCS processes (those where no parallelism appears under recursion). This has the pleasant consequence that standard algorithms can be applied for the verification of location equivalence, with a worst case complexity which is comparable to that of verifying ordinary bisimulation, and minimal representatives for processes can be defined. Recently, Bravetti and Gorrieri have proposed a technique that improves on Montanari and Pistore's model in that it offers a compositional interpretation of processes into a variation of location automata [31]. Although this technique has been mainly apphed to STbisimulation, it may reveal useful also for location bisimulation. As regards the static definition of location equivalence, a simple algorithm was proposed by Aceto in [5] for checking this equivalence on a subset of CCS (nets of automata). This line of investigation was not further pursued, however, and no experimentation was conducted on the static formulation of the equivalence for full CCS. Concerning the concrete approach to localities, and particularly the new formalisms for combining locations and mobility, our account in Section 4.3 was admittedly very focussed and far from complete. For the sake of uniformity, we have concentrated on a family of calculi derived from the TT-calculus. However, mobility of agents and processes is a vast and rapidly evolving field, and several other languages for mobile agents have been proposed in the literature in the last decade. To mention but a few, proposals like Telescript, Obliq, Oz, Kali Scheme, Odyssey, Voyager and Agent Tel all bear some relation with the calculi examined here. Aspects of distribution have also been studied in other settings; most of the languages cited in the previous paragraph are based on the object-oriented paradigm; for a treatment of locations in the context of concurrent constraint programming see for instance [139].
Acknowledgements I would Hke to thank the anonymous referee for helpful comments on a previous version of this chapter. Many thanks also to Luca Aceto, Roberto Amadio, Gerard Boudol, Rob van Glabbeek, Matthew Hennessy, Astrid Kiehn, Alban Ponse and Davide Sangiorgi for giving me useful feedbacks on various parts of this material. This work was partly supported by the European Working Group C0NFER2 and by the French RNRT Project MARVEL.
Process algebras with localities
1037
References [1] L. Aceto, On Relating Concurrency and Nondeterminism, Proceedings MFPS-91, Lecture Notes in Cornput. Sci. 598 (1991). [2] L. Aceto, Action-refinement in Process Algebras, Distinguished Dissertations in Computer Science, Cambridge University Press (1992). [3] L. Aceto, History preserving, causal and mixed-ordering equivalence over stable event structures (Note), Fundamenta Informaticae 17 (4) (1992), 319-331. [4] L. Aceto, Relating distributed, temporal and causal obsenations of simple processes, Fundamenta Informaticae 17 (4) (1992), 369-397. [5] L. Aceto, A static view of localities. Formal Aspects of Computing 6 (1994), 201-222. [6] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [7] L. Aceto and M. Hennessy, Towards action-refinement in process algebras. Inform, and Comput. 103 (2) (1993), 204-269. [8] L. Aceto and M. Hennessy, Adding action refinement to afiniteprocess algebra. Inform, and Comput. 115 (2) (1994), 179-247. [9] R. Amadio, An asynchronous model of locaUty, faihire, and process mobiUty, Proceedings COORDINATION-97, Lecture Notes in Comput. Sci. 1282 (1997). [10] R. Amadio, G. Boudol and C. Lhoussaine, The receptive distributed Pi-calculus, Proceedings FST-TCS99, Lecture Notes in Comput. Sci. 1738 (1999). [11] R. Amadio, I. Castellani and D. Sangiorgi, On bisimulations for the asynchronous n-calculus, Theoret. Comput. Sci. 195 (1998), 291-324. [12] R. Amadio and S. Prasad, Localities and failures. Proceedings FST-TCS-94, Lecture Notes in Comput. Sci. 880(1994), 205-216. [13] E. Badouel and P. Darondeau, Structural operational specifications and trace automata. Proceedings CONCUR-92, Lecture Notes in Comput. Sci. 630 (1992). [14] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 18, Cambridge University Press (1990). [15] M. Bednarczyk, Categories of asynchronous systems, Ph.D. Thesis, University of Sussex (1988). [16] M. Bednarczyk, Hereditary history-preserxing bisimulation, or what is the power of the future perfect in program logics. Research Report, Institute of Computer Science, Polish Academy of Sciences, Gdansk (1991). [17] J. Bergstra, A. Ponse and S. Smolka, eds. Handbook of Process Algebra, Elsevier, Amsterdam (2(X)1). [18] G. Berry and G. Boudol, The chemical abstract machine, Theoret. Comput. Sci. 96 (1992), 217-248. [19] E. Best, R. Devillers, A. Kiehn and L. Pomello, Concurrent bisimulations in Petri nets. Acta Inform. 28 (3) (1991) 231-264. [20] M. Boreale, C. Foumet and C. Lanve, Bisimulations in the Join-calculus, Proceedings PROCOMET-98, 1998. [21] G. Boudol, Asynchrony and the TT-calculus. Research Report 1702, INRIA, Sophia-Antipolis (1992). [22] G. Boudol, The pi-calculus in direct style. Proceedings POPL-97, 1997. [23] G. Boudol and I. Castellani, On the semantics of concurrency: Partial orders and transition systems. Proceedings TAPSOFT-87, Lecture Notes in Comput. Sci. 249 (1987), 123-137. [24] G. Boudol and I. Castellani, Concurrency and atomicity, Theoret. Comput. Sci. 59 (1988), 25-84. [25] G. Boudol and I. Castellani, Permutation of transitions: An event structure semantics for CCS and SCCS, Proceedings REX SchoolAVorkshop on Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Noordwijkerhout, Lecture Notes in Comput. Sci. 354 (1988). [26] G. Boudol and I. Castellani, Flow models of distributed computations: Event structures and nets. Report 1482, INRIA, 1991. Previous version by G. Boudol in: Proceedings LITP Spring School, La Roche-Posay, Lecture Notes in Comput. Sci. 469 (1990). [27] G. Boudol and I. Castellani, Flow models of distributed computations: Three equivalent semantics for CCS, Inform, and Comput. 114 (2) (1994), 247-314. [28] G. Boudol, I. Castellani, M. Hennessy and A. Kiehn, Obser\'ing localities, Theoret. Comput. Sci. 114 (1993), 31-61.
1038
/. Castellani
[29] G. Boudol, I. Castellani, M. Hennessy and A. Kiehn, A theory of processes with localities. Formal Aspects of Computing 6 (1994), 165-200. [30] G. Boudol, F. Germain and M. Lacoste, Projet MARVEL: Document d'analyse des langages et modeles de la mobilite. Document of the French RNRT Project MARVEL (1999). [31] M. Bravetti and R. Gorrieri, Deciding and axiomatizing ST-bisimulation for a process algebra with recursion and action refinement. Proceedings EXPRESS-99, ENTCS 27 (1999). [32] L. Cardelli, G. Ghelii and A. D. Gordon, Mobility types for mobile ambients. Proceedings ICALP-98, Lecture Notes in Comput. Sci. 1644 (1998), 230-239. [33] L. Cardelli and A. D. Gordon, Mobile ambients. Proceedings FoSSaCS-98, Lecture Notes in Comput. Sci. 1378(1998). [34] L. Cardelli and A.D. Gordon, Anytime, anywhere: Modal logics for mobile ambients. Proceedings POPL2000, ACM Press (2000). [35] N. Carriero and D. Gelemter, Linda in context, JACM 32 (4) (1989), 444-458. [36] N. Carriero, D. Gelemter and L. Zuck, Bauhaus Linda, Proceedings Object-Based Models and Languages for Concurrent Systems, Lecture Notes in Comput. Sci. 924 (1995). [37] L Castellani, Bisimulations for concurrency, Ph.D. Thesis, University of Edinburgh (1988). [38] I. Castellani, Observing distribution in processes: Static and dynamic localities, Intemat. J. Found. Comput. Sci. 4 (6) (1995), 353-393. [39] L Castellani and M. Hennessy, Distributed bisimulations, JACM 36 (4) (1989), 887-911. [40] I. Castellani and G.Q. Zhang, Parallel product of event structures, Theoret. Comput. Sci. 179 (1-2) (1997), 203-215. [41] L. Castellano, G. De Michelis and L. Pomello, Concurrency vs interleaving: An instructive example. Bull. EATCS31(1987), 12-15. [42] S. Christensen, Distributed bisimilarity is decidable for a class of infinite state-space systems. Proceedings CONCUR-92, Lecture Notes in Comput. Sci. 630 (1992). [43] S. Christensen, Decidability and decomposition in process algebras, Ph.D. Thesis, University of Edinburgh (1993). [44] S. Christensen, Y. Hirshfeld and F. Moller, Bisimulation equivalence is decidable for all parallel processes. Proceedings LICS-93, IEEE Computer Society Press (1993), 143-157. [45] F. De Cindio, G. De Michelis, L. Pomello and C. Simone, A Petri net model for CSP, Proceedings CIL-81 (1981). [46] F. Corradini, Space, time and nondeterminism in process algebras, Ph.D. Thesis, Universita di Roma La Sapienza (1996). [47] F. Corradini and R. De Nicola, On the relationships between four partial ordering semantics, Fundamenta Informaticae 34 (4) (1996), 349-384. [48] F. Corradini and R. De Nicola, Locality based semantics for process algebras. Acta Inform. 34 (1997), 291-324. [49] F. Corradini and D. Murphy, Located processes and located processors. Report SI/RR-94/02, Universita di Roma La Sapienza (1994). [50] F. Corradini and R. De Nicola, Distribution and locality of concurrent systems. Proceedings ICALP-94, Lecture Notes in Comput. Sci. 820 (1994). [51] Ph. Darondeau and P. Degano, Causal trees. Proceedings ICALP-89, Lecture Notes in Comput. Sci. 372 (1989), 234-248. [52] Ph. Darondeau and P. Degano, Causal trees: Interleaving -H causality. Proceedings LITP Spring School, La Roche-Posay, Lecture Notes in Comput. Sci. 469 (1990). [53] Ph. Darondeau and P. Degano, Refinement of actions in event structures and causal trees, Theoret. Comput. Sci. 118(0(1993), 2 1 ^ 8 . [54] P. Degano, R. De Nicola and U. Montanari, On the consistency of truly concurrent operational and denotational semantics. Proceedings LICS-88, IEEE Computer Society Press (1988). [55] P. Degano, R. De Nicola and U. Montanari, Partial orderings descriptions and observations ofnondeterministic concurrent processes. Proceedings REX SchoolAVorkshop on Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Noordwijkerhout, Lecture Notes in Comput. Sci. 354 (1989).
Process algebras with localities
1039
[56] P. Degano, R. De Nicola and U. Montanari, A partial ordering semantics for CCS, Theoret. Comput. Sci. 75 (3) (1990), 223-262. [57] P. Degano, R. Gorrieri and S. Marchetti, An exercise in concurrency: A CSP process as a C/E system. Advances in Petri Nets 1988, Lecture Notes in Comput. Sci. 154 (1988). [58] P. Degano and U. Montanari, Concurrent histories: A basis for observing distributed systems, J. Comput. System Sci. 34 (2/3) (1987), A12-A6\. [59] P. Degano, R. De Nicola and U. Montanari, Partial ordering derivations for CCS, Proceedings FCT-85, Lecture Notes in Comput. Sci. 199 (1985). [60] P. Degano, R. De Nicola and U. Montanari, Observational equivalences for concurrency models. Formal Description of Programming Languages III, North Holland (1987), 105-132. [61] P. Degano, R. De Nicola and U. Montanari, A distributed operational semantics for CCS based on condition/event systems. Acta Inform. 26 (1/2) (1988), 59-91. [62] P. Degano and C. Priami, Proved trees. Proceedings ICALP-92, Lecture Notes in Comput. Sci. 623 (1992). [63] R. Devillers, On the definition of a bisimulation notion based on partial words, Petri Net Newsletter 29 (1988), 16-19. [64] U, Engberg and M. Nielsen, A calculus of communicating systems with label-passing. Report DAIMI PB-208, Computer Science Department, University of Aarhus, Denmark (1986). [65] G. Ferrari, Unifying models of concurrency, Ph.D. Thesis, University of Pisa (1990). [66] G. Ferrari, R. Gorrieri and U. Montanari, An extended expansion theorem. Proceedings TAPSOFT-91, Lecture Notes in Comput. Sci. 494 (1991). [67] G, Ferrari and U. Montanari, Towards the unification of models of concurrency. Proceedings CAAP-90, Lecture Notes in Comput. Sci. 431 (1990). [68] G. Ferrari and U. Montanari, Parametrized structured operational semantics, Fundamenta Informaticae 34(1998), 1-31. [69] C. Foumet, The Join-calculus: A calculus for distributed mobile programming, Ph.D. Thesis, Ecole Polytechnique (1998). [70] C. Foumet and G. Gonthier, The reflexive chemical abstract machine and the Join-calculus, Proceedings POPL-96 (1996), 372-385. [71] C. Foumet, G. Gonthier, J.-J. Levy, L. Maranget and D. Remy, A calculus of mobile agents. Proceedings CONCUR-96, Lecture Notes in Comput. Sci. 1119 (1996). [72] C. Foumet and L. Maranget, The Join-calculus language, Release 1.04 (documentation and user's manual) (1999). [73] J.L. Gischer, Partial orders and the axiomatic theory of shuffle, Ph.D. Thesis, Stanford University (1984). [74] R.J. van Glabbeek, The refinement theorem for ST-bisimulation semantics. Proceedings IFIP TC2 Working Conference on Programming Concepts and Methods, Israel, April 1990, M. Broy and C.B. Jones, eds, North-Holland (1990), 27-52. [75] R.J. van Glabbeek and U. Goltz, Equivalence notions for concurrent systems and refinement of actions. Proceedings MFCS-89, Lecture Notes in Comput. Sci. 379 (1989). [76] R.J. van Glabbeek and U. Goltz, Partial order semantics for refinement of actions - neither necessary nor always sufficient but appropriate when used with care. Bull. EATCS 38 (1989). [77] R.J. van Glabbeek and U. Goltz, Equivalences and refinement. Proceedings LITP Spring School, La Roche-Posay, Lecture Notes in Comput. Sci. 469 (1990). [78] R.J. van Glabbeek and U. Goltz, Refinement of actions in causality based models. Proceedings REX Workshop on Stepwise Refinement of Distributed Systems: Models, Formalism, Correctness, Lecture Notes in Comput. Sci. 430 (1990). [79] R.J. van Glabbeek and U. Goltz, Refinement of actions and equivalence notions for concurrent systems, Hildesheimer Informatik-Berichte 6/98, Institut fiir Informatik, Universitat Hildesheim (1998). To appear in: Acta Inform. [80] R.J. van Glabbeek and F.W. Vaandrager, Petri net models for algebraic theories of concurrency. Proceedings PARLE-87, Lecture Notes in Comput. Sci. 259 (1987). [81] R.J. van Glabbeek and F.W. Vaandrager, The difference between splitting in n and n -\- \, Inform, and Comput. 136 (2) (1997), 109-142. [82] U. Goltz, On representing CCS programs by finite Petri nets, Proc. MFCS-88, Lecture Notes in Comput. Sci. 324 Springer (1988), 339-350.
1040
/. Castellani
[83] U. Goltz and A. Mycroft, On the relationship of CCS and Petri nets. Proceedings ICALP-84, Lecture Notes in Comput. Sci. 172 (1984). [84] U. Goltz and W. Reisig, The nonsequential behaviour of Petri nets. Inform, and Control 57 (2-3) (1983), 125-147. [85] U. Goltz and W. Reisig, CSPprograms as nets with individual tokens. Advances in Petri nets 1984, Lecture Notes in Comput. Sci. 188 (1985). [86] R. Gorrieri and U. Montanari, SCONE: A simple calculus of nets. Proceedings CONCUR-90, Lecture Notes in Comput. Sci. 458 (1990). [87] R. Gorrieri and A. Rensink, Action refinement. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2(X)1), 1047-1147. [88] J. Grabowski, On partial languages, Fundamenta Informaticae 4 (1) (1981), 427^98. [89] M. Hennessy, On the relationship between time and interleaving. Unpublished draft, Sophia-Antipolis (1980). [90] M. Hennessy, Axiomatising finite concurrent processes, SIAM J. Computing 17 (5) (1988). [91] M. Hennessy and H. Lin, Symbolic bisimulations, Theoret. Comput. Sci. 138 (1995). [92] M. Hennessy and J. Riely, Resource access control in systems of mobile agents. Proceedings HLCL-98, ENTCS 16(1998). [93] M. Hennessy and J. Riely, Type-safe execution of mobile agents in anonymous networks. Proceedings of the 1999 Workshop on Secure Internet Programming, Lecture Notes in Comput. Sci. 1603 (1999). [94] K. Honda and M. Tokoro, On asynchronous communication semantics. Proceedings Workshop on ObjectBased Concurrent Computing, Lecture Notes in Comput. Sci. 612 (1992). [95] A. Joyal, M. Nielsen and G. Winskel, Bisimulation and open maps. Proceedings LICS-93, IEEE Computer Society Press (1993), 418-427. [96] R Khrisnan, Distributed CCS, Proceedings CONCUR-91, Lecture Notes Comput. Sci. 527 (1991). [97] A. Kiehn, Concurrency in process algebras, Habilitation Thesis, Technische Universitat Munchen (1999). [98] A. Kiehn, Distributed bisimulations for finite CCS, Report 7/89, University of Sussex (1989). [99] A. Kiehn, Proof systems for cause based equivalences. Proceedings MFCS-93, Lecture Notes Comput. Sci. 711 (1993). [100] A. Kiehn, Comparing locality and causality based equivalences. Acta Inform. 31 (1994), 697-718. [101] A. Kiehn and M. Hennessy, On the decidability of noninterleaving process equivalences, Fundamenta Informaticae 30 (1997), 2 3 ^ 3 . [102] R. Langerak, Bundle event structures: A noninterleaving semantics for LOTOS, Technical Report, University of Twente (1991). [103] F. Levi and D. Sangiorgi, Controlling interference in ambients. Proceedings POPL-2000, ACM Press (2000). [104] J.-J. Levy, Some results in the Join-calculus, Proceedings TACS-97, Lecture Notes in Comput. Sci. 1281 (1997). [105] R. Loogen and U. Goltz, Modelling nondeterministic concurrent processes with event structures, Fundamenta Informaticae XIV (1) (1991), 39-74. [106] A. Mazurkiewicz, Concurrent program schemes and their interpretation. Report DAIMI PB-78, Aarhus University (1977). [107] A. Mazurkiewicz, Trace theory. Advances in Petri Nets 1986, Lecture Notes in Comput. Sci. 255 (1987). [108] M. Merro and D. Sangiorgi, On asynchrony in name-passing calculi, Proc. ICALP-98, Lecture Notes in Comput Sci. 1443, Springer-Verlag (1998). [109] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer-Verlag (1980). [110] R. Milner, Calculi for synchrony and asynchrony, Theoret. Comput. Sci. 25 (1983), 269-310. [ I l l ] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [112] R. Milner, The polyadic n-calculus: A tutorial. Technical Report ECS-LFCS-91-180, LFCS, University of Edinburgh (1991). [113] R. Milner, Functions as processes. Math. Structures Comput. Sci. 2 (2) (1992), 119-141. [114] R. Milner, J. Parrow and D. Walker, A calculus of mobile processes. Parts 1-2, Inform, and Comput. 100 (1)(1992), 1-77.
Process algebras with localities
1041
[115] U. Montanari and M. Pistore, Efficient minimization up to location equivalence. Proceedings ESOP-96, Lecture Notes in Comput. Sci. 1058 (1996). [116] U. Montanari and D. Yankelevich, A parametric approach to localities. Proceedings ICALP-92, Lecture Notes in Comput. Sci. 623 (1992). [117] U. Montanari and D. Yankelevich, Location equivalence in a parametric setting, Theoret. Comput. Sci. 149(1995), 299-332. [118] M. Mukund and M. Nielsen, CCS, Locations and asynchronous transition systems. Proceedings FST-TCS92, Lecture Notes in Comput. Sci. 652 (1992). [119] D. Murphy, Observing located concurrency. Proceedings MFCS-93, Lecture Notes in Comput. Sci. 711 (1993). [120] R. De Nicola, G. Ferrari and R. Pugliese, Locality based Linda: Programming with explicit localities. Proceedings TAPSOFT-FASE-97, Lecture Notes in Comput. Sci. 1214 (1997). [121] R. De Nicola, G. Ferrari and R. Pugliese, Klaim: A kernel language for agents interaction and mobility, IEEE Trans, on Software Engrg. 24 (5) (1998), 315-330. [122] M. Nielsen, CCS and its relationship to net theor\. Advances in Petri Nets 1986, Lecture Notes in Comput. Sci. 255 (1987). [123] M. Nielsen, G. Plotkin and G. Winskel, Petri nets, event structures and domains. Part I, Theoret. Comput. Sci. 13(1) (1981), 85-108. [124] E.-R. Olderog, Operational Petri net semantics for CCSP, Advances in Petri Nets 1987, Lecture Notes Comput. Sci. 266(1987). [125] E.-R. Olderog, Nets, Terms and Formulas: Three Views of Concurrent Processes and Their Relationship, Cambridge Tracts in Theoret. Comput. Sci. 23, Cambridge University Press (1991). [126] D. Park, Concurrency and automata on infinite sequences. Proceedings 5th Gl-Conference on Theoretical Computer Science, Lecture Notes in Comput. Sci. 104 (1981). [127] J. Parrow, An introduction to the n-calculus. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 479-543. [128] J. Peterson, Petri Net Theory and the Modeling of Systems, Prentice-Hall (1981). [129] C.A. Petri, Kommunication mit Automaten, Schriften des Institutes fur Instrumentelle Mathematik, Bonn (1962). [130] C.A. Petri, Nonsequential processes. Research Report 77-05, GMD, Sankt Augustin (1977). [131] B. Pierce and D. Sangiorgi, Typing and subtyping for mobile processes. Logic in Computer Science, 1993. Full version in: Mathem. Structures Comput. Sci. 6 (5) (1996). [132] B.C. Pierce and D.N. Turner, Pict: A programming language based on the pi-calculus. Technical Report CSCI476, Indiana University (1997). To appear in: Proof, Language and Interaction: Essays in Honour of Robin Milner, G. Plotkin, C. Stiriing and M. Tofte, eds, MIT Press. [133] G.D. Plotkin, A structural approach to operational semantics. Report DAIMI FN-19, Computer Science Department, Aarhus University (1981). [134] V.R. Pratt, The pomset model of parallel processes: Unifying the temporal and the spatial. Proceedings of Seminar on Concurrency, Lecture Notes in Comput. Sci. 197 (1985). [135] V.R. Pratt, Modelling concurrency with partial orders, Intemat. J. Parallel Programming 15 (1) (1986). [136] A. Rabinovich and B.A. Trakhtenbrot, Behaviour structures and nets, Fundamenta Informaticae XI (4) (1988), 357^04. [137] W. Reisig, On the semantics of Petri nets. Formal Models in Programming, North-Holland (1985), 347372. [138] W. Reisig, Petri Nets, EATCS Monographs on Theoretical Computer Science (1985). [139] J.-H. Rety, Distributed concurrent constraint programming, Fundamenta Informaticae 34 (1998), 323346. [140] J. Riely and M. Hennessy, Distributed processes and location failures. Proceedings ICALP-97, Lecture Notes in Comput. Sci. 1256 (1997). [141] J. Riely and M. Hennessy, A typed language for distributed mobile processes. Proceedings POPL-98 (1998). [142] J. Riely and M. Hennessy, Trust and partial typing in open systems of mobile agents. Proceedings POPL-99 (1999).
1042
/. Castellani
[143] D. Sangiorgi, Expressing mobility in process algebras: First-order and higher order paradigms, Ph.D. Thesis, University of Edinburgh (1992). [144] D. Sangiorgi, From n -calculus to higher-order n -calculus - and back, Proc. TAPSOFT-93, Lecture Notes Comput. Sci. 668 (1993). [145] D. Sangiorgi, Locality and interleaving semantics in calculi for mobile processes, Theoret. Comput. Sci. 155(1996), 39-83. [146] D. Sangiorgi, The name discipline of uniform receptiveness, Theoret. Comput. Sci. 221 (1999), 457^93. [147] V. Sassone, M. Nielsen and G. Winskel, Models for concurrency, Theoret. Comput. Sci. 170 (1-2) (1996), 297-348. [148] P. Sewell, A Brief Introduction to Applied n. Notes from lectures at the MATHFIT Instructional Meeting on Recent Advances in Semantics and Types for Concurrency, Imperial College (1998). [149] P. Sewell, Global/local subtyping and capability inference for a distributed n-calculus. Proceedings ICALP-98, Lecture Notes in Comput. Sci. 1443 (1998), 695-706. [150] P. Sewell, P.T. Wojciechowski and B.C. Pierce, Location independence for mobile agents. Proceedings of the 1998 Workshop on Internet Programming Languages (1998). [151] P. Sewell, P.T. Wojciechowski and B.C. Pierce, Location-independent communication for mobile agents: A two-level architecture. Technical Report 462, Computer Laboratory, University of Cambridge (1998). [152] P. Sewell, P.T. Wojciechowski and B.C. Pierce, Nomadic Pict: Language and infrastructure design for mobile agents. Proceedings of ASA/MA-99 (First International Symposium on Agent Systems and Apphcations/Third International Symposium on Mobile Agents) (1999). [153] M.W. Shields, Concurrent machines. The Comput. J. 28 (1985), 449^*65. [154] D.A. Taubner, Finite Representation of CCS and TCSP Programs by Automata and Petri Nets, Lecture Notes in Comput. Sci. 369 (1989). [155] D.A. Taubner, Representing CCS programs by finite predicate/transition nets. Acta Inform. 27 (1990). [156] B. Thomsen, Plain CHOCS, a second generation calculus for higher-order processes. Acta Inform. 30 (1993), 1-59. [157] B. Thomsen, L. Leth, S. Prasad, T.M. Kuo, A. Kramer, F Knabe and A. Giacalone, Facile Antigua release programming guide. Technical Report ECRC-93-20, ECRC, Munich (1993). [158] D.N. Turner, The polymorphic pi-calculus: Theory and implementation, Ph.D. Thesis, University of Edinburgh (1996). [159] F.W. Vaandrager, A simple definition of parallel composition for prime event structures. Technical Report CS-R8903, CWI, Amsterdam (1989). [160] J. Vitek and G. Castagna, Mobile computations and hostile hosts. Proceedings of the 10th JFLA (Joumees Francophones des Langages Applicatifs) (1999). [161] J. Vitek and G. Castagna, Seal: A framework for secure mobile computations. Workshop on Internet Programming Languages, D. Tsichritzis, ed. (1999). [162] W. Vogler, Behaviour preserving refinements of Petri nets. Proceedings Workshop on Graph-Theoretic Concepts in Computer Science, Lecture Notes in Comput. Sci. 246 (1987). [163] D. Walker, Objects in the n-calculus. Inform, and Comput. 116 (1995), 253-271. [164] J. Winkowski, Behaviours of concurrent systems, Theoret. Comput. Sci. 12 (1980), 39-60. [165] G. Winskel, Events in computation, Ph.D. Thesis, University of Edinburgh (1980). [166] G. Winskel, Event structure semantics for CCS and related languages. Proceedings ICALP-82, Lecture Notes in Comput. Sci. 140 (1982). [167] G. Winskel, Categories of models for concurrency. Proceedings Seminar on Concurrency, Lecture Notes in Comput. Sci. 197(1984). [168] G. Winskel, Event structures. Advances in Petri Nets 1986, Lecture Notes in Comput. Sci. 255 (1987). [169] G. Winskel, Petri nets, algebras, morphisms and compositionality. Inform, and Control 72 (1987), 197238. [170] G. Winskel and M. Nielsen, Models for concurrency. Handbook of Logic in Computer Science, Vol. 4, Oxford (1995), 1-148. [171] D. Yankelevich, Parametric views of process description languages, Ph.D. Thesis, University of Pisa (1993).
Process algebras with localities
1043
Subject index V-dynamic location equivalence, 987 TT-calculus, 948, 1007, 1013, 1017 TTi^-calculus, 1013, 1014, 1017 abstract, 947, 1034 access permission, 1029 access to resources, 1011 action refinement, 954, 956 actions, 959 agent creation, 1031 agent migration, 1031 agents, 1019, 1031 ambient calculus, 1026
communication, 1023 compound actions, 952 concrete, 947, 1010, 1011, 1034 concrete location, 1(X)9 concurrency, 950, 981 concurrent bisimulation, 955 condition/event systems, 954 configurations structures, 955, 1005 consistent location association, 967, 969 consistent occurrence aliasing, 984 CPP (Communicating Parallel Processes), 991, 996, 997, 999 cross-causalities, 952, 960, 1005
AMBIENT calculus, 949, 1013
asynchronous, 1015, 1016, 1021-1023 asynchronous :T-calculus, 1011, 1017, 1018, 1021, 1025 asynchronous bisimulation, 1018, 1026 asynchronous transition systems, 950, 977, 1000 atomic actions, 954 atomic locations, 962 barbed equivalence, 1012, 1017 bisimulation, 947 bisimulation equivalence, 949, 954, 1008 blocking, 1015 BPP (Basic Parallel Processes), 948, 991, 1001, 1002 BS-equivalence, 955 calculus LLinda, 1033 calculus LLINDA, 1013
canonical, 970, 974 canonical (dynamic) locations, 988 canonical distributions, 971, 985 canonical locations, 970, 971 canonical static locations, 1000 capabilities, 1020, 1021, 1026 causal bisimulation, 948, 954, 959, 960, 971, 995, 1003 causal path, 973, 981, 1008 causal semantics, 956, 962, 1001 causal transition system, 1003 causal trees, 950, 953, 1005 causality, 946, 950 CCS, 946, 980, 996, 1009-1011 channel names, 1(X)7 channel type, 1020 channels, 1019, 1028 Chemical Abstract Machine, 1017, 1023 circular migration, 1025
1014 DTT-calculus, 1019 deadlock-freedom, 1021 decidability, 1035 decorated (atomic) actions, 952 decorating, 959 decorating atomic actions, 954 DIS,964, 978 distant communication, 1014, 1032 distributed TT-calculi, 949 distributed bisimulation, 948, 953, 997, 998, 1002 distributed failure, 1022 distributed processes, 964, 1010, 1012 distributed semantics, 947, 949, 953, 956, 995 distributed transition system, 997 distributed JOIN calculus, 949, 1011, 1014, 1023 distribution, 947, 964, 970, 1014 distribution units, 946 distributions, 957, 967 dpi-calculus, 1021 dynamic location, 973, 986 dynamic location equivalence, 975 dynamic location preorder, 975 DTT,
equational characterization, 977 equivalence, 992 equivalence on the occurrence system, 984 event (transition) system, 980 event structures, 950 expansion law, 949, 954 failures, 1015, 1018, 1035 flat, 1009, 1015 flat space of locations, 1019, 1034 flow, 1005 general locations, 963 generalized distributed bisimulation, 999
1044
/. Cast ell ani
global, 1017 global causality, 991, 1000 global cause equivalence, 992, 1003 global causes, 992, 1003 global channels, 1021 global communication, 1015, 1016, 1021,1022, 1033 grape semantics, 953, 999, 1000 grapes, 952 hierarchical, 1015, 1021 hierarchical locations, 1034 hierarchically structured, 1024 history-preserving bisimulation, 948, 955, 959, 984, 1005, 1007 independent, 966 interleaving, 963 interleaving semantics, 946 invisible actions, 962 JOIN calculus, 1013, 1022
killing, 1012 KLAIM, 1013
label, 980 LCCS, 962, 963, 978 left-consistent location association, 972 local, 1021, 1022, 1032 local causality, 981, 984, 991 local cause bisimulation, 958 local cause equivalence, 978, 992 local causes, 948, 958, 992 local channel, 1020, 1029 local communication, 1014, 1020, 1028 local deadlock, 947, 962 local history preserving bisimulation, 958, 980, 984, 1006 local mixed-ordering equivalence, 948, 958, 1000 local/global cause, 992 local/global cause bisimulation, 992 local/global cause semantics, 948, 991 local/global cause transition system, 991 localities, 946, 947, 1010 localization of receptors, 1018, 1021, 1025 located equivalence, 1010, 1013 located-failure equivalence, 1012 location, 981,997 location automata, 1036 location equivalence, 948, 957, 991, 995, 1007, 1008, 1010, 1012 location failures, 948, 1011, 1025 location prefixing, 960, 962, 963
location preorder, 948, 957 location renaming, 987 location semantics, 956, 960, 973, 985, 986 location type, 1020 locations, 947, 949, 974, 1011, 1023 logical characterization, 977 loose location equivalence, 995 maximal distribution equivalence, 1000 Mazurkiewicz traces, 950 migrating agent, 1015 migration, 949, 1014, 1015, 1024 migration units, 1028 mixed-ordering equivalence, 955, 959 mobile agents, 1027 mobility, 949, 1013, 1036 modalities, 977 M M / ^ . V , 9 6 1 , 9 7 2 , 9 7 3 , 1005
name scoping, 1016 name-passing, 1014 names, 962, 1007 nets of automata, 966, 977, 1009, 1010, 1036 network, 1013 network awareness, 946 network transparency, 948, 1025 network-aware, 1035 NMS equivalence, 953, 955, 1005 Nomadic Pict, 949, 1031 NOMADIC PiCT, 1013
noninterleaving semantics, 946, 947 objective, 1015, 1029 objective migration, 1018, 1027 occurrence, 980 occurrence equivalence, 984 occurrence semantics, 985, 986 occurrence transition system, 980 operational semantics, 950 partial ordering semantics, 952, 955, 1001 partial orders, 950 partially ordered multiset, 951 past occurrences, 983 perfect firewall equation, 1027, 1031 permutation semantics, 952 permutation-equivalent, 951 Petri nets, 950 polyadic, 1007, 1017. 1028 pomset, 951 pomset bisimulation. 951, 1001 pomset semantics, 952 preorder, 991 prime event structures, 955, 1005
Process algebras with process algebras, 946 process migration, 1024, 1034 progressive bisimulation family, 968 progressive o-bisimulation family, 984 progressive pre-bisimulation family, 972 Protocol 960, 961, 972, 973, 976, 1005 proved transition systems, 959 proved transitions, 951, 968 proved trees, 959 proximity mobility, 1026 remote channels, 1020 remote procedure call, 1020, 1033 resource access control, 1019, 1028 resources, 947, 1019, 1028 right-consistent occurrence aliasing, 985 routing, 949, 1018, 1028 SEAL calculus, 949, 1013, 1028
security, 1028 sites, 948, 949, 958, 1014, 1031 "spatial" modalities, 1028 spatial transition system, 958, 971, 1000 spawn, 1030 SPAWN, 1018
spawning, 1012 spht bisimulation, 955 ST-bisimulation, 955, 1036 stable event structures, 955, 1005 static location equivalence, 966, 968 static location preorder, 972 static locations, 981, 984, 985 strong, 1015 strong location transition, 964 structured locations, 1019
localities
1045
structured transition systems, 959 subjective, 1015, 1024, 1026, 1032 sublocation, 957, 966 subwords, 957 synchronous TT-calculus, 1028 synchronous communication, 1015 testing, 1012, 1025 trace automata, 950, 954 transition systems with independence, 950 transparency, 1018 transparent, 1012, 1014 true-concurrency, 950 two atomic locations, 966 type systems, 1016, 1020 unique receiver, 1018 unique receiver property, 1013, 1021 units of communication, 946, 949, 1019, 1034 units of distribution, 949, 977, 1013, 1033 units of failure, 946, 949, 1013, 1034 units of migration, 946, 1024, 1026, 1034 units of mobility, 949 units of security, 946, 949, 1034 verification, 1035 visible actions, 962 weak, 1015, 1020 weak (dynamic) location transition system, 974 weak bisimulation, 971, 1010 weak bisimulation equivalence, 960 weak location transition system, 964 weak occurrence system, 983
This Page Intentionally Left Blank
CHAPTER 16
Action Refinement Roberto Gorrieri^ Arend Rensink^ Dipartimento di Scienze dell'Informazione, Vniversita di Bologna, Mura Anteo Zamboni 7, 1-40127 Bologna, Italy E-mail: gorrieri@ cs. unibo. it " Department of Computer Science, University of Twente, Postbusin, NL-7500 AE Enschede, The Netherlands E-mail: [email protected]
Contents 1. Introduction 1.1. What is action refinement about? 1.2. Refinement operator versus hierarchy of descriptions 1.3. Atomic versus non-atomic action refinement 1.4. Syntactic versus semantic action refinement 1.5. Interleaving versus true concurrency 1.6. Strict versus relaxed forms of refinement 1.7. Vertical implementation 1.8. Overview of the chapter 1.9. Whither action refinement? 2. Sequential systems 2.1. The sequential language 2.2. Operational semantics 2.3. Denotational semantics 2.4. Behavioural semantics and congruences 2.5. Application: A very simple database 3. Atomic refinement 3.1. Parallel composition and atomizer 3.2. Denotational semantics 3.3. Congruences and axiomatizations 3.4. Apphcation: Critical sections 4. Non-atomic refinement: An event-based model 4.1. Event annotations and operational semantics 4.2. Operational event-based semantics 4.3. Stable event structures 4.4. Denotational event-based semantics 4.5. Compatibility of the semantics HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
1047
1049 1049 1050 1051 1052 1053 1056 1057 1058 1059 1060 1060 1063 1064 1067 1069 1070 1071 1074 1075 1076 1077 1078 1080 1083 1085 1088
1048
R, Gorrieri, A. Rensink
4.6. Application: A simple data base 5. Non-atomic refinement: Other observational congruences 5.1. Pomsets 5.2. Causal links 5.3. Splitting actions 5.4. 5r-semantics 5.5. Application: A simple data base 5.6. 6t)-compIeteness 6. Semantic versus syntactic substitution 6.1. Finite sequential systems 6.2. Recursive sequential systems 6.3. Atomic refinement 6.4. Synchronization 6.5. Application: A simple data base 7. Dependency-based action refinement 7.1. Dependencies in linear time 7.2. Application: Critical sections 7.3. Dependencies in branching time 7.4. Application: A simple data base 7.5. The dual view: Localities 8. Vertical implementation 8.1. Refinement functions 8.2. Vertical delay bisimulation 8.3. Requirements for vertical implementation 8.4. Further developments 8.5. AppHcation: A simple data base Acknowledgements References Subject index
1089 1090 1091 1094 1095 1099 1105 1105 1106 1107 1110 1111 1112 1116 1117 1118 1121 1121 1126 1127 1128 1130 1131 1134 1138 1140 1141 1141 1147
Abstract In this chapter, we give a comprehensive overview of the research results in the field of action refinement during the past 12 years. The different approaches that have been followed are outlined in detail and contrasted to each other in a uniform framework. We use two running examples to discuss their effects, benefits and disadvantages. The chapter contains results only; appropriate references are given to the original papers containing the proofs.
Action refinement
1049
1. Introduction 1.1. What is action refinement about? A widely accepted approach to specify the behaviour of concurrent systems relies on state/transition abstract machines, such as labelled transition systems: an activity, supposed to be atomic at a certain abstraction level, can be represented by a transition, the label of which is the name of the activity itself. Once these atomic actions are defined, one technique to control the complexity of a concurrent system specification is by means of (horizontal) modularity: a complex system can be described as composed of smaller subsystems. Indeed, this is the main achievement of process algebras: the specification is given as a term whose subterms denotes subcomponents; the specification, as well as its analysis, can be done component-wise, focussing on few details at a time. However, from a software engineering viewpoint, the resulting theory may in many cases still be unsuitable, as the abstraction level is fixed once and for all by the given set of atomic actions. In the development of software components, it may be required to compare systems that belong to conceptually different abstraction levels (where the change of the level is usually accompanied by a change in the sets of actions they perform) in order to verify if they realize essentially the same functionality. Once the sets of actions at the different abstraction levels are defined, a technique (orthogonal to the previous one) for controlling the complexity of concurrent system specifications is by means of vertical modularity: a complex system can be first described succinctly as a simple, abstract specification and then refined stepwise to the actual, complex implementation; the specification, as well as the analysis on it, can be done level by level, focussing each time on the relevant details introduced by passing from the previous level to the current one. This well-known approach is sometimes referred to as hierarchical specification methodology. It has been successfully developed for sequential systems, yielding, for instance, a technique known as top-down systems design, where a high-level "instruction" is macro-expanded to a lower level "module" until the implementation level is reached (see, e.g., [141]). In the context of process algebra, this refinement strategy amounts to introducing a mechanism for transforming high-level primitives/actions into lower level processes (i.e., processes built with lower level actions). EXAMPLE 1.1. As a running (toy) example in this chapter, we consider a data base which can be queried using an operation qry and updated using an operation upd. Both are atomic, i.e., once invoked their effect is as if they finish immediately, and no concurrently invoked action can interfere with them. The latter operation is then transformed into a transaction consisting of two phases, req in which the update is requested and cnf in which it is confirmed. The question addressed in this chapter is what the behaviour of the data base on the resulting lower level of abstraction should be.
There are several ways to go about studying this issue, depending on some choices that can be taken. These are discussed in the following subsections.
1050
R. Gorrieri, A. Rensink
\J1. Refinement operator versus hierarchy of descriptions In traditional programming languages, there is an operator that supports a hierarchical specification methodology: the declaration (and call) of a procedure, given by (some syntactical variant of) " l e t a = u ±r\ t'\ This specifies that the abstract name a is declared to equal its body u in the scope t. So, whenever a is encountered during the execution of r, M is executed in its place. Similarly, one way to support vertical modularity in process algebra is by introducing an explicit operator, called action refinement and written t[a -^ M], which plays a role similar to that of procedure call: it is nothing but a declaration, introducing the name a for its body u in the scope t. The discussion about the possible meanings of the refinement operator is postponed to Sections 1.3 and 1.4; here we simply recall that the main problem faced by the advocates of this approach, the so-called congruence problem, is to find an observational equivalence which respects the refinement operator. A non-exhaustive Ust of papers following this approach in process algebra is [8,9,13,19, 31,37,38,48,50,69,89,110,121,126] and in semantic models [22,42,52,62,63,93,130-132]. Most of this chapter is devoted to a study of the operator for action refinement within process algebra. However, also another approach to support vertical modularity is discussed in this chapter: a hierarchy of descriptions, equipped with a suitable implementation relation establishing an ordering among them. Typically, a concurrent system, described at several levels of detail, can be seen as a collection of different albeit related systems. Each of these systems may be described in a particular (process algebraic) language. Therefore, in order to relate the various systems, it is necessary that we are able to correctly relate the different languages. The implementation of a language into another language may be often seen as the definition of the primitives of the former as derived operators of the latter. Of course, if we assume that all the systems are described in the same language (as we do in this chapter, as described in Section 1.7), the task is easier. Anyway, some work is needed: a suitable partition of the action set by abstraction levels, a refinement fiinction associating lower level processes to high level actions, and an implementation relation that states when a low level process implements a high level process, according to the refinement function. This "verticaF' implementation relation is not to be confused with existing "horizontal" implementation relations, such as trace or testing pre-orders, which rather reflect the idea that a given system implements another on the same abstraction level, by being closer to an actual implementation, for instance more deterministic. Although action refinement as an operator or through a hierarchy of descriptions are solutions to the same problem, a comparison is not easy. On the one hand, a single language with a mechanism for hierarchy among its operators is a quite appealing approach, as it permits to define the horizontal and the vertical modularities in a uniform way. Indeed, this is in the line of the development of sequential languages: the definition of control abstraction mechanisms, such as procedures and functions, or of data abstraction mechanisms, such as abstract data types, should be considered a standard way of "internalizing", in the usual horizontal modularity, concepts that are typical of the vertical one. On the other hand, this approach has also some disadvantages: no clear separation of the abstraction levels in the specification (free combination of horizontal and vertical operations) and no clear distinction of what actions are of what level (confusion may be risky, as we will discuss in Section 1.4 and, much more extensively, in Section 6). Another major difference between
Action
1051
refinement
the two approaches is the following. According to the former approach, given a specification S and a refinement function, there is only one possible implementation /; hence, there is no need to develop a notion of correctness of the implementation: the implementation / is what one obtains by applying the operator of refinement to S. On the contrary, the latter approach may admit several different implementations for a given specification, namely all those that are correct according to the vertical implementation relation. See Section 1.7 for a further discussion. For the time being, we concentrate on the interpretation of action refinement as an operator.
1.3. Atomic versus non-atomic action refinement The basic approaches to action refinement can be divided into two main groups. On the one hand, there is atomic refinement [ 13,19,48,72,75,97], where one takes the point of view that actions are atomic and their refinements should in some sense preserve this atomicity. On the other hand, there is a more liberal notion of refinement - called non-atomic - according to which atomicity is always relative to the current level of abstraction, and may in a sense be destroyed by refinement. To better explain this issue, let us consider one simple example: a \\\ b, representing the parallel composition of a and b, and the refinement oi a by a\\a2. Figure 1 shows the labelled transition systems for ^ ||| b and {a \\\ b)[a ^^ a\\ ai] when refinement is atomic and non-atomic, respectively. In this figure, black dots represent abstract observable states (i.e., states that are relevant for observation and where every atomic action is completed) and white dots denote concrete invisible states (i.e., states that represent intermediate execution steps at a lower level of abstraction and that cannot be seen by an external observer). It is easy to see the difference: if the refinement is atomic, there is no observable state in between the execution of ai and ai (all-or-nothing); moreover, action b cannot be executed in between their execution (non-interruptible). The atomic approach seems well-suited in some cases. For instance, when implementing one language into another one, one needs to implement the primitives of the former as compound programs of the latter. In this case, keeping atomicity in the implementation
(a III h)[a^ai\ 02] (atomic) i h/^\ai
(o ||| h)[a^ax] 02] (non-atomic h/
a^
/
Fig. 1. Atomic and non-atomic refinement of a ||| b.
\<2i
1052
R. Gorrieri, A. Rensink
may be a vital feature for correctness. One example of this is [77], where Milner's CCS is mapped to a finer grained calculus; each transition of CCS is implemented as a suitable transaction (sequence of transitions executed atomically) of the latter calculus. Another example supporting atomic refinement is when mutual exclusion on a shared resource is necessary to prevent faulty behaviour. For instance, when refining an abstract write operation ^ on a shared variable jc as a complex process u, we would like to allow further, possibly parallel, reading or writing operations on x only after the completion of w. Further arguments in favour of atomic refinement may be found in [19]. On the other hand, also the non atomic approach has its own adherents; see [9,31,50,63, 89,93,110,121,133]. Actually, this approach is on the whole more popular than the former. For instance, in the example of Figure 1, if Z? is an action completely independent of a it seems unreasonable to impose the restriction that b stays idle while executing the sequence a\a2. In our opinion, the choice between atomic and non-atomic refinement should be driven by the application at hand. 1.4. Syntactic versus semantic action refinement There are essentially two interpretations of action refinement, which we call syntactic and semantic. In the syntactic approach, the treatment of action refinement closely resembles the copy rule for procedure call (i.e., inlining the body for the calling action) in sequential programming. For instance, [110] exploits a static copy rule (syntactic replacement before execution); instead [8] follows the dynamic copy rule: as soon as a is to occur while executing t, the first action of u is performed reaching, say, a state u\ after which that occurrence of a in r is syntactically replaced by u'. In either case, the semantics of t[a -^ u] is, by definition, the semantics of the term t[u/a]. Among other things, this implies that the process algebra is to be equipped with an operation of sequential composition (rather than the more standard action prefix) as studied, for instance, in the context of ACP [11], since otherwise it would not be closed under the necessary syntactic substitution. In the semantic interpretation, a substitution operation is defined in the semantic domain used to interpret terms. Then the semantics of r[fl -> M] can be defined using this operator. For example, when using event structures as semantic domains, an event structure f = |M], representing the semantics of w, would be substituted for every (7-labelled event d in the event structure \t\. The refinement operation preserves the semantic embedding of events: e.g., if d is in conflict with an event e, then all the events of E will be in conflict with e, and similarly for the order relation. Investigations of such refinement operators can be found in, e.g., [ 17,31,32,41,42,50,93,60,63,64,68,121,131,133] over the semantic domains of Prime, Free, Flow and Stable Event Structures, Configuration Structures, Families of Posets, Synchronization Trees, Causal Trees, ST Trees and Petri Nets. The advocates of the semantic substitution approach (to which the authors of this chapter belong) claim that the starting point is introducing a notion of semantic refinement as pure substitution in a semantic model, which, usually, is not very difficult. In contrast, the hard part is finding the operational definition for the syntactic operator of refinement that correctly implements semantic substitution, i.e., a concurrent counterpart of the copy rule in the sequential case. These two approaches are inherently different; simple examples showing this are given in Section 6. Essentially, syntactically substituting u for a in t produces a confusion of
Action refinement
1053
the abstraction levels that is not possible with semantic substitution; such a confusion may originate new conmiunications between processes that were not possible at the higher level, and, conversely, may destroy at the lower level some communications established at the higher level. Conceptually, this is an undesirable situation which, in general, prevents the definition of an algebraic theory for action refinement. Technically, syntactic refinement corresponds to a homomorphism between algebras whose signature is given by the language (since such a homomorphism is essentially generated by a mapping from actions to subterms, which is required to distribute over all the operators); on the other hand, semantic refinement defines an operation on the semantic model which is compositional. As the two approaches do not coincide, we cannot expect to be able, in general, to define compositional homomorphisms. In Section 6, we compare the two approaches with the aim to identify under which restrictions they yield the same result. That is, we report about conditions under which the following diagram commutes: t\a-^xi\
- ^ ^ t{ula\ syntactic ret.
syntax
semantic ref.
(1)
V [f][a-»-[u]]
^ ^ I^{"/a}l
semantics
Not only does the result give a clearer understanding of the theory of action refinement, but also it is interesting for applications of action refinement to know when semantic refinement can be implemented by the conceptually simpler syntactic substitution. It should be mentioned that a dual approach to the one described above is followed in [94]: they take syntactic refinement as a starting point and adapt the language (using an operator for self-synchronization) so that semantic refinement coincides with it. Concerning atomic refinement, one can observe that this is naturally definable as a form of semantic refinement on trees labelled on sequences of actions, but can be also represented via syntactic substitution, provided that the process replacing the action is atomized (see Sections 3 and 6 for more details).
1.5. Interleaving versus true concurrency As mentioned above, when action refinement is an operator of the language, a natural key problem is that of finding a notion of equivalence that is a congruence for such operator. Formally, given a candidate equivalence notion 2::, we want to find the coarsest relation =, contained in 2:^, that is a congruence for all the operators of the language; to be precise: • whenever Ml = M2, then f[a -> wi] = r[a ^- wi]; • whenever t\ = t2, then t\ [a ^^ u] = tiia -^ u]. The first half of the congruence problem turns out to be easy: the main requirement is that one makes a clear distinction between deadlock (where a system can do nothing at all) and termination (where a system can do nothing except terminate, i.e., relinquish control); see also [61]. This distinction is easily made if one models termination as a special action (in this paper denoted / ) . The reason why a congruence has to make this distinction may be understood by considering an example. Let t =a\b,u\ =c - denoting the execution of c
1054
R. Gorrieri, A. Rensink
leading to successful termination - and U2 = c\^~ denoting the execution of c leading to deadlock. u\ and ui are equivalent when ignoring termination; however, t[a -^ u\] can perform b after c, while t[a-^ U2\ cannot. A solution to the second half of the congruence problem, on the other hand, may either be easy (in cases where one can stay within interleaving semantics) or rather difficult (in cases where one is forced to move to truly concurrent semantics), depending on the assumptions and the algebraic properties one wants to impose on the operator. • One can define semantic action refinement as an operator on transition systems (e.g., see Section 3 below) that is well-defined up to strong bisimilarity. (For the case where internal moves are abstracted, the situation is slightly less straightforward: the construction is not well-defined up to the standard (rooted) weak bisimilarity, instead one has to resort to (rooted) delay or branching bisimilarity. A detailed discussion can be found in Section 2.4 below.) At any rate, it should be clear that there is no intrinsic reason why an interleaving relation cannot be a congruence for action refinement. • However, the operator referred to above fails to satisfy a very intuitive and important property: namely, it does not distribute over parallel composition. If one wants this property to hold, the easiest way is to adopt atomic refinement instead, as argued in [48] (see above and Section 3); both strong and weak bisimilarity are congruences for this operator. The price is that one has either to distinguish concrete and abstract states or to use action sequences rather than single actions as transition labels. • Atomic refinement is not always appropriate. If one requires a non-atomic refinement operator that distributes over parallel composition, this can still be defined on standard transition systems, provided that refinement is disallowed for all actions that decide choices, as well as all actions that occur concurrently with themselves; see [38]. Once more, strong bisimilarity is a congruence for the resulting operator. As a consequence of the limitations on refinable actions, this operator no longer distributes over choice. We do not discuss this operator any further. • If one wants action refinement to distribute over parallel composition and to be nonatomic and to be applicable to all actions, irregardless of their position in a term, then it becomes necessary to use a model that is more expressive than standard transition systems. Among the earliest observations of this fact are [115,32]. Since it has received widespread attention in the literature, we will discuss this issue in more detail. Let us consider a ||| b and a;b-\- b;a, which are equivalent in interleaving semantics: the former represents the concurrent execution of the actions a and b, the latter their execution in either order. When refining aioa\;a2 (and distributing the refinement over parallel and sequential composition), the resulting processes become equivalent to, respectively, (a\; «2) IIIb and a\\a2\b -^ b; a\\a2\ these are no longer equivalent in interleaving semantics, as only the former can execute the sequence a\ba2' It follows that the required congruence = cannot equate a jjj b and a\b-\-b\a. A solution to this problem, which has received a large amount of attention in the literature on action refinement, is to move to so-called truly concurrent semantics, i.e., semantic models that contain more information about the concurrency of the system's activities than the standard interleaving semantics. For instance, event-based models (inspired by Winskel's event structures, see [139,140]) have been investigated for this purpose in [42, 50,63,64,121]. In Section 4 we present an example of an event-based truly concurrent (op-
Action refinement
1055
erational and denotational) semantics for a language with parallel composition, synchronization and refinement. Isomorphism of event-based models gives rise to a congruence; however, it has been argued that this relation is now too strong (rather than too weak as in the case of the interleaving relations), in that it makes more distinctions than strictly necessary. This can be repaired by interpreting the event-based model up to a weaker relation than isomorphism, such as for instance history-preserving bisimilarity (see [60,116,46]); or, alternatively, by considering less distinguishing models such as causal trees (see [39,42]). It turns out that the minimal amount of information one must add (giving rise to the coarsest congruences contained in existing interleaving relations) is to distinguish the (related) beginnings and endings of all actions. This is called the 5r-principle, after the name chosen by Van Glabbeek and Vaandrager in [65], where it appeared for the first time. In Section 5 we give an overview of truly concurrent observational criteria and the congruence properties to which they give rise; another, very systematic and detailed summary can be found in [64]. As pointed out by Meyer [105,106] and Vogler [134], the issue of finding congruences with respect to action refinement is also relevant to another, quite different area, namely that of completeness in the presence of process variables. This, too, is briefly discussed in Section 5. It should be noted that the issue of finding the fully abstract model for action refinement can also be avoided altogether, by interpreting terms as functions on denotations rather than basic denotations. Namely, assume Act is the set of actions, Lang the language under consideration and M^^^^ is the space of denotational models for the flat (i.e., refinement-free) language fragment Lang-^"\ with denotational constructions op for all operators op of Lang-^^'\ Based on these, one can define a new denotational model M = (Act -> M^^^) -^ M^^^\ i.e., objects of M Sive functions that yield a "flat" model when provided with an arbitrary mapping / : Act -^ M-^^'^ that "pre-evaluates" (in fact, refines) all action occurrences. Denotational constructions op on M are obtained by pointwise extension from M-^^^^: op{Mx,,.,^M,,)
=
Xf.op[M\{f)....M,Af))
for all M/ € A1 (/ = 1 , . . . , «), except if op is actually a constant action a (interpreted as a nullary operator), in which case
op = kf.f{a). M allows a straightforward definition of refinement, as an operator .[a ->_]: {M x M)
M, [a -^ M2\ = kfM^ {f±(a^
Miif)))
where f ±{ay-^ M) with M € M^^^^ denotes the function Act -^ M^^^^ mapping a to M and d\\b ^a to f(b). This immediately gives rise to a corresponding semantic function
l-l.Lang-^M. This approach is followed in [83]. An advantage is that, since M^''^ is itself not required to be compositional for refinement, it can still consist of basic interleaving models, such as
1056
R. Gorrieri, A. Rensink
labelled transition systems or (in [83]) traces. On the other hand, this interpretation of terms as functions is intensional: it does not give rise to a concrete representation of behaviour. This is in sharp contrast to the spirit of the rest of the paper. We will not attempt a further comparison. 1.6. Strict versus relaxed forms of refinement Non-atomic refinement is more flexible than atomic refinement, because it allows the concurrent execution of a process u refining an action a with the actions in t independent of a. For instance, in {a ||| b)[a ^^ a\\ ai^, b can be executed in between a\ and ai only if refinement is non-atomic (see Figure 1). Nonetheless, there are other desirable forms of flexibility that non-atomic refinement, as defined above, is unable to offer. For instance, consider t = (a; b)[a —> ^i; ^2] where actually only ai is a necessary precondition (i.e., a cause) for the occurrence of b. According to the definition of non-atomic refinement, t is equivalent to ^1; ^2; b, which fails to show that b may be executed independently of aj. Unfortunately, in the semantic domains usually considered, it happens that the causal context of actions is tightly preserved, hence enforcing causality in the refined system also when not strictly necessary. We could say that traditional refinement is too strict: it forces all abstract causalities to be inherited in the implementation. A possible solution, proposed by Janssen, Poel and Zwiers [91] and Wehrheim [136, 126] is to introduce a certain degree of relaxation of the causal ordering during refinement. Technically, this is achieved by means of a dependency relation over the universe of actions, combined with a weak form of sequential composition that may allow the execution of actions of the second component if they are independent of those occurring in the first component. In the example above, one may declare that only ^1 and b are dependent, hence ma\ ' ai'b (where • is weak sequential composition), b can be performed before ai. A possible relaxation of another kind concerns choice rather than sequential composition. Traditional action refinement requires that alternative actions, once refined, give rise to strictly alternative processes. A different view is taken in [51], where refinement is defined over event structures and the conflict relation is not respected tightly by refinement, e.g., conflicting events may be refined to processes that are not completely mutually exclusive. The intuitive motivation for this is that, in a competition, many actions are anyway performed by both processes before the decision of which will be served is taken. Yet another form of relaxation concerning choice requires that not all options specified by a refinement function must indeed be offered by the refined system. For instance, if we refine a to a'\ b ^ a'\ c, the abstract system a;d is implemented by the concrete system (a^; b H- a'; c); d. An interesting alternative is to take the decision about which option to implement during the refinement step, hence allowing a\b\d or a'; c;d as an implementation, or to turn the nondeterministic choice into a deterministic one, hence allowing a^; (b + c); d as an implementation. This kind of design step is in line with the sort of transformation allowed by standard implementation relations (such as trace or failure inclusion). We do not know of any paper dealing with such relaxed forms of action refinement (see [124] for a discussion on the problems raised by such an approach in presence of communication).
Action refinement
1057
1.7. Vertical implementation Another way to obtain a more relaxed notion of action refinement, already briefly mentioned in Section 1.2, is by abandoning the notion of an operator and regarding action refinement as an implementation relation instead. There is a long tradition in defining process refinement theories based on the idea that a process / is an implementation of another process 5 if / is more directly executable, in particular more deterministic according to the chosen semantics. Examples can be found in, for example, [27,43,108]; see also [12] for a collection of papers in this line. As these theories do not take changes in the level of abstraction on which S and / are described into account, we call such implementation relations horizontal. On the other hand, as also pointed above, almost no theory has been developed to compare systems that realize essentially the same functionality but belong to conceptually different abstraction levels. For this purpose, we have introduced the concept of vertical implementation. Some sensible criteria that any vertical implementation relation should satisfy are listed below: (1) It is parametric with respect to a refinement function r that maps abstract actions of the specification to concrete processes and thus fixes the implementation of the basic building blocks of the abstract system. (2) It is flexible enough (i) to offer several possible implementations for any given specification, and (ii) not to require that the ordering of abstract actions is tightly preserved at the level of their implementing processes, i.e., refinement need not to be strict (as discussed in Section 1.6, above). (3) It is a generalization of existing horizontal implementation relations; i.e., if the refinement function is the identity, then the vertical implementation should collapse to the horizontal implementation. So, the theory of horizontal and vertical implementations can be integrated uniformly. As we have seen in the previous sections, the classic work on action refinement in process algebra, where it is interpreted as a substitution-like operation on the syntactic or semantic domain, satisfies few of these requirements. In particular, the consequence of the classic approach is that there is only one possible implementation for a given specification; in other words, the action refinement function is used as a prescriptive tool to specify the only way abstract actions are to be implemented. However, there is no deep motivation for this functional point of view (only one implementation) in favour of a relational one (more than one implementation). For instance, when considering {a \\\b)[a -> a\\a2], there is no real reason for not accepting also a\\a2\b -\- b\a\\a2 as a possible, more sequential implementation; similarly, for {a\b-\~ b\ a)[a -^ a\\a2\ the more parallel implementation a\\a2\\\b could be admitted. The concept of action refinement through vertical implementation has a striking consequence. The congruence problem (discussed at length in Section 1.5 above) simply disappears: since a specification may admit non-equivalent implementations, a fortiori two equivalent specifications need not to have equivalent implementations. Hence, there is no longer a need to move to truly concurrent semantics. This has the advantage of allowing to reuse most existing techniques developed for interleaving semantics. In particular, it is a natural requirement that vertical implementation may collapse to some horizontal relation.
1058
R. Gorrieri, A. Rensink
by hiding all the actions that were refined, reminiscent of the interface refinement principle discussed in [26]. This makes it possible to mix vertical refinement with established methods for horizontal implementation. Some of the basic ideas behind this approach were proposed first (in a restrictive setting) in [72] and later (independently) in [118,119]. See Section 8, based on [123], for more details.
1.8. Overview of the chapter We can classify the choices we have made in the material of this chapter according to the discussion above. Operator versus hierarchy. In all the next sections, except the last one (Section 8), we consider some process algebra enriched with an operator for action refinement. Atomic versus non-atomic. In all the sections that deal with the operator of action refinement but one, we stick to non-atomic refinement. Atomic refinement is dealt with in Section 3, where we consider a process algebra with an operator for parallel composition but without communication, and also (briefly) in Section 7 in the context of action dependencies. Syntactic versus semantic. Throughout the chapter we use semantic refinement, as the operation of action refinement is always defined on a semantic domain (trees or event structures), with the exception of Section 6, where we report sufficient conditions to guarantee that the two approaches are the same. Interleaving versus true concurrency. We discuss the simplest cases (sequential systems in Section 2 and atomic refinement in Section 3) using interleaving semantics; then, when parallel composition comes into play and refinement is non-atomic, we move to truly concurrent semantics (Sections 4 and 5). Strict versus relaxed. All the sections on the operation deal with strict refinement, except Section 7, where we discuss other approaches using a dependency relation to ensure some form of relaxation of the causality relation. Vertical implementation is covered in Section 8. The chapter is organized as follows: Section 2 studies non-atomic refinement for the class of sequential systems. We introduce many concepts that will be used throughout the paper, such as well-formedness conditions on admissible terms, allowable refinements and some standard interleaving behavioural equivalences. Section 3 deals with a larger language with parallel composition (but without communication) under the assumption that refinement is atomic. The operational semantics is not standard, making use of concrete invisible states; the denotational semantics uses trees labelled on sequences. Section 4 deals with nonatomic refinement for a full-fledged process algebra. The denotational semantics is given in terms of stable event structures and the operational semantics is very concrete: process
Action refinement
1059
terms and transitions are tagged by event annotations. Then, observational semantics and congruence issues for the full language are discussed in Section 5. In Section 6 we present some conditions ensuring that syntactic and semantic action refinement coincide. Relaxed forms of refinement are recalled in Section 7, while Section 8 reports on the issue of vertical implementation relations. As much as possible, we have presented all the results of this chapter in a single format, by using a common underlying process algebraic language in which the different approaches have been formulated. Predictably, however, various theories come with their own specific concepts, operators and limitations, making a fully integrated presentation impossible. To enable the reader to find his way among the different language fragments and well-formedness conditions used in the various sections. Table 16 gives an overview. Note that in this chapter, we have limited ourselves to a process algebraic understanding of action refinement. Thus, we have not included a comparison with methods addressing the same concerns in other fields of theoretical computer science, such as logic-based, state-based or stream-based refinement; e.g., [10,28,29,54,96,98].
1.9. Whither action refinement? After enjoying a broad interest in the years 1989-1995 and thereabouts (as evidenced by the sheer number of papers quoted above, as well as the Ph.D. Theses [2,33,36,53,56,71, 90,92,118,128,137]), the subject of action refinement has left the central stage of research in process algebra. Yet we feel that the basic principle underlying action refinement, concerning changes in the level of abstraction and the grain of atomicity at which a system is described, is not less relevant now than it was a decade ago. Indeed, the same principle is very fundamental in, for instance, object-based systems, where the method interface of an object on the one hand and its implementation on the other are prime candidates for a description in terms of action refinement. If we analyze the kind of work that has received the most attention during the aforementioned period, it can be seen that the main issue that has been studied, almost to the exclusion of everything else, is the congruence question for the refinement operator. This has greatly enhanced the insight in the relative advantages of various truly concurrent semantics, some of which are now also being used in other contexts (e.g., ST-semantics for stochastic process algebras, see [23,25]); and similar for variations on weak (interleaving) bisimulation (see, for instance, [68]). Nevertheless, with the benefit of hindsight, the concentration on this one subject can also be seen to have had some disadvantages: on the one hand, the refinement operator itself has not found much practical use, whereas on the other, this singular focus has prevented the development of alternative approaches, such as the use of action refinement as a correctness criterion rather than an operator. This is what we are currently trying to remedy with the concept of vertical implementation. Having realized this change in perspective, it becomes clear that there is an enormous amount of work yet to be done. In particular, no attention at all has yet been paid to the extremely important question of how to integrate data refinement and action refinement. Similarly, the only aspect of atomicity addressed so far is the (non-)interference of atomic actions; at least as important is their all-or-nothing nature, in particular the possibility to
1060
R. Gorrieri, A. Rensink
abort an atomic action that (on a concrete level) has already started. Remarkably, in the context of process algebra the latter issue has not been addressed by any theory of action refinement we know. Furthermore, although we have begun to explore some of the possible variations on vertical bisimulation, similar studies should be initiated for vertical testing, since the lack of atomicity of test primitives is causing hitherto unexplored problems. Finally, the most challenging task is to apply the emerging theory to realistic applications, be it in the form of case studies of any size or by integrating it with the design phase of some software engineering lifecycle.
2. Sequential systems We start our technical presentation by addressing the simplest case: a process algebra without parallelism and communication. In this case, we can easily accommodate the new construct of action refinement within interleaving semantics.
2.1. The sequential language We assume the existence of a universe Act of visible actions, ranged over by <^, ^ , . . . , and an invisible action r ^ Act\ we write Actj = Act U {r}, ranged over by a. Furthermore, we assume a set Var of process variables, ranged over by .v, j , z. The language of sequential processes (or agents), denoted Lang'^^^ and ranged over by r, M, U, is the set of well-formed terms generated by the following grammar: T := 0 I 11 Of I V -h V I T; V I T/A I T[a - ^ V] I X I /XJC.V,
where a e Act, a e Actr, A c Act and x e Var are arbitrary. In this grammar, T is an arbitrary term whereas V stands for a so-called virgin operand, on which we impose the condition that it may not contain an auxiliary operator - where the constant 1 is the only auxiliary operator of Lang^^^. These matters are discussed below in more detail. We first go into the intuitive meaning of the operators, at the same time informally introducing the concepts of well-formedness and guardedness. • 0 is a deadlocked process that cannot proceed. • 1 is a terminated process, that is, a process that immediately terminates with a transition labelled / ^ Act^, expressed by 1 —> 0. 1 is an auxiliary operator, in the sense that we expect the "user" of the language to write down terms not containing 1. Rather, it will be needed to express the semantics of other operators (notably, sequential composition). The fact that an operator is auxiliary influences the well-formedness of terms; see below. • a can execute action a, and then terminates, i.e., o^ - ^ 1 ( —> 0). • t -\-u indicates a CCS-like choice between the behaviours described by the sub-terms / and u. The choice is decided by the first action that occurs from either sub-term, after which the other sub-term is discarded.
Action refinement
1061
We call the operands t and u virgin, because (due to the semantics of choice) it is clear that they are untouched, in the sense of not having participated in any transition - otherwise the choice would have been resolved. An important general well-formedness condition on terms is that virgin operands may not contain auxiliary operators. Specifically, in this case, we require that t and u contain no occurrence of 1. (The technical consequence of this condition is that neither operand can be terminated, and hence no /-transition can resolve a choice. This circumvents some intricate technical problems, for instance in the definition of a denotational event-based model; see, e.g., [118, Example 3.7]. A different solution with essentially the same consequence was chosen in [7,49], where a choice may terminate only if both operands can do so.) t; u is the sequential composition of t and M, i.e., t proceeds until it terminates properly, after which u takes over; if / does not terminate properly, u is not enabled. This semantics is in the line of ACP [11], and differs from the one in, e.g., [109], where u starts after t is deadlocked. We have chosen the former as it is the only one distinguishing correctly between deadlock and termination. Again, w is a virgin operand: once it participates in a transition, t is discarded from the term. The two main motivations for using sequential composition instead of CCS action prefixing are as follows. On the one hand, the operational (sometimes also the denotational) semantics for action refinement can be naturally defined only by means of a sequential composition operator, as we will see later on; on the other hand, syntactic substitution, which is the way action refinement is implemented in many papers, is naturally defined by means of such an operator. t/A behaves as r, except that the actions in A are hidden, i.e., turned into the internal action r that cannot be observed by any external observer. t[a —> M] is a process t where a is refined to u. The operand u is virgin. Since, by well-formedness, virgin operands may not contain auxiliary operators, it is certain that the refinement of an action is an agent that is not terminated; this prevents the so-called forgetful refinement (the implementation of an action by 1), which is not only technically difficult, as discussed, e.g., in [31,118], but also counter-intuitive. Apart from forbidding forgetful refinements, we are still rather generous in allowing some types of refining agents that are rather questionable, such as deadlocked or neverending ones. Intuitively, it seems natural to require that an action, which by itself cannot deadlock, is implemented by a process that cannot deadlock either, since otherwise refinement would introduce deadlocks. However, imposing such a semantic restriction is an unnecessary burden; on the one hand, there is no technical problem in managing deadlocked refining agents; on the other hand, it is not easy to characterize syntactically a large class of deadlock-free processes (while, semantically, the problem is even undecidable). Similar arguments hold for infinite refinement: intuitively, an action is certainly accomplished in a finite amount of time; therefore its refinement should eventually terminate, as required, e.g., in [48,90]. A typical term satisfying this requirement under a suitable fairness assumption is /xx.a; x + /?. Again, however, allowing arbitrary recursion in refining agents does not complicate matters, whereas restricting it to some special cases would.
1062
R. Gorrieri, A. Rensink Table 1 Free variables and syntactic substitution (where op is an arbitrary operator) t
fv{t) 1^/^/j f^^U)
t{ii/x} op{t\ [u/x],..., \ II
y
M
MJ-/1
fvitx) \ [y]
t,i{v/x])
if V = X
1 u • [ y otherwise ^JLZ.{t\ {z/y]{u/x])
where z^{x]yj
fv{t, u)
• X G Var is a process variable, presumably bound by some encompassing recursive operator (see next item), or to be replaced by substitution. The variables of t that are not bound are called/r^e: we write fv{t) for the free variables of a term t and fv{t, u) for fv{t) U fv(u). A term t is called closed if fvit) = 0. The free variables can be instantiated by substitution: t{u/x} denotes the substitution within the term t of every free occurrence of JC by the term u. The free variables and their instantiation are formally defined in Table 1. • /JLXJ with X € Var is a recursive term. It can be understood through its unfolding, t{fix.t/x}. The variable JC is considered to be bound in fix.t, meaning that it cannot be affected by substitution. Therefore, the identity of bound variables is considered irrelevant; in fact, we apply the standard technique of identifying all terms up to renaming of the bound variables, meaning that if y is a fresh variable not occurring free in r, then IJLXJ and fiy.t{y/x} are identified in all contexts. As a further well-formedness condition, we require that all recursion variables are guarded, in the sense defined below. In fjix.t, the recursion body t is considered to be a virgin operand, and hence by wellformedness may not contain the auxiliary operator 1. We will use Lang^^^-^^ to denote the recursion-free fragment of Lang^^^. Guardedness. The notion of guardedness is used to simplify the proof of correspondence of various kinds of operational and denotational semantics developed in this chapter for different fragments of Lang. As usual, the idea is that the semantic model of a recursive term corresponds to a fixpoint of the denotational function generated by its body, and this fixpoint is unique if the variable is guarded in the term; see for instance [108]. Therefore, if one defines the denotational semantics as the fixpoint, and on the other hand, proves that the operational semantics also gives rise to a fixpoint, then the two must coincide. 2.1. We first define what it means for a term to be a guard. • 1 and X are not guards; • 0, Of and r -h w are guards; • r[a -> M] is a guard if r is a guard; • For all other operators op, op{t\,..., r„) is a guard if one of the r/ is a guard. Next, we define what it means for a variable to be guarded in a term. • X is guarded in y (G Proc) if JC ^ y; • X is guarded in r; M if jc is guarded in t and either t is a guard or x is guarded in u\ • JC is guarded in /xy.r if either JC = y or JC is guarded in t\ • For all other operators op, x is guarded in op{t\,..., r„) if JC is guarded in all r,.
DEFINITION
Action refinement
1063
(Note that the last clause "for all operators op" includes the case where op is a constant, i.e., 0,1 or a.) A typical example of guarded recursion is /xjc.(l; a);x, and of non-guarded recursion, /XJC.JC \\\a. Well-formedness. To summarize the well-formedness conditions on Lang^^^^: • A virgin operand may contain no auxiliary operators. (The virgin operands are the ones denoted V in the grammar of Lang ^^^; the only auxiliary operator in Lang^^^^ is 1.) • Recursion is allowed on guarded variables only. 2.2. Operational semantics A labelled transition system (Its, for short) is a tuple {Lab, A^, - ^ ) , where Lab is a set of labels (ranged over by A), A^ a set of nodes (ranged over by n) and -> c A^ x Lab x A^ a (labelled) transition relation. {n,>^,n') e-^ is more often denoted n -^ n'. Sometimes we use transition systems with initial states, {Lab, N, ->, i), where L e N. Unless explicitly stated otherwise, Lab will equal Act^^ = Act^ U {/} in this chapter; we usually omit it. A^ will often correspond to the terms of a language - for instance, Lang'^^^. Furthermore, the transition systems we use in this chapter all satisfy the following special properties regarding /-labelled transitions: Termination is deterministic. If n —> n and n -^
n'\ then X = / and n" = n .
Termination is final. If n —> n\ then there is no A € Lab such that n'
-^.
Finally, some more terminology regarding transition systems: • n e N is called terminated if n —>; • n e N is called deadlocked if there is no A. G Lab such that n -^; • n e N is called potentially deadlocking if either n is deadlocked or there is a « —> n' with A ^ / such that n is potentially deadlocking. One of the main uses of Its's in this chapter is to provide operational semantics. The definition of the transition relation is according to Plotkin's SOS approach [114], meaning that it is the least relation generated by a set of axioms and rules concerning the transition predicate. For Lang^^^, the operational rules are given in Table 2. Most operational rules are standard; the only unusual ones are those for refinement. If the action to be refined is executed by r, then the first action of the refinement u is executed instead, followed by the whole residual u'\ only when u' is terminated, the computation will proceed with t' subject to the refinement. Note that, due to the well-formedness of terms (especially the condition that 1 does not occur in the operands of choice), termination is indeed deterministic and final. The essential consequence of guardedness can be expressed in terms of its operational semantics if we apply the operational rules also on open terms, as follows: 2.2. Assume x to be guarded in t. (1) t[ulx} - ^ t' if and only ift -^ t" for some t" with t' = t"[ulx). (2) /xjc.r - ^ t' if and only ift - ^ t" for some t" with t' = t"{fjLx.t/x}.
PROPOSITION
1064
R. Gorrieri, A. Rensink Table 2 Transition rules for Lang "'^/ t-^t'
u-
a
/ Of
I
1 X^A t\u-^t'\u
t'/A u - ^ u'
t[a
-^u]^^ u'\ {t'[a -^ w])
t -^
t'
X^ a
t{a -^ u] - ^ t'[a - > « ]
,
> U
t-^t'
aeA
t/A - U
t'/A
t[^lx.t/x] - ^ t' 0/
[IXA
1
> t'
2.3. Denotational semantics We now present a denotational semantics for Lang''^^^ using edge-labelled trees as a model. An edge-labelled tree T is an Its with initial state {N, ->,t), which is connected, acyclic, has no ^--predecessor for L and precisely one —^ -predecessor for all other nodes. The trees that are used to refine actions are always non-terminated. The class of all trees is denoted T. A tree can be easily obtained from an Its with initial state through the unfolding operation. The nodes of the unfolding correspond to paths through T, starting from the initial state and including all intermediate nodes and labels. Formally, given the Its T = (A^, ->, 0, its unfolding, UnfT is the tree (N\->\L), where: • N' = {n\Xin2X2 •. ^h-\nk e (NiMb)*N \ n\ =L, VI ^ / ^/:: «/ ^ ^ n / + i } . • -^^={{nn\,X,nn\kn\) \n\ -^ n\]. We are now ready to define the operations on trees. Deadlock. TL = {{0}, 0,0). Termination. T/ = ({1,0}, {(1, / , 0)}, 1). Single action. Ta = {{a, 1,0}, {(a, a, 1), (1, / , 0)}, a). Sequential composition. Tj; 7? = Unf{N, ->,i), where • N = NiU { ( n , n ' ) \ n - ^ u n e Ni}; n,a,n ) \n —>\ n -^ \^{{{n,n'),\An.n"))\n^^.n' • i = i\\ii\
-^2n"Y
-^^ 1, otherwise ( = (^1,0) (i.e., when T\ is isomorphic to 7 / ) .
Choice. If a ^ / for / = 1,2 and A^, n A^2 = 0, then Tj -F T2 = Vnf{N, •
N = N\
UA^2U{(M,O)};
-^,L),
where
1065
Action refinement •
^=
(M,^2).
Hiding. T/A = (A^, ^ \ 0 , where • ->^ = {(n, A, n')\n^
n\ A ^ A} U {(/?, r, n')\n-^
n\ a e A].
Refinement. If L2 - ^ 2 , then Tj [a -> T2] = L^«/(yV, ->, t), where
•
- > = { ( ( « l , « 2 ) , M , ( « j , « 2 ) ) 1^1 - ^ 1
^l''^2
^/?(/?,) '^/?(/;;) 'I' -^/?(//',) "2}
and R:N\ ^- T is defined as follows:
[7/
if n = L\,
R:n\ T2
ifn'-^n.
Some comments on the operations above are mandatory. In the operation of sequential composition, the second argument is '^reproduced" in as many copies as the number of the nodes that are terminated. The choice operation is nothing but a coalesced sum of trees. Note that these operations are both defined with the help of the unfold operation on trees; this simpHfies the presentation. The refinement operation is rather unusual, but it holds also when the two trees are infinite as well as when the second tree is potentially deadlocking. A function R is defined, associating to each node nofT\3. tree depending on the label k of its incoming transition (which is uniquely determined since T\ is a tree): R(n) equals Tx if X is anything but the action to be refined, 7? if A is the action to be refined, and 7 / if there is no incoming transition (n is the initial state). Then each edge n -^ 1 «' of 71 is replaced by the tree R{n'). EXAMPLE
2.3. Consider the following trees (where the node identities are made explicit):
71 = A^B^C D r2 = 5 ^ 6 - ^ 7
8^9
T/=:0-^l
7?, = 2 - ^ 3 - ^ 4
1066
R. Gorrieri, A. Rensink
Note that T\ is a model of a -\- b;a;0 and 7? is a model of Z? + c; d; 0. The refinement T\[a -^ T2] is then given by the tree
y
i56-^Cl
AO~^BS-^
B9
D3^
E6
X „ £8-^£9 The first thing to make sure of is that the above constructions indeed yield trees, satisfying all the conditions listed above. Since we have defined them through unfolding, for all the operators the proof is straightforward. PROPOSITION 2.4. Each of the operators above applied to trees, when defined, again yields a tree. In order to deal with recursion, we use an approximation ordering over the class T, which is essentially the one used in [138]. We assume that 7/ = (M, ->,, t/> for / = 1,2. T\\^T2 :<^=>Ni c Ar2,
^ 1 =->2 n(A^i x Z^Z? x A^i),
I\=L2
(where the symbol ":<=^" stands for "is defined to hold if and only if"). Then the following property states that this gives rise to an appropriate semantic domain, namely a (bottom-less) complete partial order, containing a least upper bound for all c-chains. The proof is omitted as it is a variation of the one in [138, Theorem 3.4]. PROPOSITION 2.5. (T, c ) is a complete partial order with minimal elements {{n}, 0, n) for all n and least upper bounds [J • 7/ = (|J • A^,, (Jy -^i,i) for all ^-directed sets {7/}/ C T (with ii = ifor all i).
The absence of a bottom element is not deleterious, since the minimal elements do just as well as the starting point of approximation; in particular, note that 71 is a minimal element of T. The next observation is that all the operations defined above are C-continuous functions on T. Indeed, as termination and deadlock are dealt with properly, also the operations of sequential composition (notably on its first argument) and refinement are continuous. Hence, recursion can be computed as the limit of the chain of its approximations. We define approximations of recursive terms, p.^x.t for all / G N, in the standard way (see [138]): li^x.t = 0, fi'^'x.t
=
t{fi'x.t/x].
The denotational tree semantics of Lang^^^' is then given in Table 3. In order to express in
Action refinement
1067
Table 3 Denotational tree semantics; op is the semantic counterpart of op
m=
TL
[11 = r^ lopit\,...,
r„)] = op{lt\j
ItnI)
{op any non-nullary operator)
what sense the operational and denotational semantics coincide, we first have to go into the issue of semantic relations among transition systems.
2.4. Behavioural semantics and congruences In an interleaving operational semantics such as the above, a widely accepted equivalence relation on processes is strong bisimilarity; see [108]. Here we recall its definition. 2.6. Let T be a transition system. • A bisimulation over T is a symmetric relation p ^ N x N such that for all nipni and n 1 —> n\, there exists ^2 such that «2 —^ n^i and n\ pn\; • Strong bisimilarity over T, denoted ~ , is the largest bisimulation over T. DEHNITION
Moreover, we can also compare states from different transition systems by taking the (disjoint) union of the transition systems and then applying the above definition. A standard proof (cf. [11,108]) shows that bisimulation is a congruence over Lang^^^'. Alternatively, one can use the "SOS format" theory (e.g., [18,44,81]; see [6] for an overview) for this purpose (the rules in Table 2 are in fact in the De Simone format of [44]). PROPOSITION
2.7. ^ is a congruence over Lang^^'^.
Since our operational rules are in the De Simone format, [4] guarantees there is a complete axiomatization for Lang'^^^-^", notably also for the operator of action refinement. It turns out that the set of axioms is nothing but the usual set for ACP (see [ 11 ]), together with some axioms stating that refinement distributes over the other operators (see Section 6). Furthermore, an inductive argument very similar to the one used to prove Proposition 2.7 establishes the compatibility of the operational and denotational semantics. PROPOSITION
2.8. t--{tlforall
t elMng seq
PROOF {Sketch). By induction on the structure of r. In fact, for those tree constructions that make use of the unfolding operator (choice, sequential composition and refinement) the induction step can already be proved on the transition system obtained before unfolding. Since (it is easily shown that) UnfT ^ T for every Its T, this suffices.
1068
R. Gorrieri, A. Rensink
As an example, we will sketch the case for refinement. Let 7/ = [r/J for / = 1, 2, and assume ti ^Ti. Now t\ [a -^ t2] is proved by the fact (of which we omit the proof) that the following relation is a bisimulation: P = {(t\[a-> t2], Ui.tT^))} U [(U2\ u\[a^
ti], («i, ^2)) | MI ^ «i, M2 ^ «2}.
For the case of recursion, the proof relies on well-formedness, in particular guardedness of recursion: using Proposition 2.2 and also Proposition 2.7, it can be proved that t{u/x} ~ u implies u^ fix.t for every guarded recursive term jix.t. Since by construction, \iJix.t\ is a fixpoint of the semantic function that maps all \u\ to |[r{M/jc}], we are done. D T-abstracting equivalences. The action r represents an internal activity that should be considered invisible to some extent. In the literature, the most widely adopted r-insensitive equivalence is (rooted) weak bisimilarity; see, e.g., [108]. To recall the definition, let r =
2.9. Let T be a labelled transition system. • A weak bisimulation over T is a symmetric relation p ^ N x N such that for all nxpni and n \ —> n\, one of the following holds: - X = T andn\pn2', - there exists /I2 such that ^22 ^ -^ =» A?'-, and n\ pn\. • A root of a binary relation p c. N x N issi relation /3 c p such that for all nxpni - if «1 —^ n\, then there exists n'^ such that n2 =^ —^ => ^7 and n\pn\\ - if M2 —^ «9, then there exists n\ such that n \ =^ —^ ^ n\ and n\ pn^. • W^t^A: bisimilarity over T, denoted ^w, is the largest weak bisimulation over T, and rooted weak bisimilarity, denoted :^w, is the largest root of ^ w
DEFINITION
Unfortunately, (weak and) rooted bisimilarity are not congruences for action refinement, as illustrated by the following example, originally due to [67] (subsumed by [68]), which essentially shows that the third r-law of [87] does not hold in presence of refinement. EXAMPLE 2.10. Consider r = a; (Z? -h r) and t' = a: (b -{- r) + a. It is not difficult to observe that t 2^w t' (in fact, this is an instance of the third r-law of [108]). Unfortunately, t[a -> a\\ a2] ^vj t'[a -> a\;a2] because t'[a -^ a\: a2] - ^ ^2; (1[<^ -^ ci\:a2]). hence reaching a state where b is no longer possible, while no bisimilar state can be reached from t[a -> a\;a2] with a transition labelled ^i. This example shows that c:^vv is not preserved by refinement, because the branching structure of processes is not preserved enough by rooted weak bisimilarity. For this reason. Van Glabbeek and Weijland proposed in [67] a finer equivalence, called branching bisimilarity, which is a congruence for action refinement. However, the natural question is to single out the coarsest congruence for action refinement inside (rooted) weak bisimilarity. The answer is not branching bisimilarity, but rather (rooted) delay bisimilarity, based on an equivalence in [107] and provided with this name in [68]. We recall the definitions and the precise results.
Action refinement
1069
2.11. Let T be a labelled transition system. • A delay [branching] bisimulation over T is a symmetric relation p Q N x N such that for all n\pn2 and n \ —> n'^, one of the following conditions holds: - A, = T andn'jp«2; - there exist /I2, ^2 ^^^^ ^^^^ "2 =^ n'^ -^ n'^ such that n\pn^ [and n\ pn'j]. • A delay [branching] root of a binary relation p
DEHNITION
• Z)^/ay [branching] bisimilarity over T, denoted ^d [^bl. is the largest delay [branching] bisimulation over T, and rooted delay [branching] bisimilarity, denoted ::^d [—b], is the largest delay [branching] root of ^d [^blPROPOSITION
2.12.
(1) ^i^d is the coarsest congruence over Lang'^^^ contained in —v^; (2) c:::b is ^ congruence over Lang^^^ contained in ~dThe proof of congruence of Clause (1) is originally due to [52], while the proof that it is the coarsest congruence is due to [34]. Walker in [135] proved that the specific axioms of delay bisimilarity are the first and the second r-laws of rooted weak bisimilarity. Finally, the proof of Clause 2 can be found in [41,68], whereas the transitivity of 2ib is separately addressed in [15].
2.5. Application: A very simple data base We now give a very simple example of the use of action refinement. In this and similar examples further on, for the sake of readability we use an alternative representation of recursion: instead of writing recursion operators within terms, we write process invocations, where the processes are defined elsewhere as part of the terms' global context. Thus, instead of px.t we may invoke a process X, provided X := t{X/x} is a process definition. See also Milner [108]. Moreover, every semantics we discuss in this chapter equates the terms 1; t and t for arbitrary terms t; for that reason, it is always safe to treat the two terms as equal, and in examples we will usually do so. Consider a distributed data base that can be queried and updated. We first deal with the case where the state of the data base is completely abstracted away from. The behaviour of the system is given by Data\, defined by Data\ := {qry + upd)\ Data\. The operational semantics of Data\ is depicted in Figure 2. Now suppose that updating is refined so that it consists of two separate stages, in which the update is requested and confirmed, respectively. In our setting, this can be expressed by refining action upd to req\ cnf.
1070
R. Gorrieri, A. Rensink
Data]
Data\ upd
qry
Data\ Qrvi
qry
Data J qry^
j-^q^ j
cnf
qry
qry2
Fig. 2. Specification and refinement of a data base with 1 state (above) and 2 states (below).
thus obtaining the process Data) := Data^^[upd -> req; cnf], also depicted in Figure 2. Note that in Data], the query operation cannot be performed in between the two stages of the update operation. If we make this slightly more realistic by taking into consideration that the state of the data base can take different values, say from 1 up to « (with initial state 1), we arrive at the following specification: Data""^ := State \, n
Statei := grji; Statei -h Y^ updi^; Statek
(for / = 1 , . . . , «).
k=\
Hence D^m^ specifies that after an update action, where a value is written, any number of consecutive queries can be performed, each of which reads the value just written. The behaviour of Data'^^ for « = 2 is again depicted in Figure 2. Refining the actions updj to reqi; cnf results in Data] := Data\[upd^ -^ req^; cnfWupdi -> reqj, cnf]. Like in the case of Data], between request and confirmation querying the data base is disabled. If it is desired that querying be enabled at that point (for instance because the confirmation action does not change the data base state, so it is safe to read it), this requires a more flexible notion of action refinement; see Sections 7 and 8.
3. Atomic refinement The basic idea underlying atomic action refinement is the following. An abstract specification describes a system in terms of executions of basic actions, that - by their nature - are intrinsically atomic; hence, when a specification is made more detailed via action
Action refinement
1071
refinement, the atomicity of an abstract action should be preserved by the concrete process implementing that abstract action. The atomic execution of a process means that it enjoys the following two properties: All-or-nothing: the concrete process is either executed completely, or not at all; this implies that the process is not observable during its execution, but only before and after. Non-interruptible: no other process can interrupt its execution; this implies that the atomic process is never interleaved with others. Observe that action refinement in Section 2 is not atomic: the problem described in Example 2.10 simply disappears if we assume that a\;a2is executed atomically, as the intermediate state where only a\ has been performed is not observable. (Hence, as we will see, rooted weak bisimilarity is a congruence for atomic refinement.) There are many real problems where the assumption of atomicity is vital, e.g., when mutual exclusion on a shared resource is necessary to prevent faulty behaviour. For more discussion see also Section 1.3. In order to understand atomic action refinement, it is useful to enhance the language with a mechanism for making the execution of processes atomic. For this purpose, we add an atomizer construct. The operational model has to be extended accordingly: it is necessary to divide the set of states into the abstract (or observable) ones, in which no atomic process is running, and the concrete (or unobservable) ones, which correspond to the intermediate states of some atomic process. With these extensions, we can easily accommodate atomic action refinement within interleaving semantics. Papers following this approach include [13,19,72,75,97]. Moreover, [48] takes an intermediate position where action refinement is non-interruptible but not all-or-nothing; that is, the concrete states are observable. Other papers dealing with some (weaker) form of atomicity in process algebra are [16,111]. In the above discussion, we have implicitly assumed that it is possible to put processes in parallel; otherwise, the notion of interruption would not be meaningful. To make the assumption valid, we enlarge the process algebra of the previous section with an operator for parallel composition; however, for the sake of simplicity, we ignore communication for now. The problems due to communication are treated extensively in Section 4, and are not essentially different for atomic and non-atomic refinement.
3.1. Parallel composition and atomizer The language we consider in this section, denoted Lang"^^^'", extends Lang^^^ of Section 2.1 with several new operators (underlined): T ::= 0 111 Of I V + V I T; V I T ||| T | (V) | *T 11/A \l[a^y]\x\
fix.y.
See also Table 16 for a complete overview of the different languages used in this chapter. The definitions of free variables and syntactic substitution (Table 1) and of guardedness (Definition 2.1) extend directly to the new operators. Their intuitive meaning and associated well-formedness conditions are as follows:
1072
/?. Gorrieri, A. Rensink
• r III w is the parallel composition of the behaviours described by t and w, where all the actions can be done by either sub-term in isolation (no communication), except for the termination action / on which t and u have to synchronize. We impose as a wellformedness condition that either t or u (or both) are abstract (where the notion of an abstract state is defined below). • {t) behaves like r, except that the intermediate states of the execution are not observable. In particular, if t has no path ending in a /-transition, (r) does not offer any observable behaviour. The operand of {t) is virgin, and hence may contain no auxiliary operator (either 1 or *). • *r is an auxiliary operator expressing the residual of some atomized process; its meaning differs from that of t only in that the former is considered to be a concrete term (unless it is terminated), while the latter is an abstract term (provided it contains no more occurrences of *). Being an auxiliary operator, due to well-formedness * may not occur in any virgin operand. The operational semantics for (r) can be given at two different description levels. For illustration, in Figure 3 we depict two alternative semantics for {a\\ ai) \\\b. One possible semantics describes the intermediate states of the execution; this requires to distinguish observable states and unobservable ones (depicted as white circles) in the labelled transition system, as only the former states should be considered when defining behavioural semantics. This line has been followed in, e.g., [75] and also in [76,72] where an axiomatization of the low level operator used for the atomizer (called strong prefixing) is given. The alternative semantics is more abstract, as the intermediate states are not described in the operational model, at the price of labelling transitions with action sequences. This line has been proposed in, e.g., [72]. Here we follow the former approach in the operational semantics (although the atomizer construct presented here is more general than in the papers cited above) and the second approach in the denotational semantics, where we use trees labelled on sequences. Abstract terms. In the well-formedness condition imposed above on parallel composition as well as in the operational rules for parallel composition introduced below, we use the concept of an abstract term. The set of abstract terms is defined inductively by the following rules:
b/\aia2
b/\a^ fli^
b.
a\a2 / /
Fig. 3. Two representations for (^i; ^2) III ^-
Action refinement
1073
• 0 , 1 , any variable x e Var and any action a e Act^ are abstract; • if r —>, then *r is abstract; • if r and u are abstract, then t -\-u,t\ w, t/A, t \\\ M, (r>, t[a -> u] and /x.v.r are abstract. All the terms in Lang"^^^"^ that are not abstract are called concrete. As we will see, if *r is abstract, which is the case if and only if t —>, then both *r and t are bisimilar to 1. It follows that the abstract states are roughly (namely, up to bisimilarity) given by the *-less fragment of Lang^'^^^"\ On the other hand, concrete states are terms with some nonterminated subterm in the scope of a *-operator. Well-formedness. To summarize the well-formedness conditions on Lang^'^^^"^: • No virgin operand (V in the grammar) contains an auxiliary operator (1 or *); • At least one of the operands of parallel composition must be abstract; • Recursion is allowed on guarded variables only. Operational semantics. The labelled transition system is {Lang^'^^*'", - ^ ) , where -^ is the transition relation defined by the rules in Table 4 (only the rules for the new operators and the two rules for refinement are reported). Let us comment on the rules. The rules for parallel composition give priority to the concrete component, if any: if only one of the two components is abstract, this has to remain idle. Observe that there is no way to reach a state where both components are concrete, starting from an initial abstract state (in fact, such a state would not be well-formed). Moreover, if both components are abstract, the rules allow both to proceed. The rule for the atomizer is simple: (t) does what t does, but the reached state is concrete (if not properly terminated). A concrete state *r does what t does; the only difference is that the reached state is still concrete (if not properly terminated). The rules for sequential composition are responsible for the * clean-up, when reaching an abstract state. The rule for refinement shows that the residual u' is not only to be non-interruptible (as in the corresponding rule of the previous section), but that the execution is to be all-ornothing (by making the intermediate states concrete). 3.1. Consider/ = (a);Z?andw = («; Z?). It is easy to see that r - ^ (*1);^—^ 1 where all the states are abstract, while u - % *(1; b) -^ *1, where the intermediate state
EXAMPLE
Table 4 Transition rules t - ^ t'
11 abstract
11
t\\\ii^t'\\\u
a
> 11 t abstract
t\\\ut ^ t '
(0 ^ t-^t' t[a -^ ii] -^
k t' [a -> u]
^rlll.'
t —y t
11 —> u
t\\\u-^t'\\\ii'
t-^t'
*r' t-^t' t\a-^ii]^^
a / u —> 11 (*//'): t'\a -^ u]
1074
R. GorrierU A. Rensink
*(1; b) is concrete. So, t \\\ c will allow the execution of c in between a and b, while u \ will forbid this behaviour. 3.2. Denotational semantics We present a denotational semantics for the *-less fragment of Lang^^^^'"\ using trees (see Section 2.3 for the precise definition of a tree) labelled on Acr^ U {/} as a model. We use w to range over Ac/^. The definitions for the basic operations are the same as in Section 2.3, except that sequential composition and choice have to be adapted to sequences. Here we report only the definitions for the two new operations (parallel composition and the atomizer) and for refinement. (Note that * is not modelled denotationally.) Parallel. If N\C\N2 = 0, then T\ \\\ T2 = Unf(N, ->, 0 where: • N = Ni X N2; • ^ = {((«i,«2), w;, (n\,n2)) \ n\ -^\
n\] U {{{n\,n2). w, (n\,n'^)) \ n2 - ^ 2
"2}' Atomizer. (T) = Unf{N, ->',() where: Action Refinement. If o -^2 • -> = {(n, w\ n')\n-^i
, then Ti [« -> T?] = Unf{N\, -^, M ) where: n, w' € R(w)} U {(«, / , n)\n^
n'}
in which Riw) is the set of expansions of w, defined as follows: R:e \-^ {s} aw h> {a}' R(w)
ifa^a
aw h^ [w' 112 -^^2 } • Riu)) and • is the concatenation operation on sets of strings. The operation of parallel composition is nothing but the unfolding of the Its obtained by making the (asynchronous) product of the two trees. The operation of atomising a tree yields a tree that is of depth two (counting / ) . This indeed ensures that the resulting behaviour is atomic, as it is performed in one single step (followed by / ) . Moreover, all the paths in T that do not reach a terminated node are simply omitted; if all paths are so, then (T) is isomorphic to 71 (the tree modelling the deadlock constant 0). Finally, the refinement operation is a sort of relabelling: an arc labelled w is replaced by possibly many arcs, connecting the same two end nodes, each one with a label obtained by macro-expansion of w where every occurrence ofainw is replaced by one of the possible terminated sequences of T (i.e., the steps of (T)); subsequently, the resulting transition system is unfolded. The denotational semantics for the *-less fragment of Lang^'^^'"^ is obtained as a direct extension of Table 3 to the new operators. An example is given in Figure 4.
Action
1075
refinement
adec, de
ed
aedc
d c
1/
/
1/
Fig. 4. Atomic trees denoting t = a: b'Ac-\-d\ 0), {t), t[b-^ d \\\e] and {t)[b-^ d \\\e].
3.3. Congruences and axiomatizations As done in the previous section, strong bisimulation equivalence is used to compare the two semantics. However, the operational semantics is quite different, as states may be also concrete. So, we first need to define which long steps are to be used in the definition of bisimulation for the operational semantics. To this aim, from the transition relation defined operationally over Lang^'^^^'" (Tables 2 and 4), we derive a "long step" transition relation over the abstract terms in Lang^'^^^'^, denoted -> as well but labelled by Act:^ U {/}. Long step transitions relate a pair of abstract states as follows: t —-> t' iff t - ^ t\ - ^ t2'-- - ^ t\ where all r, are concrete (/ = 1 , . . . , /c — 1) and w = a\-"ak. Bisimulation equivalence is thus defined by setting Lab = Act^ U {/} in Definition 2.6; it relates only those abstract states that are able to match their long steps. Under this interpretation, the following holds: PROPOSITION 3.2.
(1) t - {tlforall ^-less t e Lang"''"'^\ (2) ^ is a congruence over the ^-less fragment ofLang"^^^"\ In order to prove the first clause, for each long step of the operational semantics one finds a corresponding single step in the denotational semantics, and vice versa; the correspondence is set by an inductive argument on the term structure (taking into account the guardedness of recursive terms), much like for Proposition 2.8. As strong bisimilarity is a congruence, it is natural to look for axioms for the atomizer and refinement operators. Some typical axioms for the atomizer are reported in Table 5; the axiomatic treatment of refinement is deferred to Section 6. Another axiom system for a language with atomizer is presented in [97]; since the assumptions there are quite different, it is no surprise that also the axioms are quite different. Passing to r-insensitive equivalence, we need to abstract the observable behaviour of a one-step sequence w, by removing all the occurrences of r in it. Let W\T denote the resulting sequence; e.g., axb \x =ab\T = abr \T =ab and r r T \ r = e. Then we define the relation => as follows: u:
w'r
1076
R. Gorrieri, A. Rensink Table 5 Some typical axioms for (.), sound modulo ~ (above the line) and ~w (all) (r;0) (a) {{nyAti)} {t\\{t2+ti,))
= 0 = a = {t\\t2) = (ri;/2> + ( n ; 0 )
(r;r) = (r)
where u;, \ r = f for 1 ^ / ^ n. Rooted weak bisimilarity (see Definition 2.9), in our setting of transition labelled on sequences, is defined modulo the removal of is; that is, u has to simulate a transition t - ^ t^ in one of the following ways: • either w\r = s and (t\ u) is in the relation; • or M =^ - ^ ^ u' with w' \T = W\T and (r', u') is in the relation. We observe that 2::w is a congruence for atomic refinement. In fact, the counterexample reported in Example 2.10 simply disappears if refinement is atomic. 3.3. Consider again r =«;(/? + r) and r' = a\ (^-h r) -h« such that t ^i^w t'. According to the rules for atomic refinement and rooted weak bisimilarity, t[a -^ a\\ ai] —w EXAMPLE
{a\; ^2); {b + r) :^w {«i; «2>; (^ + r) -h {a\; ai) -w t'[a -^ a\\ 02]Summarizing, we have the following result: PROPOSITION
3.4. :^w is a congruence over the ^-less fragment of Lang''^''"'.
Table 5 contains a typical axiom for Lang^'^^"" up to 2:rw. 3.4. Application: Critical sections Consider two processes repeatedly entering a critical section. Abstractly, the activities in the critical section are modelled as a single action, csj for / = 1,2, and the system is specified by Sys^ = Proc\ \\\ Proci where the processes Proci are given by Proci \—csi\ Procj. Now suppose cs\ is refined into a\;b\ and cs2 into bi + ci; that is, the abstract system is refined into Sysj = Syss[cs\ -> a\:b\][cs2 ^ ^2 + Q ] . Due to the nature of atomic refinement, the refined critical sections do not overlap: in particular, ^2 and C2 cannot occur in between a\ and Z?i. The behaviour of the abstract and refined systems are given in Figure 5.
Action refinement
Sysg
1077
Sysj
Fig. 5. Critical sections and their refinement: Sysi = 5v55[c5| -> a\\b\ ][cs2 ^^ ^2 + Q I -
Unfortunately, the atomicity of the refinement can also affect actions for which it was not intended. This can be seen by considering extensions of the above processes that also have a non-critical section, ncsi: ProCf := ncsi; csj; Proci. If we refine the c^,-actions in Proc\ \\\ Proc'^ in the same way as above, then it turns out that not only the critical section (csj) but also the non-critical section {ncs2) of Proc2 ^^ P^^" vented from proceeding during the critical section of Proc\ (between a\ and b\). This may not be the intended behaviour. However, in order to avoid it, more information regarding the dependencies between actions is needed than the current framework provides: in particular, it must be made clear that, in contrast to cs\ and csi, ncs\ and cs2 are independent and may safely overlap. In Section 7.2 we show how one can use action dependencies to solve this type of problem.
4. Non-atomic refinement: An event-based model In this and the next section, we consider refinement in a fully general language, comparable with CCS, CSP or ACP. Compared to Section 3, we extend parallel composition with synchronization, resulting in terms f lU" where A c Act is the synchronization set; t \\\ u is a special case where A = 0. On the other hand, we drop the atomizer construct. The resulting language, Lang, is thus generated by the following grammar (where the new operator with respect to Lang"^^^^ of Section 2 is underlined): T ::= 0 111 a I V -f V I T; V I TjUJ 11/A \J[a ^y]\x
\ fix .V.
See also Table 16 for a complete overview of the different languages used in this chapter. As before, well-formedness implies that the auxiliary operator 1 does not occur in virgin operands (V in the grammar) and that recursion is guarded. A more extensive discussion of Lang follows below. In this section, we develop an event-based operational and denotational semantics for Lang; in the next section, we review the relevant congruence questions studied over the last decade. Note that, except for the refinement operator, Lang essentially corresponds to a fragment of ACP [11]; in particular, the parallel composition (which is based on TCSP, see [113]) has a standard operational semantics given in Table 6. It is clear from the discussion in the introduction that the standard Its semantics is not discriminating enough to provide a compositional model for non-atomic refinement in the
1078
/?. Gorrieri, A. Rensink Table 6 Transition rules for synchronization
t\\AU -^
a ^A
II - ^ u'
t'llAU
tUu -^
a ^A
t - ^ t'
tUu'
ii —^ u'
X e A^
t\\AU - ^ t'llAu'
general setting of Lang. To amend this, we add information in the form of events. Events serve to give a closer identification of which occurrence of an action is being executed; as a consequence, the same occurrence can be recognized among different transitions or different runs. For the purpose of formalization, we assume the existence of a global universe of events, Evt, with * ^ Evt (* being a special event used to model synchronization and refinement of event structures), which is closed under pairing, also with *; i.e., (Evr* x Evr*) \ (*, *) c Evt where Evt^ = Evt U {*}. The set of singular (i.e., non-paired) events is denoted Evt* = Evt \ (Evt^ X Evt^); this set is assumed to be countably infinite. Evt^ is ranged over by d,e; subsets of Evr* are denoted E, F,G. In the operational semantics, events are used to enrich the transition labels: these are now taken from Act^^ = (Evt x Actj) U {/} rather than just ActT;^; i.e., the non-termination transitions have associated event identities. This allows us to distinguish the independent execution of actions from their interleaving. Denotationally, we capture the behaviour of processes through event structures.
4.1. Event annotations and operational semantics An immediate technical question is how event identities are generated and kept distinct for different occurrences within a given model, given the fact that the terms of Lang do not contain any information to this purpose. There are several possible answers: • By interpreting models up to isomorphism, and implicitly or explicitly selecting isomorphic representatives to guarantee distinctness of events; see, e.g., Winskel [140]. • By generating event identities automatically from the term structure, as in [47,21]; see also [78,23] for an application of the same principle in a timed semantics for process algebras. • By adding information about event identities explicitly to the terms, through their annotation at "compile time", i.e., before evaluating them; see Langerak [100]. The first method is less suitable for operational semantics, since there not all event identities are known beforehand; hence we do not follow this approach. For event-based semantics, the third method is mathematically less sophisticated but gives rise to an (in our opinion) simpler presentation. For that reason, instead of studying Lang directly, we consider the annotated language Lang(Evt) generated by the following grammar (new or adapted operators are underlined): r::= 0 111 , a I V + V I T; V I T|UT 11/A I T[a ^ V,g-> f] | ,x | JT] | /xx.V
Action refinement
1079
where e e Evt*. As an additional well-formedness condition, we require that the event annotations are compatible. To make this precise, we introduce a set Ef c Evt* of events syntactically occurring within r, which is only defined if the annotations are compatible. • 0 and 1 are the deadlock, respectively termination constants as before. We define EQ — £i=0. • eOi denotes the action a e Actj annotated with the event e e Evt* used to model its occurrence. We define E^^a = {^}• t -\-u denotes choice; we require Et fl £",/ = 0 and define Et-^u = EfU E^. • t\u denotes sequential composition; we require Et Pi E^ = 0 and define Et:u = EfUEu. • t\\AU denotes the parallel composition of t and u with synchronization over A, meaning that actions in A (and also the termination action / ) may only be executed by t and u simultaneously, and all others independently by either operand. We use r ||| w = tW^u as a special case. As for the previous binary operators, we require Et Pi E„ = 0 and define Etw^u = Et D En. • t/A denotes hiding; we define Ef/A = Ef. • t[a -> u,e -^ v] denotes the refinement of the actions a occurring in r by u; the latter may not contain the termination constant 1. Moreover, e ^^ v denotes a vector of pending refinements e\ ^^ v\,.. ..e^ -^ u,, (with n = \e\ = \v\), where the ei identify distinct occurrences of a in r (i.e., e/ = ej implies / = 7 ) that are currently being executed, or actually refined; the u/ represent the corresponding non-terminated states reached during the execution of the refinement body u. We require Et 0 E^ =0 and Ei,. c Eu for all 1 ^ / ^ «, and define ^^^^.^^^^^^j = £/ U E^. In the sequel, we write {?} = {^1,..., e„} for the set of events in e. • eX denotes the process variable x G Var, annotated with an event e e Evt*. This annotation is used in order to prevent the re-occurrence of event identities in recursive unfoldings. We define E^^ = {e]. • e[t], with e e Evt*, models the unfolding of the process invocation eX within the body of a recursive definition fix.t; its effect is the "relocation" of the events in t to the fresh range {e} x Evt. We require t to be well-formed (in particular, Et should be defined) and define E^y] = {e}. The notion of syntactic substitution is adapted accordingly; see below. • /jix.t denotes the recursive binding of the (guarded) process variable x in r. We let E^x.t =
Ef.
The definition of the free variables and substitution is extended to Lang(Evt) (see Table 1); the only interesting new case is ^x, for which fv{ex) — [x] and ex[t/x] — e[t]. The latter preserves the event annotation of process variables, and shows the reason why we need terms of the form e[t] at all. For instance, the first three approximations of the annotated term fix.oa; \x (according to the definition in Section 3) are given by 0, 0^; 1 [0] andoa; i[o«; i[0]]. Well-formedness. To summarize the well-formedness conditions on Lang(Evt): • No virgin operand (V in the grammar) contains an occurrence of an auxiliary operator (1); • Recursion is allowed on guarded variables only; • The set Et of event annotations is defined.
1080
R. Gorrieri, A. Rensink
We then have the following property (which is straightforward to prove): PROPOSITION E>t[u/x] =
4.1. For all well-formed t,u e Lang(Evt), t{u/x} is well-formed and
Et.
Annotating and stripping. Annotated terms are no more than an auxiliary device to give an event-based semantics for Lang. To make the connection between Lang and Lang(Evt) more explicit, consider a partial function strip: Lang(Evt)Lang that is undefined on terms e[t] and on t[a -> u,e ^^ v] for nonempty e, and otherwise removes all event annotations. It should be clear that strip is surjective, meaning that there is an annotated term for any t e Lang; however, it is far from injective, since there are many ways to annotate t in a well-formed manner. For instance, one particularly simple method is to assume N c Evt* and consecutively number the subterms to be annotated, from left to right; e.g., (a; b\\ac; a)[a -^ jjix.d; x] is annotated according to this method as (o«; \b\\a2C\ 3«)[<^ -> ljLx.4d; 5jc]. When defining the semantics, we will make sure that the chosen annotation of a term makes no difference; that is, if strip{t) = strip(u) for t,u e Lang(Evt) then t and u will be equivalent.
4.2. Operational event-based semantics A major advantage of annotated terms is that their operational semantics is a straightforward extension of the standard operational semantics (given in Tables 2 and 4), except for the refinement operator, which now has to be treated in full generality. The presentation below is based on [121]. Event transition systems. As stated above, in order to model the behaviour of Lang(Evt) we take transition labels from Act^^J (= (Evt x Act^) U {/}) rather than Actj/. The idea is that the event identifier uniquely identifies the action occurrence; in other words, on the level of events the transition system is deterministic. Furthermore, if two events can be executed in either order (in a given state), we call them independent (in that state); the state reached is independent of the ordering, and moreover, any set of pairwise independent events will remain independent if one of them is executed. Formally: DEFINITION 4.2. An event transition system is an Acr^^'-labelled transition system such that for all n G A^ • If n ^'^S n\ and n ^^% ^2' ^hen ai = or? and n\ = «^. • e\ and e2 are called n-independentif n ^''^'> ^"'% n' and n ~' "> ^' '> n''\ife\ and e2 are n-independent, then n' = n". • If ^1,^2^^3 are pairwise n-independent and n ^''^'> n^ then e2 and ^3 are n'-independent.
It follows that if a set of events F is pairwise n-independent for some node n, then starting in n, the events in F can be executed in arbitrary order, and the state reached
Action refinement
1081
is independent of the order of execution. We use n —> to denote that F is pairwise nindependent. For instance, we will see that oa\\\b
>, signalling the independence
of a and b, butt = Qa; \b-^ 2^; 3« / > although t - ^ and t ^^^, since here the actions a and b are not independent. To compare the behaviour of event transition systems, we define an extension of strong bisimulation which allows events to be converted bijectively between the behaviours under comparison, in order to abstract away sufficiently from the precise occurrence identifiers. DEnNiTlON 4.3. Let (Act^'J, A^, ^ ) be an event transition system. • For any bijective (p: Evt -^ Evt, a 0-simulation is a relation p C N x N such that for all n{pn2: n
^'Ot
, ^L
(l){e).a
,
' y
I
I
- \\n\ —> n^ thenn2 —> «2 with A2,p«^. - if ni —> n\ then/i2 —> n^ withn^jpw^. • n 1 and n^ are called event bisimilar, denoted n \ ~ev ^?2. if there is a >-simulation p (for some 0) such that p~^ is a 0~' -simulation. Note that, in contrast to more sophisticated relations such as history-preserving bisimilarity (cf. [60]), in the above definition there is a single mapping 0 establishing a static, one-to-one relation between the events of the transition systems under comparison. This makes for a very discriminating equivalence: for instance, for event transition systems generated by stable event structures, event bisimilarity coincides with isomorphism of the event structures' configurations (see the discussion after Proposition 4.15). Indeed, we will have \a-\ria T^QV 3«, even though both \a -^ev 3« and The event-based operational semantics of Lang(Evt) is given in Table 7. For the fragment without refinement (the part of the table above the line), the semantics is unoriginal; see [99] for a very similar set of rules. Extended refinement functions. The definition of the operational semantics of refinement requires some care. During the execution of a refined action, the remainder of the refinement must be "stored" somewhere in the term. For that purpose, we have extended refinements from terms t[a -> u] to terms t[a -^ u,e\ ^ v\,.. .,ek-^ Vk] for arbitrary finite k\ for all 1 ^ / ^ A:, ei is an event of / under refinement, and u, is the current remainder. The events in {e} are called busy. The remainder is kept only as long as it is not terminated; furthermore, during the same period, the event ei is not actually executed, i.e., it is kept in the term t. The latter is necessary to make sure that events that causally follow ei are not executed prematurely, before the refinement of ei is terminated. Note that the ei may very well resolve choices within t. Since we do not let t execute the ei as long as the corresponding f, is not terminated, there is the danger that an event that actually conflicts with one of the busy events, say ei, is executed as well, despite the fact that the choice has actually been resolved in favour of ei. In order to prevent this from happening, only events of t that are independent of all the ei may occur.
1082
R. Gorrieri, A. Rensink
Table 7 Operational event-based semantics; X eAct^y
arbitrary
,1:^,' 1 ^ 0
eO^l
„1:^„'
t+u ^ r
t —> t a f A .. (eM.a ...
tl^t'
t+ u ^ u '
t\u—>t\u t —> t
u —> u 01 f A ., (*.e)M ., /
t/A-^t'/A
u —> u
t —> t —> t[a -^ u, e -^ v]
r1 / r /I e[t]^e[t']
t^t'
aeA
t/A - ^
fix J ^
t'/A t'
t'
t-^t'
a ^a > t [a -^ u, e ^^ v]
t[a -^ ii] —^ t'[a -^ u] ^ d.a t \e\
t[a -> u, e^- v\
> t[a -^ u, e -^ v, d ^^ u ] e' .a ,
t[a -^ u,e-^
v] -^—^
t[a -^ u, (e ^ v) ± (ej -^ v')]
ae A
>t WAU
t[ixx.t/x} -^ ^ ^ {e.d).a ^ ,^ e[t] >e[n
u-^u' t\u-^u'
t\\All A
t\\AU^t'\\Au'
t^t'
t[a
- , {d.e').a
ei.a ,
e'.a t
/
^,r
e'.a ,
-
-T
/
t[a --^ 11, e ^^^ v] —^—^ t'[a -^ 11, (e —^ v) \ e / ]
Some notation: for all \ ^i ^ k, (e ^^ v) ± (et -^ v') denotes the replacement of the residual et -^ vi by et -^ v\ and (e -> v)\ ei denotes the removal of the residual ei -^ Vj from the vector. The rules in Table 7 (below the line) can be understood as follows: • The first rule concerns the execution of a non-refined action; the premise t' —^ in this rule and others makes sure that the event d is not in conflict with any of events ei currently under refinement. The event identity is changed from d to (d,^), for uniformity with events that are properly refined. • The second rule concerns termination; note that there can be no remaining refinements. • The third and fourth rules concern the start of a new refinement instance; the latter deals with the case where the refinement immediately terminates again (i.e., it consisted of a single action only). • The last two rules deal with the continuation of a busy event, which either remains busy (if the remainder is still not terminated) or disappears from the scene (if the remainder is terminated). EXAMPLE
4d',5d].
4.4. Consider the derivable transitions of the term r = (o^; \ci\\ai2C-\-3^))l^ ->
1083
Action refinement
The parallel composition gives rise to
o^;i«IU(2c + 3^)^^^i;i«ll..(2c + 3 « ) ^ ^ ^ i | U l - ^ ^ 0 | L O (*,2),c
ob; \a\\al
(*.2)x
'—
^ 1; \a\\al
• Taking the refinement into account, we get , ((0,*),*),/?
(o^; \a\\a(2C + 3a))[a -^ ^d\ 5^]
^
{l\ \a\\a{2C-^
Ad\ 5d\
((1.3),4).J ^
((*.2).*),c-
((*.2),*),c
(0^; i«IUl)[a -> 4^; sd]
2>a))[a ^
'^^^—^
(1; i«IL/l)[^ -> 4^; 5^]
where the upper right hand transition leads to (1; \a\\a{2C + 3«))[« -> 4^; 5^] ^^^^^^^ (1; 1«IU(2C + 3a))[t7 -> 4t/; 5^, ( 1 , 3 ) ^ 1; 5^] ^^^'^^^^H (\\\al)[a ^ 4^; 5^] ^
(0||.0)[a - ^ 4^; 5^]. ((* 2) *) ('
In particular, note that (1; \a\\a{2C -\- T,a))[a -^ 4J; 5^, (1, 3) ^^ 1; 5^] —'^^^' ' > • The first property to be proved is that the operational semantics indeed gives rise to an event transition system as defined in Definition 4.2. Furthermore, it is important to show that the associated equivalence (in this case, event bisimilarity) is a congruence. The proof is a straightforward variation on the standard case (modified by the fact that event identities may be converted). PROPOSITION
4.5. '^ev is a congruence over Lang{Evt).
Moreover, it can be shown that all annotations of a given term in Lang are event bisimilar; i.e., the following holds (proved by induction on term structure): PROPOSITION
4.6. For all t,ue Lang(Evt), ifstrip(t) = stripiu) then t -^ev "•
4.3. Stable event structures The denotational semantics for Lang(Evt) we present here is based on the stable event structures of Winskel [140], extended with a termination predicate as in [64]. DEFINITION
4.7. A stable event structure is a tuple £: = (£,#,!-, Ter, £), where
1084
R. Gorrieri, A. Rensink
• EC. Evt^ is a set of events; • # c £ X £ is an irreflexive and symmetric conflict relation. The reflexive closure of # is denoted #^. The set of finite, consistent (i.e., conflict-free) subsets of E will be denoted Con = {F Cjin E\$d,eeF: d^e}. • h e Con X £• is an enabling relation, which satisfies Saturation: If F h ^ and F c G € Con, then G\-e\ Stability: If F h ^, G h ^ and F U G U {^} € Con, then
FnG\~e.
The set of initial events will be denoted /n/ = {^ G F | 0 h ^}. • Ter C Con is a termination predicate on sets of events, which satisfies Completeness: If F G Ter and F c G e Con, then
F^G.
• l\E ^f Actr is a labelling Junction. The class of stable event structures is denoted ES. In the sequel, we drop the qualifier "stable" and just talk about event structures. We sometimes write F^, #^ etc. for the components of an event structure £ and F,, #, etc. for the components of an event structure £{. As a further notational convention, we write e\,.. .,enh e for {e\, ...,en}}r e and h e for 0\- e. Two event structures £\, £2 are said to be isomorphic, denoted £\ =£2, if there is a bijection (p: E\ -> E2 (called an isomorphism) such that J#1 ^ iff 0(J) #2>(^), F hi e iff (l>{F)h2(l>(e),F eTeri iff 0(F) € r^r2 and €1 =^2 0 0. The intuition behind stable event structures is that an action a may occur if an event e e E with 1(e) = a is enabled, meaning that F h ^ for the set F of events that have occurred previously. If two events are enabled simultaneously, i.e., F h d and F h ^, then either d#e, meaning that after d or e has occurred, the other is ruled out; or d and e are independent. A more formal definition of the meaning is given through the configurations of an event structure; see further below. With respect to the standard definition in [140], the only modification is the extension with the termination predicate. For this, we have used a solution due to [64]: termination is modelled by a predicate on sets of events that may hold only for the complete consistent sets (i.e., those that are maximal with respect to C). Note that this completeness condition implies an analogy to the conditions for the enabling relation: Saturation: If F G Ter and F c G G Con, then G G Ter; Stability: If F, G G Ter and F U G G Con, then FDGe
Ter.
In fact, F G Ter can also be interpreted as F h ^ / for some special termination event e/ signalling termination - where, however, we do not really model e/ explicitly. As a consequence of the completeness of Ter, the following holds: LEMMA
4.8. If£
G
ES such that 0 G Ten then £ = (0, 0,0, {0}, 0>.
In order to deal with recursion, just as for the tree semantics in the previous sections we use an approximation ordering over the class of models, in this case ES. It is essentially
Action refinement
1085
the one used in [140]. ^1 ^£2 :<^=^ E\ C £ 2 , #1 = # 2 n ( £ ' i X £1), hi =1-2 n{Con\ X £"1), Ter\ = Teri H Con\,
Moreover, for an arbitrary set [Sj }/e/ c ES, the component-wise union of the £i is written LJ/€/ ^i' ^^ ^^^^ recall the following property (see [140, Theorem 4.4]): PROPOSITION 4.9. (ES, ^ ) is a complete partial order, with bottom element (0, 0, 0, 0, 0) «nJ /^a^r upper bounds [J- f/ = (U, £"/, U/ ^/' U, I"/' U/ ^^''" U/ ^/) /<^^ «^^ ^-directed sets{£i]i CES.
4.4. Denotational event-based semantics We now define a number of partial operations on ES, corresponding to the operators of Lang(Evt). By relying on the annotation of terms, we will make sure that the operations are only applied where they are defined. For arbitrary F c Evt^ x Evt^, we use the following notation: 7Ti(F) = {ei\(eue2)eF} Fid) = {e\(d,e)eF}.'
(/ = 1,2),
Thus 7Ti projects onto the iih component, and F(d) is a function-like use of F (albeit set-valued, since F is actually a relation). The definition of the constructions is inspired by [30,64,140], except for our treatment of termination. Note especially the construction for refinement, £[1Z]: this rehes on a function 1Z mapping all the events of £ (and not just the fl-labelled ones as in the operational semantics) to (non-terminated) event structures. DEHNITION
4.10. We use the following constructions on event structures:
Deadlock. £±_ = (0,0, 0,0,0). Termination. £^ = (0, 0, 0, {0}, 0>. Single action. £e,a = ({^}, 0, {(0, e), ({e}, e)}, {{e]}, [(e. a)}) for arbitrary e e Evt^. Sequential composition. If £i 0 £2 = 0, then f 1; ^2 = (£",#, H, T^r, €) such that • E = E\\JE2\ • # = #1 U # 2 ;
• | - = { ( F , ^ ) | F n £ i y-xe,Fr^E2eCon2)^[{F,e)\
•
Ter={F^E\FnE\eTer\,FnE2eTer2};
FHEi eTeri,
FnE2\-2e};
1086
R. Gorrieri, A. Rensink
Choice. If £1 n £2 = 0 and 0 i Ten U Terj. then ^ 1 + ^ 2 = (^, #, I", Ter, i) such that • E = E\UE2\ . # = #1 U # 2 U ( £ ' i X £2)U(£'2 X £1);
• l-=l-i U 1-2 U(Con\ X /n/2) U (Co«2 X /«M); • Ter = Ter\ U Ter2; Parallel composition. £\\\A£2
• E= • • • •
=
{E.'^.^.Ter^i)
such that
(\J^^^i-[\a)xi-^(a))U(e;HActr\A)xM)U(Mxl-UActr\A));
#= = {((Ji, J2), (^1, ^2)) € £ h = {(F, (^1,62)) eConxEl Ter={F e Con \Wie [1,2]: ^ = {((^1,^2),a) G E xActr
X £ I Ji #f ei 7^ * V J2#7 ^2 7^ *}; V/ e {1, 2}: e/ = * v 7r/(F) \ * h e/}; 7r,(F) \ * G T^r,}; \a=i\(e\) Va = £2(^2)}.
Hiding. £x/A = (£:i,#i, h i , T^n, €), where £(e) = r if ^ G i~^HA) and £(e) = £i(e) otherwise. Refinement. If 7^: £1 -> (ES \ 5 / ) , then £1 [7^] = (£,#, h, T^r, £) such that • • • •
# = {((Ji, ^2), (^1, ^2)) G £ X £ I ^1 # K , V (Ji = ^1 A J2#7^(^,) ^2)}; \-={(F,(e\,e2))eCon x E \ready(F)\-\ e\, Fie^h-ji^ei) ^2}'. Ter = {£ G C6>« | ready(F) G T^ri}; ^ = {((^i,^2),a)G£ xActr \a = l'jZ{eo(^2)}.
where for all F G Ct?n, ready(F) = {de7T\ (F) \ Fid) G Ter-jn^d)) is the set of events from £\ whose refinement has reached a terminated configuration. Relocation, e x £1 = {£, #, h, T^r, i) such that • £ = {^} X £1; • h={(Wx£,(^,J))|Fh,J}; • Ter={{e] x F\ F £Ter\}; • i=l\
0 712-
EXAMPLE 4.11. Consider again the term t = (ob; \a\\a iic + ?>a))[a -> 4^; 5^] of Example 4.4. • The subterm 0^; 1^ is modelled by the structure £\ = £o,h'-, £\M with E\ = {0, 1}, no conflicts, enablings hi 0 and 0 hi 1, termination predicate {{0, 1}} and labelling 0 -> b,l -^ a. Analogous for 4J; 5(i. • The subterm 2c + 3« is modelled by the structure £2 = £2x + ^3M with £2 = {2,3}, conflict 2#2 3, enablings h2 2 and h2 3, termination predicate {{2}, {3}} and labelling 2-> c, 3 -> fl.
Action refinement
1087
• The parallel composition yields £3 = E\ \a £1 with £3 = {(0, *), (*, 2), (1, 3)}, conflict (*, 2) #3 (1,3), enablings I-3 (0, *), (0, *) h3 (1, 3) and h3 (*, 2), termination predicate {{(0, *), (1,3)}} and labelling (0, *) -> b, (*, 2) -> c, («, 3) -^ a. • The refinement in t gives rise to 7^: £3 -> ES with 7^(0, *) = £^(0,*)./?, 7^(*, 2) = f(*.2),t and £^(1,3) = £4,d\ ^s.d-1 is then modelled by S — £^3[7^] with E = {e\, ei, ^3, ^4} where ^1 = ((0, *), *),
62 = ((*, 2), *),
^3 = ( d , 3), 4),
^4 = ((1,3), 5)
and with conflicts ^2 #^3 and ^2 #^4. enabhngs \- e\,e\ h ^3, ^3 h ^4 and h ^2, termination predicate [{e\, ^3, ^4}} and labeUing ^1 -> Z?, ^2 -^ c, e^ -> J, ^4 -> J. The first thing to make sure of is that the above constructions indeed yield event structures, and moreover, that an isomorphic argument gives rise to an isomorphic result. PROPOSITION 4.12. Each of the operators in Definition 4.10 maps into ES and is welldefined up to isomorphism.
For refinement, this was proved in [64]; for the other operators except sequential composition, see [30] (except for the termination predicate, whose construction, however, is very similar to that of enabling). For sequential composition, finally, the proof is straightforward. The denotational event structure semantics of Lang(Evt) is given in Table 8. It should be noted that the disjointness requirements in the denotational constructions for choice and sequential composition are guaranteed to be satisfied due to the well-formedness of annotated terms. The most interesting definition is that for refinement: in principle, the semantic refinement function maps the events of the term being refined to the event structures obtained as the denotational semantics of the syntactic refinement function; however, the events that are in conflict with some busy event of the refinement are mapped to the Table 8 Denotational event structure semantics; op is the semantic counterpart of op
m = ^± [11 = ^/ leaj = SeM ' ^*./7
if inj-nid) = b^a and $ei €{?}: ^#[[;]]^/,
lt[a-^u,e-^v]}
= [r][7^], where 7^(J) = •
le[t]j = lopUi ,...,tn)j
exit}
= op(lt\},...,ltnj)
["1
if Inf-nid) = a and
hi
if d = ei. otherwise
[^±
for all other operators op
1088
R. Gorrieri, A. Rensink
deadlocked structure instead, to model the fact that, even if such events have not yet been removed from t (as we have seen in Example 4.4, choices in t are not resolved syntactically until the refinement has terminated), they nevertheless play no further role in the overall behaviour. The following is the denotational counterpart to Proposition 4.6, namely that two annotations of the same basic term give rise to isomorphic event structures: PROPOSITION
4.13. For all t, u eLang(Evt), if strip(t) = stnp(u) then [rj = [wj.
4.5. Compatibility of the semantics In order to compare the event-based operational and denotational semantics, we must first decide on a relation up to which we wish them to be compatible. Isomorphism of the denotational semantics is certainly much stronger than (event) bisimilarity of the operational semantics; in fact, this was also already true for the sequential language in Section 2. We therefore choose event bisimilarity as the compatibility criterion. (Similar compatibility results of event-based operational and denotational semantics, albeit not including refinement, were given in [45,102]. This means that we have to generate event transition systems from event structures. The most natural way to do this is to regard the event structure's configurations as states and define transitions from each configuration to all its direct c-successors. Formally: DEHNITION 4.14.
Let £ e ES.
• An event trace of £* is a sequence e\ • ^„ G £* such that -"(^/ #^ Cj) for all 1 ^ / < j ^n (it is duplication- and conflict-free) and e i , . . . , ^, h ^/+i for all 1 ^ / < n (it is secured). • A configuration of £^ is a set F c £ such that F = {^i,..., e,,} for some event trace e\"-en. • An event transition between configurations, F - ^ G, holds iff e ^ F, G = F U {e} and a = i(e). Furthermore, there is a transition F —> • for each F e Ter, where • is a special state introduced only for this purpose. For arbitrary £, we denote T(£) = {C(£) U {•}, ^ , 0> (where C(£) is the set of configurations of £ and -> the transition relation defined above). Note that T(£) is indeed an event transition system in the sense of Definition 4.2. For instance, the event structure £ developed in Example 4.11 gives rise to the following transition system T(£): 0 62,C
{ei}
^ {^l}
^{^1,^3}
>- {^1,^3,^4}
^»
62
'' > [ex.ei]
It is easy to see that this is event bisimilar to the transition system generated by the operational semantics (Example 4.4). Since information is lost in the generation of configu-
Action refinement
1089
rations from event structures, one can expect event bisimilarity to be strictly weaker than event structure isomorphism. The following proposition states that it is indeed weaker. PROPOSITION
4.15. If£\ =£2 then T(£\)--ev^(£2)'
To see that the reverse implication does not hold, consider the event structure semantics of the terms \a; 2^; 3c and \a; (2b \\\ 3c)\\hx4b; 5c. In the first of these, the third, c-labelled event (with identity 3) is enabled by the Z^-labelled event 2 only; i.e., 2 h 3. In the second, on the other hand, the c-labelled event (here (3, 5)) is enabled by the combination of a- and ^-events; i.e., (1, *), (2,4) h (3, 5). (In fact, event bisimilarity of event structures coincides with isomorphism of the sets of configurations of those event structures.) We can now state the compatibility result of the event-based operational and denotational semantics of Lang. PROPOSITION 4.16. For any t e Lang(Evt), t --ev
T{lt\).
4.6. Application: A simple data base To show the potential of non-atomic refinement of synchronizing actions, we consider a variation on the data base example of Section 2.5. Namely, we assume that, in addition to updating and querying the data base, one may also make a backup copy of it. We abstract away from the state of the data base; extending it to the «-state version (see Section 2.5) makes no essential difference to the current example (except for making the transition system more complicated). The behaviour of the date base is specified by Datas, defined by Datas •= State WupdBackup, State := {qry-\-upd)\ State, Backup := {copy-\-upd)\ Backup. Now suppose that on a more concrete level, both the update and the copy operations are split into two phases: upd -> req\ cnf (as in Section 2.5) and copy -> back\ copy (where back is a request to make a backup copy and copy is re-used on the concrete level to stand for the actual operation of copying). Thus, the refined behaviour is specified by Data I := Datas[upd -^ req; cnf][copy -> back; copy]. The abstract and refined behaviour are shown in Figure 6. Note that qry and copy in Datas are independent (which is evident from the fact that these actions give rise to a diamond in the event transition system). As a consequence of this independence, in Datai qry may occur while the (refined) backup operation is in progress, i.e., between back and the concrete copy, whereas req is disabled at that time; on the other hand, qry is not enabled while the (refined) update operation is in progress, i.e., between req and cnf. In fact, Datai is
1090
R, Gorrieri, A. Rensink
Datas I qry/ upd upd / qry/Xcopy qry/cbpy
upd \copy qry / \ upd upd / orycbpy qry/\copy
upd \copy
qry.
Fig. 6. An initial fragment of the event-based operational semantics of Datas ^ d Datai (event identities omitted).
(both interleaving and event) bisimilar to the process where the refinements are interpreted syntactically, given by Statefi''^\\req,cnf Backup^'" where State^''^ := (qry + req\ cnf)\ Stated''', Backup^''^ := (back; copy + req\ cnf); Backup^''\ The relation between semantic and syntactic refinement is discussed extensively in Section 6. A final observation is that Datas is interleaving bisimilar (but not event bisimilar) to a process where all actions are specified sequentially, given by Data^^^ with the following definition: Data^P := {qry -f- copy H- upd)\ Data^^. If we refine Data^^^ in the same way as Datas, the resulting behaviour is not interleaving bisimilar to Datai: in the refinement of Data^^^^, qry cannot occur between back and copy. Once again, this is evidence of the fact that interleaving bisimilarity is not a congruence for the refinement operator.
5. Non-atomic refinement: Other observational congruences In the previous section, we have chosen a particular modelling principle (namely, action occurrences are events) and shown that this can be used to give semantics to a process algebra with action refinement; moreover, the corresponding notion of (event) bisimulation is a congruence. However, one may wonder if this congruence is the most suitable one. For
Action refinement
1091
instance, event bisimilarity distinguishes between the terms '"{a + b); c" and "a; c 4- b; c"; for most purposes this distinction is not relevant. A large part of the literature on action refinement is devoted to the quest for alternative congruences, in particular ones that are weaker (less distinguishing) than event bisimilarity. As a special instance, one can search for the coarsest congruence for action refinement contained within a given interleaving relation. There are two ways to go about this quest: to define equivalences over event structures that are weaker than isomorphism and investigate the induced relation on terms, or to develop alternative models altogether. An impressive overview based on the first of these methods has been drawn up by Van Glabbeek and Goltzin[64]. In this section, we review three possible bases for alternative models: pomsets (Section 5.1), causal links (Section 5.2) and splitting (Section 5.3). Pomsets give rise to a congruence on the level of traces but not when combined with bisimilarity. In contrast, causal links can be combined with bisimilarity into a congruence. Finally, with some care, splitting can be used to obtain coarsest congruences. In fact, in Section 5.4 we present an operational semantics directly based on the idea of splitting. The material in this section is based on the language Lang introduced in Section 4; the semantics in Section 5.4 uses an extension of it, denoted Lang^^.
5.1. Pomsets The use of pomsets for the modelling of distributed system behaviour has been proposed first by Grabowski [79] (who, among other things, introduces the special class of so-called N-free or series-parallel pomsets, also investigated by Aceto in [I], as an auxiliary device to study Petri nets) and strongly advocated by Pratt [115] (who introduced the term "pomset"); other references are Jonsson [95] (who investigates pomsets from a more mathematical perspective), Gischer [55] (who works out Pratt's framework in more detail) and Rensink [122]. Furthermore, also Mazurkiewicz traces (see [103,104]) are tightly connected to a certain class of pomsets. Mathematically, a pomset is an isomorphism class of labelled partial orders. For the current purpose, the elements of the partial orders are events and their labels are action names. The basic definitions are listed below. • A labelled partial order (Ipo) is a tuple /? = ( £ , < , ^), where E c Evt is a set of events causally ordered by the irreflexive and transitive relation < c. E x E, and t:E ^^ ^ct^/ is a labelling function. • If Pi = {Ei, , li) is an Ipo for / = 1, 2, then p\ and pi are called isomorphic if there is a bijection f \E\ -^ Ej such that d <\ e iff f(d) <2 f(e) for all d,e e E\ and • The isomorphism class of a poset (£",<, ^) is called a pomset. The class of all pomsets is denoted Pom. By taking isomorphism classes of posets, the precise identities of events are abstracted away from before they can be used to pinpoint the exact moment at which choices are resolved. Consequently, a pomset-based model is more abstract than an event-based model and thus induces a weaker equivalence over Lang.
1092
R. Gorrieri, A. Rensink
Pomset transitions from event transitions. In fact, from the event transition systems used for the operational semantics in the previous section (Definition 4.2), one can generate pomset-labelled transition systems, in the following fashion: • Each sequence of event-action-pairs, say {e\, oi\) fe, ^2) • • • (en. an) e (Evt x Actr)*, can be regarded as an Ipo that happens to be totally ordered: namely p = {E, <,i) where E = {e\, ...,en}, ei < ej iff / < j and t{ei) = of, for all 1 < /, y ^ «. • For each pair of states s, s' between which there is a path not containing a /-labelled transition, one can generate an Ipo by considering all paths from s to s' and intersecting their ordering. That is, let p i , . . . , /?„ with pi = (£",, , €/) be the set of totally ordered Ipo's generated from transition paths between s and s' in the fashion described above; then Ei — Ej and £/ = ij for all 1 ^ /, 7 ^ « due to the properties of the transition system. This gives rise to another Ipo q — (£", <, t) with E — E\,< — fli^/^/i ^^^ €= ^i;welet5-^5'. • /-labelled transitions are left unchanged. • Each Ipo thus obtained can be turned into a pomset by taking its isomorphism class. The idea is that in the event-based view, each sequence of transitions corresponds to the execution of a causally ordered set of labelled events; hence an Ipo. Due to the construction of the transition system, there is an exact correspondence between the paths between the states and the linearizations of this Ipo. The original Ipo can therefore be reconstructed through the intersection of all these linearizations. Pomset-labelled transition systems can be compared in a number of ways; for instance, one may look only at the pomset traces, or one may apply the natural notion of bisimilarity. Pomset traces. The pomset traces of a term of Lang are given by the outgoing pomset transitions of the initial state. There is a distinguished class of terminated pomset traces, which are the ones leading to a state with an outgoing /-transition. We call two terms pomset trace equivalent if they give rise to equal sets of terminated and non-terminated pomsets. As an alternative to this roundabout construction, one can directly define an algebra of (sets of) pomsets; in fact, this is the subject of most of the pomset papers cited above. For the synchronization-free fragment of Lang^" (i.e., containing - |U- only for A = 0, but including refinement), such an algebra is for instance defined in [110]. The extension to recursion is straightforward; the extension to synchronization, although technically awkward, is also unproblematic - see for instance [116]. (The awkwardness is due to that fact that the synchronization of two pomsets is in general not a single-valued operation: for instance, the synchronization of
,
a ^^ b \
and Va''—
Action refinement
1093
on a yields
and
as two possible outcomes.) We do not go into detail here concerning the definition of the operators, except to remark that the refinement operator on sets of pomsets crucially depends on the ability to distinguish the terminated pomsets from the non-terminated ones (see also Section 1.5). For instance, if one ignores this distinction then a; 0 and a give rise to the same sets of pomsets, and yet {b\ c)[b -^ a; 0] and (b; c)[b -^ a] should not be pomset trace equivalent. Since in the restricted setting of [110], the terminated pomsets coincide with the maximal ones, the distinction is easy there. It follows from the existence of an algebraic operator on the semantic model that pomset trace equivalence is a congruence for refinement. This fact was first stated in [32]. As a consequence of the construction of pomsets from event transition systems and the existence of a full Lang-algebra, over sets of pomsets, this can be extended to the following result. THEOREM
5.1. Pomset trace equivalence is a congruence over Lang that is coarser
than ^evPomset bisimilarity. The above construction of pomsets from event transition systems actually gives rise to a much richer model than just pomset traces: namely, a transition system labelled on Pom U {/}. Having a transition system, we can once more apply the principles of bisimulation. We call two terms pomset bisimilar if their associated pomset-labelled transition systems are strongly bisimilar (see also Boudol and Castellani [20]). Surprisingly (as first observed by Van Glabbeek and Goltz in [60]), pomset bisimilarity is not a congruence for refinement. A simple counter-example is given by the pomset bisimilar terms t z=za\(b + c)-\-aWb
and
u = t-\-a\b,
whose refinements t[a -> a\\a2\ and u[a -^ a\\ ai] are not pomset bisimilar: after the execution of a\ there is a behaviour that only u[a ^f- a\\a2\ may show, namely a state where ai and b are executable only sequentially and c is not executable at all. For more details see [64]; an extensive discussion can also be found in [133]. As an alternative to the indirect construction of pomset transition systems from event transition systems, [20] presents an operational semantics directly on pomset transition systems, albeit only for the synchronization- and refinement-free fragment of Lang^". The extension to synchronization and recursion is once more straightforward; however, from the fact that pomset bisimilarity is not a congruence for refinement, it follows that an operational semantics for refinement will be difficult to find.
1094
R. Gorrieri, A. Rensink
5.2. Causal links A different modelling principle is obtained if one takes not the events themselves but the causality between them as the essential notion. Operationally, this can be done by adding a set of causal links to each transition that point back to those previous transitions on which the current one depends. This idea was first worked out in the causal trees of Darondeau and Degano [39]. They use a particular simple way to implement the causal links: namely, the links are given as positive natural numbers corresponding to the number of transitions one must count back from the current one. Note that for this to work, it is essential that each state have a unique predecessor, i.e., that the model be a tree. In our setting, there is an additional class of /-labelled transitions. Thus, a causal tree is a tree-shaped transition system labelled on (2^^ x Actj) U {/} (where N^^ denotes the set of positive natural numbers). Causal transitions from event transitions. The event transition systems of the previous section (Definition 4.2) give rise to causal trees in the following way. Let T be an arbitrary event transition system. • The states of the causal tree derived from T are vectors of events e = ex-'-Ck (with Ci € Evt for 1 ^ / < A: and Ck € Evt U {/}) corresponding to traces of r. To be precise, e is a state iff i - ^ ^ ^ '^"''''''"'> n' for some n' and either n' -^^^^ n" (if ek e Evt) or n^ —> n" iiiek = / ) for some n". Note that iin'' exists, then it is uniquely determined by ?; we denote n" — i^. • The outgoing non-termination transitions of e are defined by induction on |?|. Each event transition i^ -^-^ n' gives rise to a causal transition e — ^ ee\ where the set K of causal links is determined in one of the following two ways. - If ie]-ek-\ " ^ ^ (i-^' ^' w^s already enabled in the direct ^^j;-predecessor of le) then (due to the inductive definition) we already had derived the causal transition K'.a
e\ -'-ek-x
r
> ex "-ek-xe
for some set K' c N^^. We \tiK = K' ^-\ (= {/ + 1 | / e AT'}). - If ie\--ek-\ —^^» then we had already derived the causal transition K'.a
ex '--ek-x
-
>e
for some K' c W^. We let K = {K' ^-\) VJ {\}. - Termination transitions are given by e —> e/ whenever Le —> • Having obtained causal trees from terms of Lang, one can again study induced relations over Lang, generated by different interpretations of causal trees. For instance, we call two terms causally bisimilar if their respective causal trees are bisimilar. It was first observed in [42] that causal bisimilarity is a congruence for action refinement. This can again be generalized to the following result:
Action refinement PROPOSITION
1095
5.2. Causal bisimilarity is a congruence over Lang, which is weaker
than ^evA similar property holds for causal traces (the linear-time counterpart of causal trees), which in fact constitute an alternative representation for pomset traces, studied in [120]. Instead of recovering the causal links from a more concrete semantic model, as we have done here, it is possible to define a L^n^-algebra of causal trees (see [40,42]) or to use causal trees as an operational model. With respect to the latter, see [50] for a structural operational semantics for (essentially) Langfi'\ which can easily be extended to deal with recursion. Since the semantics is given in SOS style, that paper also reports a set of axioms for the calculus. As a final remark, we recall that there are several alternative (indeed historically preceding) characterizations of causal bisimilarity. Rabinovich and Trakhtenbrot first introduced the relation in [116] as behaviour structure bisimilarity. In [60], the same relation is characterized as history preserving bisimilarity over event structures. Finally, the mixed ordering bisimilarity of [46] also gives rise to the same equivalence. See [3,64] for further details concerning these correspondences.
5.3, Splitting actions Having found (in causal bisimilarity) a bisimulation-based equivalence that is a congruence with respect to action refinement, a natural question is if this is the coarsest of its kind, i.e., the coarsest congruence for action refinement contained in (standard) interleaving bisimilarity. An analogous question can be posed for pomset trace or causal trace equivalence. It turns out that the answer to either question is "no": in order to obtain coarsest congruences, one needs to add information to the interleaving model in a way that is different from either pomsets or causal links. 5.3. There exist processes with distinct causal structures that yet cannot be distinguished up to bisimilarity by any refinement context. For instance, consider the bisimilar (but not causally bisimilar) terms a \\\ b; 0 (where a and b are causally independent) and (a; b \\\ b)\\bb (where there is alternative way to perform b, causally following a). It is not difficult to convince oneself that there is no way to make them non-bisimilar (in the interleaving sense) by refining their actions. EXAMPLE
So, what is the coarsest congruence within strong bisimilarity? Intuitively, by refining an action we are impHcitly assuming that such an action is no longer non-interruptible, as the execution of its refinement can be interleaved with the execution of other concurrent processes. In the example above, after refining a into ^i; (^2. the existence of the sequence a\ba2 shows the interruptability of the refined a. Hence, a natural question is whether the actions could not a priori be described as split into phases: for instance, a'^ for the beginning and a~ for the ending of an arbitrary action a. If one interprets the resulting transition systems up to strong bisimilarity, a \\\ b; 0 and a;b;0-^b;a;0 (for example) are distinguished whereas a \\\ b; 0 and (a; b \\\ b)\\h b are not (see Figure 7).
1096
R. Gorrieri, A. Rensink
a III 6; 0
a;6;0 + 6;a;0
{a:h\\\h)lb
Fig. 7. Three spUt2 transition systems.
This is the basic idea behind the so-called split semantics, probably introduced for the first time in [84] (although the principle is already mentioned by Hoare in [88]). Actions can be split in any number of phases, say n, giving rise to a family of 5/?//r„-equivalences for every interleaving equivalence. In fact, splitting into n phases can be seen as a restricted form of action refinement where the refinement body can only consist of sequences of lengths. Split bisimilarity. For (essentially) the synchronization-free fragment of Lang (or alternatively a language with CCS-like communication but without restriction), Aceto and Hennessy [8] established that strong 5/7//r2-bisimilarity is the coarsest congruence for action refinement contained in strong bisimilarity. Actually, in this language, 5/?//Y„-bisimilarity coincides with 5^p//r„_|_i-bisimilarity for any n^l. However, as soon as synchronization is included, 5^p//r2-bisimilarity is no longer a congruence: splitting actions in more and more phases yields more and more discriminating equivalences. Van Glabbeek and Vaandrager [66] present an example, parametric in «, to show that the 5^p//r-bisimilarities form a strict chain. The example is based on confusion on identity of auto-concurrent actions (i.e., multiple occurrences of the same action, concurrently executed) that split„ semantics may bring to light when there are more than n — 1 such actions. A simpUfied example that clarifies the difference between split2 and spliti^ is the so-called owl example, originally proposed by Van Glabbeek in 1991. 5.4. Consider t = {t\ WstiJW-, where S = {c\ c\d,d\ e, e'\ and0 relabels c' and c" into c, d' into d and e' into e (leaving all the other labels fixed).
EXAMPLE
tx = a; {(c; (c^; e' ||| d' ^ e) ^ c"'. d' \\\ e) \\\ d; 0), t2 = b; ((c; (c^^ d' III e'-^d)-^ c'; e' ||| d') ||| ^; 0). Symmetrically, we define u — (wi ||5W2)[0]» where ux = a; ((c; (c^ d' \\\e' + d)-^c'; e' \U) ||k; O), ui = b; {(c; (c'; e' ||| d' ^ e) ^ c^ d' ||| e') ||| J; 0).
Action
t:
a/
refinement
1097
\b
Fig. 8. The "owl" example.
The two interleaving transition systems are shown in Figure 8. The labels of the inner transitions are omitted for improving readabihty: they can be assigned by looking at the label of the parallel outer transitions. It is not difficult to see that the two transition systems are interleaving bisimilar. For instance, the sequence bac leads to bisimilar states in both systems: the "wing" of t is simulated by the "body" of u, and vice versa. The split2 transition systems for t and u can be guessed by considering that all the "diamonds" in the graph are divided into four sub-diamonds. The two resulting graphs are bisimilar (so t and u are split2 bisimilar) by following an argument similar to the above. The crucial point is reached after the sequence a\aiC\b\b2C\.In that state (which is the same in both graphs), the C2 executed by t is matched by the 'symmetric' C2 in the graph for u. This means that whenever t completes the c causally dcpeDdent of, let say, a then u completes the c caused by b.
1098
R. Gorrieri, A. Rensink
The same game cannot be played when splitting actions into three phases; indeed, it is always possible to recognize observationally in which of the two directions we are moving, i.e., which of the two c's we are going to complete. This informal consideration is illustrated by the sequence ac\ bc2C\ c^e which can be executed by t but not by u (unsplit actions stand for the consecutive execution of their three phases). Two natural questions then arise: • What is the limit of this chain of split,^ -bisimulation equivalences? • How does the chain limit relate to the coarsest congruence problem? It turns out (see Gorrieri and Laneve [73,74]) that the limit of strong 5/?//r,^-bisimilarity is an equivalence known in the literature as strong ^T-bisimilarity, originally due to Van Glabbeek and Vaandrager [65]. The ^T-principle improves over split by including a mechanism for reconstructing the individuality of each action occurrence. Typically, this is done by associating to each action one unique identifier that is used when it is necessary to know the right beginning for the currently executed ending. By the limit theorem of [74], it follows that strong ^T-bisimilarity is the coarsest congruence for splitting of actions; and in fact, the result extends to general refinement (see [57,133] for a more general congruence result, [30] for a coarsest congruence result for any form of refinement in the model of stable event structures and the survey paper [64] for another proof of coarsest congruence on several event-based models). Hence, strong 5r-bisimilarity is the required coarsest congruence contained in strong bisimilarity. It has also been proved in [9] that rooted weak ^T-bisimilarity (called refine equivalence in that paper) is the coarsest congruence for (syntactic) action refinement contained in rooted weak bisimilarity. Split traces. If one starts the investigation by considering trace semantics [88] instead of bisimulation, then the answers to the two questions above are slightly different. In the full language Lang, split^-ixdiCt equivalence again gives rise to a strict chain of equivalences. However, as shown in [101], the limit of the chain in this case is not 5r-trace equivalence. 5.5. Consider t =a;b \\\ b\ c; 0 and trace of / is EXAMPLE
a ^^ b b->c
whereas u additionally has a ^' b^- c b
M
= (a; b\ c ||| b\ c)||,c. The only pomset
Action refinement
1099
However, t and u cannot be distinguished on the basis of their split,j-imces. To see this, first note that the only possible difference can be that u has a trace that t cannot match; in particular, a trace that is a linearization of
Thus, such a distinguishing trace must reflect the fact that c is caused by the upper b (the one following a) rather than the lower b. However, no matter in how many phases we split b, this distinction cannot be made: in particular, any splits-trace b\ • "bia\"'anb\' "bnC\ of M can be matched by t because the bi^\ • • /?„-subsequence might belong to the first Z7-occurrence as well as the second. On the other hand, t and u are not 5r-trace equivalent. For instance, although both processes can perform the splitj-ivdicc b\a\a2b\b2C\/m t the /?2 must be the end of the first b\ whereas in u it may also be the end of the second b\. The Hmit of 5/7//r„-trace semantics has been characterized in [134] and called swapequivalence. It turns out that 5wa/7-equivalence is not a congruence for general action refinement. For instance, although (as we argued) t and u in Example 5.5 are swapequivalent, refining b into v = b\;b2 + b^, shows up their difference, since u[b ^^ v] has trace biab^c which t[b -> i;] cannot match. Vogler has proved in [131,132] that the coarsest congruence for action refinement contained in trace equivalence is 5r-trace equivalence. Further split semantics. In the linear time - branching time spectrum [59], in between bisimilarity and trace equivalence there are many other equivalences, among which failure [27] (or testing [43]) equivalence is the most relevant. The issues above have been investigated for this case as well: Vogler in [131,132] proves that 5r-failure semantics is a congruence for action refinement, and in [134] conjectures that it is also the coarsest congruence. Most of the work mentioned above has been developed on semantic models rather than process algebra. In addition to the work already cited above, papers dealing with operational split- and 5r-semantics include [31,37]. Characterizations of 5r-failure (or testing) semantics in process algebra are reported in [5] on a simple process algebra, and in [85] on CCS.
5.4. ST-semantics We go somewhat deeper into the 5r-semantics of terms. Below, we present a conversion from event transition systems into 5r-transition systems as well as a (compatible) operational ^r-semantics for Lang - including, of course, the refinement operator. ST-transition systems. It is clear from the above discussion that the main idea in STsemantics is to distinguish the start and end of actions, in such a way that there is an
1100
R. Gorrieri, A. Rensink
unambiguous association between the two. There are several different ways to encode this association. • The most straightforward method is to associate with the start of the action a unique fresh identifier, much like the event annotation, and annotate the end of the action with the same identifier. The disadvantage of this method is that the choice of identifier is free, and therefore it cannot be guaranteed that the same identifier is used in bisimilar states; one therefore needs a more elaborate, indexed version of bisimulation like we already had for event bisimilarity (Definition 4.3); see, for instance, [57,9,23]. • The above method can be improved by somehow fixing the choice of the fresh identifier so that it depends uniquely on the set of identifiers currently in use for "outstanding" action occurrences, i.e., actions that have started but not finished. This can be done for instance by imposing a total ordering on the set of all identifiers. One can then safely assume that the choice of identifier is always the same in bisimilar states. For an example, see [24]. • Alternatively, one can assume a tree-like structure and let the end of the action point back to the start through a natural number indicating the number of transitions one has to count back to find the associated start. This idea was used, e.g., in [73,74,31]. The disadvantage (which in fact also holds for causal transition systems as defined in Section 5.2) is that the resulting transition systems are necessarily infinite state for all recursive behaviours. • Here we use yet another principle, developed more recently in [24], which is in some sense a mixture of the above: the end actions indeed carry counters, but instead of transitions it is the number of outstanding occurrences (of the same action) that is counted. As a consequence, ordinary bisimulation can be used to compare 5r-transition systems. Moreover, the operational semantics not only generates finite state transition systems for the refinement-free fragment of Lang whenever the standard interleaving semantics does (which is also the case for the semantics of [23]), but also provides finite state models for action refinement. As labels in the ^T-semantics, for all a G Act we use ^"^ to denote the start of a fresh occurrence of a, and aj' with / € N^^ to denote the end of the zth occurrence of ^ that was still outstanding (counting backwards, that is, the most recent occurrence is numbered 1). We denote Acr^^ = {^"^ | « eAct) U {a~ \ aeAct, i e N^^} mdAct^^. =Act^'^ U (r, / } . DEnNlTlON 5.6. An 5r-transition system is an Acr^^-labelled transition system, such that for all states n e N and action a e Act there is a number 0(n,a) of outstanding occurrences where • O(L,a) = 0 for alia e Act; • If n-^n'
then 0(n\ a) = 0{n,a) -f 1 and 0(n\ b) = 0(n, b) for all
• Ifn-^n' then / ^ 0{n,a), 0(n\a) = 0{n,a) - 1 and 0(n\b) a^b; • Ifn —^ n^ then 0(n\a) = 0(n,a) for all a e Acr; • n —^ for all a e Act and 1 ^ / ^ 0(«, a).
a^b\
= 0(n,b)
for all
Action refinement
1101
(Note that this uniquely determines 0(n,a) for all reachable states.) As stated above, to compare ^T-transition systems we will use ordinary bisimulation. ST-transitions from event transitions. The event transition systems used in the previous section (Definition 4.2) give rise to ST-transition systems in the following way. Let T be an arbitrary event transition system. • The states of the »Sr-transition system derived from T are tuples (n, e) for some node n eN and finite vector of events e = e\"-ek such that n ^''^'> • • • - ^ ^ ^ n' for some n' and n ^''"'> for all 1 ^ / < /:. (In other words, the events in e are all enabled in n and can also be executed serially; this means that they are pairwise independent.) Due to the properties of event transition systems, the node n' is uniquely determined by n and ?; we denote n^ = n^. It follows that also n' = n^ for an arbitrary permutation d of e. • The outgoing transitions of (n, e) are the following (where for all 1 ^ / ^ /:, a, is the action associated with ei, and e \ i denotes the removal of the iih element of e): - line -^-^ such that e' is independent, in n, of all ^/, then (n, e) - ^ (n, ee')\ - line -^-^ such that e' is independent, in n, of all ^/, then («, e) —^ (n, ee'); - For all 1 ^ / ^ /c, if a, € Act then let a = a, and m =^\{i ^ j ^k \ aj = a]\\ then (n,e)^(ne^,e\i). - For all 1 ^ / ^ ^, if of, = r then (n, ?) —^ (/i^',, e \ /). - If ? = £ andn —> n\ then («, ?) —> («\ e). The number of outstanding a-occurrences of an 57-transition system constructed in this way equals the number of a's in the e: that is, 0{(n,e), a) = \[\ ^ j <,k\aj = a)\ for all states («,?). It is not difficult to check that this construction indeed gives rise to an 5r-transition system in the sense of Definition 5.6. Operational ST-semantics. In addition to the indirect construction of 5r-transition systems through the event-based operational semantics, presented above, we will also give a direct ^T-operational semantics for Lang. To be precise, we use a language Lang^^ with the following grammar (changes with respect to Lang are underlined; see also Table 16 for a complete overview of the different languages used in this chapter). T : : = 0 | l | a | a l | V + V|T;V|T|U.MT|TM|T[a->V,f]M|:c|M^.V. We briefly discuss the new operators. • a~ is an auxiliary operator denoting the intermediate state reached by a after it has started; depending on whether a is visible or not, it performs the corresponding end action or another r-action. (That is to say, r's are split as well, mainly to preserve some intuitive axioms up to bisimilarity.) As usual with auxiliary operators, a~ is not allowed in virgin operands (V in the grammar). • t\\A,M w denotes parallel composition extended with a mapping M .Act -> {0, 1}* to be discussed below. • t[a -^ M, V]M denotes refinement, extended with a vector li consisting of pending (or busy) refinements, entirely analogous to the busy refinements used in the previous sec-
1102
R. Gorrieri, A. Rensink
tion, except that here we do not need the identities of the events being refined. (In fact, those identities are encoded in the position of the pending refinement within the vector V.) We use i; \ / to denote the removal of the z'th element of the vector, and v ± (/, v') to denote the replacement of the /th element by v\ Again, M is a mapping, this time from Act to {0,..., iCl}*, whose purpose is explained below. In the last two operators, M may be omitted if it maps all a e Act to the empty string; thus, Lang is embedded in Lang^^. The well-formedness conditions on Lang^^ thus come down to the usual: • No virgin operand (V in the grammar) contains an auxiliary operator (1 or a~)\ • Recursion is allowed on guarded variables only. The challenge in the definition of the operational semantics of Lang^^ is to adjust the counters in the ar-labels of the operands' transitions in such a way that they always point to the correct start action. For the flat, sequential fragment of Lang this presents no particular problem, since there the order in which new actions are started and old ones are finished is directly derived from the operands. In the case of synchronization and refinement, however, we are faced with the problem that there is more than one operand that is active, i.e., may have outstanding action occurrences: in the case of parallel composition, both operands are active, and in the case of refinement, both the term being refined and all pending refinements are active. This means that the numbering of the outstanding action occurrences in the combined behaviour changes with respect to the numbering in the individual (active) operands. For instance, in a term a \\\a, the left hand side may do a^ and be ready to do ^ j " , after which the right hand side may also do a^ and be ready to do a^\ however, in the combined behaviour the a ["-actions should be distinguished since they refer to different start actions. We use a reverse numbering of outstanding actions in which the last action started is numbered 1, etc. This means that in the above example, the left hand side's aj"-transition should be renumbered, in the combined behaviour, to a^. To do this kind of renumbering systematically, we append a mapping M to the synchronization and refinement operators, which to every action a associates a string w of active operand positions: the /th element of w equals p precisely if the /th outstanding aoccurrence in the combined behaviour originated from the active operand in position p. For instance, in the behaviour a \\\ a considered above, after an a "^-transition of the left hand side (operand 0) the associated string is "0" whereupon after the ^^-transition of the right hand side (operand 1), the associated string becomes " 1 0" (note that the " 1" is inserted in front of the string; this is in order to implement the reverse numbering of outstanding actions, mentioned above). As is apparent from this example, we use natural numbers to identify active operand positions, starting with 0. Thus, the active operand positions of / |U w are {0, 1}, and those oft[a -> w, v] are {0,..., \v\]. The association string for each action is given by a string w of active operand positions. We use w[i] to denote the /th element of u;, u; \ / to denote the removal of the /th element from w (where 1 ^ / ^ |u;| in both cases) and p - w io denote the insertion of the operand position /? G N in front of w. Furthermore, we use mappings M:Act-^ N* (with only finitely many non-empty images) to associate such strings to
Action refinement
1103
actions, and use the following operations to adjust such mappings: [a,p]' M:b i-> { .^,,, [ M(b) M\{a,i):b
i-> { ^^).[ ^ \ M{b)
otherwise, otherwise.
The purpose of M is to determine the renumbering of action occurrences. We use M{p, a^) to denote the number that the /th outstanding «-action of the pih operand gets according to M. To determine this number, one must count the p's in M{a): the index of the /th occurrence of p in M{a) is the number we are looking for. Formally: M(p, aj~) = m such that M(a)[m] = p and \{j ^ m \ M(a)[j] = p}\ = i. For instance, if M{a) = 2102, then M(2, a~) = 1 and M(2, a~) = 4. The operational rules for termination, choice, hiding and recursion are as before (see Table 2) and omitted here. The operational rules for simple actions and synchronization are presented in Table 9. The meaning of the operational rules for "r|U,M w" is the following. When / performs a^ {a ^ A), M(a) is extended to reflect the renumbering of this new outstanding occurrence; on the other hand, when t (operand 0) performs a^, the occurrence / is renumbered according to M(a) and the occurrence is subsequently removed from M(a). This removal automatically adjusts the renumbering scheme so that the remaining outstanding occurrences are always numbered consecutively, as required in Definition 5.6. The number of rules for synchronization has grown from 3 to 7; this is because we have to distinguish start actions, end actions and r-actions. For the case of refinement we even have 10 rules, given in Table 10. There are four groups of rules concerning terms of the form t[a -^ u,Tij]M (compare also the event-based rules in Table 7): Table 9 Operational 5r-semantics for simple actions and synchronization
*
^^
*'
^
t-^
t'
a^A
m = M{0,a^)
f lU.A/" - ^ t' \\A.M\Ui,m)"
f WAM
H
—^ t WA^M "
t-^t'
i'^
A
t —> t a € A t\\AM^ - ^ ^'IU.[^/.0]A/"
II-^ii'
'
^
A
It —> u a ^ A MU.M" - ^ ML4.[«.11M"' u ^-^ ii'
a^A
m=
M{\,a.)
t WA.M^ - ^ HU.A/\(«.m) "'
t WA.M
U
— > t WA.M U
ty^peiX)eAU{/}
f\\A.Mi* -^ f'WA.M"'
1104
R. Gorrieri, A. Rensink Table 10 Operational 5r-semantics for the refinement operator
,^,' t{a-^
uN
V]M
,x
^^fl
,^,' t[a-^
M, -1
M
V]M
hi^a
m = M(0,ar)
I'm ,r t[a -^ u. - , y]M — > t [a -^ W' v]M\(h.m)
>t'[a ^ w, ^][h.O]M
r[«-^ M,
t'
- ^ t'[ a ^^ u.
V]M
1
,<,'
> U
b+ ./r a ^ u , i^M'](/,.|f| + i].A/ Vp
t[a- ^•M,
M
V]M
T
/
> U
- ^ / ' [ f l - ^ M, VU']M
> V
t[a -^11, v]|yv/ —> t{a - ^ M, v±{p > v' —1^ t[a ^ u,
V]M
r — ^ t' t[a -> M,
T
m = A/(p,
Vp —
^ t [ a ^ i :/, i; ± (p,^')]M\(h.m)
/
—>•
m
t[a-^
= M(p,bJ-) \p]M\{h.m)
u.
V]M
t-^t t[a-^
u,
- ^ t [fl - ^ M, i; ± (/?, v' ) ] A /
vp-
V]M - U .
r
,
t '\a-^u,
/ V\P\M
• The first group deals with non-t?-transitions of /; these are analogous to the nonsynchronizing transitions of parallel composition. • The second group deals with «"^-transitions of r. This starts a new refinement; the initial action of u is either a start action or an internal action. The list of pending refinements is extended, creating a new active operand position. • The third group deals with transitions of a pending refinement Vp in v (where the index p corresponds to the active operand positions) that do not lead to a terminated state. These are also comparable to the non-synchronizing transitions of parallel composition. • The fourth group deals with transitions of a pending refinement Vp that do lead to a terminated state. Such a transition can only be labelled by an end action or an internal action. The corresponding end action of t can now also occur, and the remainder of the pending refinement can be discarded. A careful investigation of the operational semantics reveals that it yields an 5r-transition system in the sense of Definition 5.6. Moreover, (standard) bisimilarity, applied to the STsemantics, is a congruence over Lang^^. For an independent proof of this property as well as a complete axiomatization of ^T-bisimilarity over a large class of recursive processes see [24]. Furthermore, the semantics satisfies the finiteness properties claimed above. Let \tXij denote the operational ^T-semantics of /. 5.7 (see [24]). Lett.ue Lang be arbitrary. (i) Ift is a refinement-free term with finite state interleaving semantics, then \tYsT ^^ finite state.
THEOREM
Action refinement
1105
(ii) Ifltf/^andl ^JsT ^^^fi^i^^ State, then l^t[a —> w]]^^ is finite state. As a final result of this section, we have that the indirect and direct 5r-semantics of Lang coincide. To be precise: if we denote the event-based operational semantics of a term t e Lang(Evt) by \t\^ev and the conversion of an event transition system T into an 57transition system by ST(T), the following can be proved by induction on the structure oft: THEOREM
5.8. For arbitrary (well-formed) t G Lang(Evt),
STiltfe^) ^
Istripit)}^.
PROOF (Sketch). A state (n, e) from 5r(|r]l,'v) corresponds to a term of Lang(Evt) (n is a derivative of r) plus a sequence e of initial events of n that are considered to have started but not yet finished. The events in e are thus independent in the sense of Definition 4.2. (n, e) can therefore
• start a new action, say a, precisely if n - ^ n for some d and n' such that n' —>; • finish any of the actions corresponding to events in {?}; the index is derived from the ordering in e\ • terminate if n is terminated and e is empty. The correspondence with derivatives of strip(t) in the 5r-semantics is intricate especially for synchronization and refinement terms: the mapping M used in the ^T-semantics is obtained by unraveling the vector e in order to determine the source of each event (and vice versa to reconstruct the events from the mapping M). D 5.5. Application: A simple data base To show the advantages of the above 5r-semantics, both in providing a congruence for refinement and in yielding finite state systems, we return to the example of Section 4.6. Figure 9 shows the ^J-semantics of the abstract system Datas := State \\upd Backup and the refinement Dataj := Datas[upd -^ req\ cnf][copy -^ back; copy], where State := (qry + upd): State, Backup := (copy-^ upd), Backup. The independence of the qry- and co/7}'-actions, noted before in Section 4.6, is apparent from the 5r-transition system by the fact that qry may be started during copy, i.e., between copy^ and copy'^ (and vice versa); on the other hand, qry may not be started during upd. As a consequence, in Data/ qry may interrupt the refinement of copy at any time, but may not interrupt the refinement of upd. 5.6. co-completeness As pointed out by Meyer in [105,106], the issue of coarsest congruences is relevant to another, quite different subject as well, namely that of co-completeness of equational theories.
1106
R. Gorrieri, A. Rensink Dataj
Datas back back I
qrVi Fig. 9. Operational ST-semantics of Datas and Datai.
To explain this, we first recall the syntactic interpretation of action refinement discussed in Section 1.4 above, and note that the syntactic substitution of an action by a term is quite similar to the syntactic substitution of a process variable by a term. Also recall that (in the standard interpretation) two open terms (i.e., with free process variables) are considered equivalent iff their instantiations are equivalent; in other words, if the equivalence cannot be invahdated by some substitution of terms for process variables. But this in turn corresponds precisely (given the similarity between action substitution and variable substitution just pointed out) to the second congruence property listed at the beginning of this sub-section. An equational theory is called a>-complete if any valid equation between open terms is derivable. We have seen just now that an equation between open terms is valid iff all instantiations are valid; this in turn is the case (interpreting variables as actions) iff the terms are equivalent under all action refinements, i.e., iff they are equivalent in the coarsest congruence. Summarizing, we have: In a setting where syntactic and semantic action refinement coincide, a complete axiomatization of the coarsest refinement congruence contained in — gives rise to an co-complete axiomatization of :^, when interpreting all actions as variables. A similar idea is pursued in [134]: if we consider expressions built with variables (which stand for languages) and the operations of concatenation, choice (union) and parallel composition (shuffle), then substitution of languages for variables can be seen as action refinement; validity of equations of such expressions can be checked using ST trace semantics. Analogously, if variables take values on words, validity of equations can be checked using 5w«/7-equivalence.
6. Semantic versus syntactic substitution We have stated in the introduction that there are two fundamentally different ways to regard action refinement: as an operator in the signature, or as a homomorphism (in fact, an automorphism) of the algebra establishing a transformation of terms. Since the semantic
Action refinement
1107
effect of the action refinement operator t[a ^^ u]is understood as the substitution, in some sense, of the action a by the behaviour of u in the semantic model of r, whereas a homomorphism effectively replaces aby u syntactically in r, the two interpretations are actually quite close; yet they do not always coincide. In the previous sections, we have considered the semantic interpretation of action refinement; below, we study the syntactic interpretation and investigate the difference between the two. The material of this section is mainly based on [69]. Note that if the two interpretations coincide, we automatically have an axiomatization for the action refinement operator: namely, it distributes over all other operators. In fact, this distribution property is a strong point in favour of the syntactic interpretation. On the other hand, the precise notion of syntactic substitution has to be considered carefully, as it may depend on the operators available in the language and on the kind of refinement we are interested in (atomic or non-atomic). In the above discussion, we first relied on the algebraic notion of an automorphism and then stated that this corresponds to the syntactic substitution of actions by terms. The connection between the concepts of automorphism and syntactic substitution is established by regarding the term algebra generated by the signature as the algebra over which the automorphism is defined. However, there are several respects in which this algebraic concept does not quite cover the notion of syntactic substitution we need. • It does not tell us how to deal with recursion, which is not an operator in the usual algebraic sense but rather a fixpoint constructor, i.e., a higher-order operator. As it turns out, the straightforward syntactic substitution within the body of the recursion (which does not affect the process variables bound by recursion) gives rise to a satisfactory solution. • It does not take operators into account that bind actions, such as hiding and (to some degree) synchronization. Strictly speaking, an automorphism / on the term algebra would transform each term t/A into op{f(t)), where op is the /-image of the unary operator -/A; the natural choice oi op\^ -/A' for some A'. As we will see below, in some cases this is not an appropriate way to model action refinement. Hence, although the intuition of an automorphism is initially helpful to understand action refinement algebraically, it is actually only an approximation. In the remainder of this section we will no longer appeal to this intuition. 6.1. Finite sequential systems Let us first consider again the simple sequential language of Section 2, restricted, moreover, to closed, finite terms (i.e., containing no process variables or recursion operators). We call a term^^r if it contains no occurrence of the refinement operator. In defining the syntactic substitution of a term for an action in Lang'^^^^--^", we already encounter the problem with respect to the hiding operator, mentioned above. 6.1. Suppose we want to substitute the action a by the term b; c within r. (I) If t = a/{a} (specifying an invisible action), then a naive substitution gives rise to (b;c)/[a]. Hence, after refinement we suddenly obtain visible behaviour where before there was none.
EXAMPLE
1108
R, Gorrieri, A. Rensink
(2) A slightly more sophisticated refinement of t — a/{a} would yield (b; c)/{b,c} (i.e., the set of hidden actions is adapted as well). This is still unexpected, since the refined system has two invisible steps instead of just one (and thus the refinement is not well-defined up to strong bisimilarity). Worse yet, using this principle (a; b)/{a] would give rise to {b; c\ b)/{b, c}, where the abstract Z?-action disappears even though it is not refined itself. (3) If t = a/{b} (specifying the execution of a), then a naive substitution gives rise to (b; c)/{b}. This starts with an invisible action rather than the expected execution ofb. Technically, these problems all have to do with the fact that, in our semantics, hiding acts like a binder of the hidden actions, just like restriction does in CCS (see [9]). Moreover, precisely the same problem occurs for action substitution within non-flat terms, since the refinement operator is a binder, too: in the term t[a ^^ u], SLW occurrences of ^ in r are bound by the refinement. By analogy with the syntactic substitution of free variables within the body of recursion, defined in Table 1, here we have to make sure that there is no confusion of "free" and "bound" actions during substitution. For that purpose, we first have to have a clear notion of the "free actions" of a term. In the terminology of Milner [108], these are given by the sort (called the alphabet in [11,88]). The term sort is defined in Table 11. The sort is somewhat comparable to the type of a term in functional languages. It is an upper bound to the actions that the process will do during its lifetime. This is expressed by the following key proposition (in the type analogy corresponding to subject reduction): PROPOSITION
6.2. Ift - ^ r' then S{t') U {a | a 7^ r} c S(t).
To guarantee the necessary absence of confusion, we take a rather drastic solution: the syntactic substitution of a term for an action will be undefined whenever a "bound action".
Table 11 Sort and action substitution t
Sit) 0
t{u/a} if Of = r
{a} otherwise ti/A
S{tO\A
{11
if a = a
Ia
otherwise
ti{i{/a}/A
if«^Aand<S(M)nA = 0
and^ ^Siu) op(t\,...Jn)
S{t\)U---US{tn)
opit\{u/a}
X
Sx
x
fjLX.tl
Sx
ljLX.{t\{l(/a})
t„{i{/a})
(other operators)
Action refinement
1109
i.e., a hidden action or an action being refined, either equals the action being replaced by substitution or is contained in the sort of the term substituted for it. The definition of action substitution is given in Table 11; see also [9]. The partiality of action substitution is subsequently smoothed out of existence as follows. Let = be the smallest congruence over Lang^^^ such that t/{A W {a}) = t{b/a}/{A b) {b}) {b ^ S(t)) t[a -> M] = t[b/a}[b ^u] {b ^ S(t)) for an arbitrary b such that the substitutions on the right hand side are defined. It is not difficult to prove that, given a large enough universe of actions Act, for all t{u/a} there is 3. t' = t such that t'{u/a] is defined; moreover, as a consequence of the fact that = is a congruence, if t = t' then t{u/a] = t'{u/a] whenever both are defined. In other words, action substitution is total and well-defined modulo =. Since = is finer than ^ and in fact finer than any semantic equivalence we consider in this chapter, it follows that we may always pick an appropriate ^-representative such that action substitution is defined. In the sequel, we implicitly assume that such a representative has been chosen, and proceed as if action substitution is total. (A similar assumption concerning free variables is made in [14] and elsewhere in the literature on functional programming.)' We now set out to show that (with the definition of action substitution developed above), m Lang'^'i^fi" there is no difference between the semantic interpretation of the action refinement operator (see Table 2) and its interpretation as action substitution (see Table 11). To formulate the result we are after, we define aflatteningfunction over sequential terms, which removes all refinement operators from a given process expression by performing the corresponding syntactic substitution. DEnNlTlON 6.3. ThQ flattening of a term t e Lang''''''^'\ denoted^a/(r), is defined inductively on the structure of t as follows: flat{op(t\,...,tn)) := op{fiat{ti),...,flat(tn)), flat{t[a -> u]) := flat(t)[flat{u)/a}. The coincidence of syntactic and semantic substitution is then concisely stated by the equation t =flat(t). The first result of this kind is the following: THEOREM
6.4. / ^flat{t) for any t € Lang seq.fin
(Sketch). The idea is to prove that refinement satisfies the defining equations of substitution (Table 11) except for that for refinement (and recursion); that is, to show that the following equations hold up to ^ : PROOF
r , \u a[a -> MJ = < a
ifa = a, otherwise.
An alternative solution would have been to build the necessary conversion of bound actions into the definition of action substitution, as we have done for variable substitution in Table 1. However, we find the present definition somewhat clearer.
1110
R. Gorrieri, A. Rensink
{t/A)[a -> w] = t[a -> u]/A
if a i A and S{u) 0/4 = 0,
op{t\, t2)[a -> M] = op{t\ [a -> M], /2[^ -^ w])
for other operators op.
(These equations in fact hold up to ^-gv) Using these equations, it is straightforward to show that for all^^r terms t e Lang'^^^--^" the following holds up to ^ (respectively, -^ev)* t[a -^ u] =t[u/a] (by induction over the structure of r). The actual theorem then follows by the definition of flat and the fact that '^ is a congruence (using a further induction over the structure of /)• D
6.2. Recursive sequential systems In extending Theorem 6.4 the full sequential language Lang^^^, we encounter several problems. The major one of these is that it is in general not possible to flatten terms of Lang "^^^ in which refinement and recursion are arbitrarily mixed. EXAMPLE 6.5. Consider the term / = /xx.(a; x[a -> a; b]). This specifies a process having as partial runs all prefixes of the infinite string ab^ab^ ab^ab^ - • -. This set of partial runs is not context-free; it follows that the behaviour of t cannot be specified in the flat fragment of Lang^^^, not even modulo trace equivalence, let alone modulo any stronger semantics. In other words, t admits no flattening within Lang"^^^. A similar situation occurs with t = iixM[a -^ a\{b + JC)], where recursion and refinement are mixed in a different way but to much the same effect.
In order to avoid problems of this kind, for the purpose of this section we restrict ourselves to instances of the refinement operator in which both operands of refinement are closed terms.^ Another, more technical issue is that the notions of sort and syntactic action substitution have yet to be defined for process variables and recursive terms. • To define the sort of open terms, we impose the requirement that all process variables are implicitly sorted; i.e., there is a pre-defined sort S_x ^ Act for all x e Var. Furthermore, S(iJ.x.t) is set to <S.v. We then impose the following well-sortedness condition on recursive terms (in addition to the existing well-formedness conditions): fix.t is well-sorted onlyif5(r)c5,. • With respect to action substitution, the natural solution is to define {ixx.t){u/a} to equal lix.t{u/a] and x{u/a] to equal x. At first sight, this invalidates the correspondence between action refinement and action substitution, since it gives rise to /xx.(^; x[b/a]) = /jix.a;x which clearly does not have the same behaviour as iix.(a; x[a —^ b]). However, we are saved by the new requirement that the operands of refinement must be closed terms; this precisely rules out terms of the form x[a ^^ b]. This is essentially the same restriction we used in [69], except that there we worked with process environments rather than recursion operators. In that paper, we justified the restriction by another well-formedness condition, namely that the sorts of t and u in t[a ^>- u] have to be disjoint.
Action refinement
1111
The resulting definitions of the sort and action substitution for process variables and recursive terms were already given in Table 11. Well-formedness. To summarize the well-formedness conditions in this section: • No virgin operand contains an occurrence of an auxiliary operator; • The operands of refinement must be closed terms; • Recursion is allowed on guarded variables only; • Recursion must be well-sorted. The "correctness criterion" for the sort of recursive terms is that Proposition 6.2 now also holds for all closed terms of Lang'^^^. As for action substitution, to prove the corresponding extension of Theorem 6.4 we have to adapt the notion of flattening to process variables and recursive terms as well: flat{x) = jc, flat(iJixJ) = fix.flat(t). We now come to the correspondence result for the full sequential language. THEOREM
6.6. t ^ flat{t) for any t e Lang^".
(Sketch). We have seen that Theorem 6.4 essentially consisted of proving t[a -> u]^ t{u/a} by induction on the structure of r. Since / is bound to be closed, for the purpose of the current theorem we only have to extend the existing proof with the case fort = fix.t\\ i.e., we show PROOF
(ljix.t\)[a -^ u]^ ixx.ti [a -^ u]. The proof consists of showing that p = [(u\{iJix.t\/x}[a->
u],u\
{fix.tda^u]/x)}fv{ui)^{x}}
is a bisimulation. The proof obligation follows as a special case (taking u\ =x).
D
6.3. Atomic refinement We now consider the language Lang^'^^^"^ with atomic refinement, discussed in Section 3. This entails taking two new operators into account: parallel composition (without synchronization) and the atomizer. The definition of the sort and action substitution for these new operators follows from the "other operators"-clause of Table 11. The definition of flattening in Lang''^''"' is a variation on the one we had before: the difference is that the effect of atomically refining an action a by M is not the straight execution of u but rather the atomic execution of w, i.e., the execution of {u). This gives rise to
1112
R. Gorrieri, A. Rensink
a function ^flr^^^^^'", whose definition for the flat fragment of Lang^'^^^"^ is analogous to the definition of flat (Definition 6.3) but for the refinement operator is given by
This is actually the key point distinguishing atomic and non-atomic refinement. We obtain the analogous result to Theorem 6.6; the proof is also analogous, and hence omitted. THEOREM
6.7. t ^ flat'''''"\t) for any t e Lang"''"\
6.4. Synchronization In the full language with non-atomic refinement, we encounter the operator for parallel composition with synchronization, indexed by the set of synchronizing actions. When we do action substitution in such a term, this explicit occurrence of action names gives rise to the same type of confusion as for hiding (see Example 6.1). 6.8. Consider the replacement of a by b; c in the term t e Lang. (1) If t =a\\aa, specifying a single execution of a, then a naive substitution gives rise to t{b; c/a} = b; c\\a b\ c, which can do two times b\ c in parallel and hence is not an intuitively correct refinement of t. (2) A slightly more sophisticated substitution in t above yields b\ c\\hxb\ c, which is more reasonable; however, according to the same principle, c; a \\a a, which can perform c, gives rise to c; b\ c\\h,cb\ c, which is deadlocked. (3) If t =a\ cWh^cC, then the substitution gives rise to t[b\ c/a) = b; c; c\\hxc; this is not a reasonable refinement since the former can do ^; c whereas the latter is deadlocked.
EXAMPLE
However, in contrast to hiding, in the case of synchronization the actions are not bound; rather, our operational semantics (Section 4) specifies that actions remain visible after synchronization, and are therefore still available for further synchronization or, indeed, refinement. For this reason, although action substitution for parallel composition needs a side condition that is comparable to the one for hiding in Table 11, we cannot argue (as we did before) that substitution is still totally defined modulo =. Sort and action substitution for synchronization are defined in Table 12. Note that when replacing a synchronizing action, the synchronization set is adapted accordingly; this corresponds to the "more sophisticated" solution pointed out in Example 6.8.2. However, our problems are not yet over. Consider t = t\ \\At2- As long as we do not substitute actions in A, and moreover take care that A and S{u) are disjoint, the desired distributivity property t[a -^ u] = t\[a -^ u] \\A tila -^ w] holds up to ^ev; hence everything goes smoothly (see the proof sketch of Theorem 6.4). However, when a occurs in A, then t{u/a} and t[a ^^ u] may be different. EXAMPLE
6.9. We show some t and u such that t[a -> u]y^ t{u/a}.
Action refinement
1113
Table 12 Sort and action substitution for parallel composition with synchronization /
S(t)
t\\\At2
t[u/a}
S{tO\JS{t2)
t\W/a] \\(A\{a])^SUi)t2{i^/a] if « € A and S{ii)r\S{t) C A t\ [li/a] \\A tiW/a} if « ^ A and S{ii) H A = 0
• Consider t = a\\aa and u=b-{-b,c.t always terminates after having performed a, and so t[a -> u] terminates after either b or be, but t{u/a} does not always terminate: t{u/a} = (b-^b; c) U,c {b^b;c)^l
U,, c,
where the right hand term is deadlocked. • Consider t = (a \\\a; b) Wa {a \\\a; b) and u =c;d. In t[a -> w], there is a c-transition after which in every state reachable by cd, either no b or two consecutive ^'s are enabled: t[a ->u]
= ^-^^
(ioa III la) ||,, (2a \\\ 3a; 4bma -^ 5c: ed] ((oa III 1^) II., {2a III 3«; 4bma -^ 5c: ed. e -^ ^d\
where e — ((0, *), (2, *)). On the other hand, for all t{ula\ -^ t' there is a t' -^M-^ t'^ such that t" -!U : in particular, after t{u/a} - ^ (d \\\ c; d\ b) ||,,j {d III c; d; b) (= t'), which intuitively corresponds to the transition above, we can continue with t' ^^
(d III d; b) \\,j (d III d; b) ^
- ^ (1|M;Z7) 11,.,/Willi) such that t"
(1 III J; b) ||,. j {d \\\ b)
{=t")
b
In [69] we discussed necessary and sufficient conditions under which refinement and substitution of a synchronizing action give rise to event bisimilar models. (To be precise, in [69] we considered isomorphism of configurations; as we stated before, however, this actually coincides with event bisimilarity.) The crucial part is to find conditions for the following distributivity property (which is analogous to the rule for action substitution in Table 12): (^1 IIAW{«} t2)[a
-^ u] -^ev ^I [Cl - > u] \\A\i)S{u) ^2[ci ">
u].
This is indeed precisely the property that fails to be satisfied in both instances of Example 6.9. The solution given in [69] consists of a number of fairly involved semantic constraints, which are in general undecidable; rather than repeating the constraints here, we give a decidable "approximation" or ''estimate", which is a simplification of the one in [69].
1114
R. Gorrieri, A. Rensink
Table 13 Auto-concurrent actions and determinism
0 1
C{t)
V{t)
0 0
true true
Of
ti-\-t2 ti;t2 t\\\At2
tx/A
{0t\0i^x]
f {C{tx)\a)VJS{t2)
^ix.t2
a
C, C,
^T
V{ti)AVit2)A$a: it\ >)Ait2-^) r>(ri)AP(/2) r>(r|) A V{t2) A (5(ri) n ^(ri) c A)
C(/i)UC(/2) C(ri)UC(r2) C(tOnC{t2) UiCitOUC{t2))\A uiS(tonS{t2))\A C(/i)\A
P ( r i ) A ( 5 ( r i ) n A = 0) \iaeC{t\) if « G S(ti) \ C(/i) otherwise
Viti )A(a^
5 ( / | ) V V{t2))
V,
The decidable approximations, which are given in Table 13 in the form of functions over Lang, provide sufficient conditions for the actual semantic constraints; the idea is the same as for the sort of a term (see Tables 11 and 12), which provides an approximation of the actions that may be performed by the term (see Proposition 6.2). The intention of the functions defined in Table 13 is as follows: • C{t) c Act approximates the set of auto-concurrent actions of r, i.e., the ones that are executed in more than one parallel component without being synchronized. This is an over-estimate, due to the fact that one or more occurrences of an action may fail to be executed (as for a in a \\h b\ a) or are serialized (as iov a in a\b \\h b\ a). • V{t) G B is a Boolean indicating whether t is deterministic and contains no internal actions. This is an under-estimate: terms for which V{t) does not hold may yet be deterministic - for example, a\\iyb\a. For recursive terms, the definition of these functions rehes on pre-defined sets Cx and predicates V^ for all x G Var, just as the definition of the sort in Table 11. We extend the well-sortedness condition to imply that these sets and predicates are in correspondence with the recursion body: Extended well-sortedness. t is well-sorted if for all subterms iix.u, in addition to S{u) c Sx we also have C(u) c Cx and Vx => V{u). In the remainder of this section, we only consider terms that are well-sorted in this extended sense. The following proposition expresses the semantic properties that are guaranteed by the functions in Table 13. 6.10. Lette Lang be arbitrary. • a £ C(t) if there exists a t' reachable from t such that t' (in the event-based semantics of Section 4).
PROPOSITION
e\ .a
and t'
e\M
Action refinement
1115
• V(t) implies that for all t' reachable from t, t' - i > and ift' - % rj' and t' - ^ t'^ then t" — t"
For the proof see [69]. An important further property of these functions is that they are insensitive to the flattening of terms, in the following sense: PROPOSITION 6.11. Ift e Lang such thatfiat{t) is defined, then S(t) = S(flat(t)), C(t) = C(flat(t)) andV(t) <^=^ V(flat(t)).
For the proof see [69]. We now define the concept of u/a-compatibility over the flat fragment of Lang, which estabhshes a sufficient condition guaranteeing that the refinement of a by M and the substitution of a by M coincide. (1) t/A is M/A-compatible \ia ^ A, S(u) n A = 0 and t is w/a-compatible; (2) t = t\ \\At2 is M/a-compatible if ri and ti are M/a-compatible and one of the following holds: (a) fl ^ A and S(u) H A = 0; (b) aeA\S{t) andS(u) 0S(t) = 0; (c) aeA\ C(t), S{u) n S(t) = 0 and V{u)\ (d) aeA and u = X^JLi «/ such that S{u) n S(t) = 0; (3) IJLXJ is M/a-compatible if t is M/«-compatible; (4) For all other operators op, op(t\,. ..Jn) is w/a-compatible if all r, are u/acompatible. The interesting part is the requirement for parallel composition. This consists of the case where the substituted action is not in the synchronization set (Clause 2(a)), or, if it is in the synchronization set, the case where it is never performed (Clause 2(b)), where it is performed but not auto-concurrent, and the refinement is deterministic (Clause 2(c)) and where it is auto-concurrent and the refinement is a choice of atomic actions (Clause 2(d)). As a consequence of the main theorem of [69], we have the following property: 6.12. Ifte t[a -> u] ^e\/t{u/a}. PROPOSITION
Lang is fiat and u/a-compatible, then t{u/a} is defined and
Building on substitution compatibility, we now define the property of reducibility of terms, which establishes a sufficient condition guaranteeing that every action refinement operator in a term can be converted into an action substitution (i.e., the term can be flattened) without changing its semantics. • ixx.t is reducible if t is reducible; • t[a -> u] is reducible if t and u are reducible 2ind flat(t) is M/a-compatible. • For all other operators op, op(t\,..., r„) is reducible if all tj are reducible. Here, the interesting case is that of refinement. The following theorem extends Theorem 6.6 to Lang: a term and its flattening coincide // the term is reducible. The proof is by induction on the term structure, using Proposition 6.12. THEOREM
6.13. Ifte Lang is reducible, thenfiat{t) is defined and t -^es,flat(t).
1116
R. Gorrieri, A. Rensink
By "tuning" the functions S, C and V, it is, of course, possible to come to an improved characterization of reducibility, i.e., one which provides a better estimate of the underlying semantic property; however, as mentioned above, decidable necessary and sufficient criteria for the coincidence of syntactic and semantic refinement do not exist.
6.5. Application: A simple data base We apply Theorem 6.13 to the example of Sections 4.6 and 5.5. This consists of a process Datas '-— State \\updBackup, where State := {qry-\-upd)\ State, Backup := (copy-\-upd)\ Backup. We then refine upd and copy, resulting in Data/ := Dataslupd -^ req; cnf][copy -> back; copy]. We show Data/ to be reducible, in the sense defined above. For this purpose, we must check that the terms Dataslupd -^ req\ cnf] and back; copy are reducible and tha.tflat(Datas[upd-^ req; cnf]) is (back; co/7>0/co/7j-compatible. • To see that Dataslupd -> req; cnf] is reducible, we must check that Datas and req; cnf are reducible (which is trivially true, since both are already flat) and thai flat (Datas) (= Datas) is (req; cnf)/upd-comp2itih\e. The latter comes down to checking that State Wupd Backup (the body of Datas) is (req; cnf)/upd-compaiMQ. For this purpose, we must check that State and Backup are (req; cnf)/upd-compatihle (which is trivially true, since neither contains parallel composition) and that upd and req; cnf are compatible with the synchronization set. This is indeed the case, since C(State\\upd Backup) = 0 and hence upd G [upd] \ C(State\\upd Backup), and furthermore, V(req; cnf); hence compatibility clause 2(c) holds. • back; copy is trivially reducible, since it is a flat term. • flat (Dataslupd -^ req; cnf]) = Data' where Data' = State' \\ req.cnf Backup , State' = (qry -f req; cnf); State , Backup = (back; copy -h req; cnf); Backup . To see that this is (back; co/7y)/cop>'-compatible, the main point is checking that State' \\req,cnf Backup' is so. This is indeed the case, since copy ^ {upd}; hence compatibility clause 2(a) holds. According to Theorem 6.13, since Data/ is reducible it can be flattened, i.e., it is equivalent (event bisimilar, and hence also 5r-bisimilar and interleaving bisimilar) to the process obtained by carrying out the refinements syntactically, given by Data^''' := Statefl''' Wreqxnf Backup^''' where Statefl''' := (qry-^ req; cnf); Stated'"', Backup^"^ := (back; copy-\-req; cnf); Backup^^^\
Action refinement
1117
This can be verified by comparing the behaviour of Dato)^'^ with that of Data/ as depicted in Figure 6 (taking the event-based semantics modulo event bisimilarity) and Figure 9 (taking the ^T-semantics modulo standard bisimilarity).
7. Dependency-based action refinement Although intuitively, action refinement is closely connected to the concept of top-down design, in practice the steps one would like to make in top-down design do not always correspond completely to the constructions allowed by action refinement. An example is the sequential ordering of tasks at different levels of abstraction. On an abstract level of design, one may specify that two activities, which on that level are regarded as atomic, are causally ordered - for instance because one of them produces an output that is consumed by the other. When one refines this specification in a top-down fashion, taking into account, among other things, that the previously atomic actions actually consist of several subactivities, then the causal dependency does not necessarily hold between all respective sub-activities; rather, it may be the case that the output is produced somewhere during the refinement of the first action (not necessarily at the very end), and consumed during the refinement of the second (not necessarily at the very beginning). Motivating example. As a clarifying example (originally inspired by [99]), consider a buffer of capacity 1, which allows the alternating put and get of a data value. In fact, consider the case where only a single put and get occur. Abstractly, it is clear that a causal dependency exists between put and get, induced by the flow of data. Now consider a design step driven by the fact that the data values are too large for a single buffer cell, and consequently it is decided to use two buffers in parallel: data values are split in two and a piece is put in either (implementation-level) buffer. This comes down to refining put by put^ \\\put2 Sind get by get^ \\\get2If we treat this design step through the application of the refinement operator to the original specification, put; get, we arrive at the behaviour (put\get)\put->put^
\^put2\{get^
get^ Wlgetj] ^ev (put^ Mput^Y. {get^ lllg^^).
This, however, is not necessarily the intended implementation-level behaviour: there is an ordering between put^ and getj and between puti and get^, whereas the data flow only imposes a causal ordering between put^ and geti for / = 1,2. In this section, we review the solutions that have been proposed for this problem, first by Janssen, Poel and Zwiers [91] in a linear time setting and later in [89,90,136,126] for branching time. These solutions are based on an idea taken from Mazurkiewicz traces [103, 104], namely to recognize explicit dependencies between actions. That is, rather than working with actions that are (from the point of view of the formalism) completely uninterpreted, as before, now we assume some further knowledge about them, in the form of a (reflexive and symmetric) dependency relation over the action universe Act. Action refinement takes dependencies into account by imposing causal ordering only between dependent actions, regardless of the ordering specified on the abstract level.
1118
R. Gorrieri, A. Rensink
For instance, in the example above, putj and geti are dependent (for / = 1,2) but puti and get2 as well as put2 and get^ are independent. Thus, the behaviour of the refinement, given by the term (put^ Wlget^); (put2 IWgeti), would be equivalent to puti; get^ \\\put2', get2, which, in view of the assumptions, is a reasonable design. On the other hand, if the more complete ordering above was actually intended (for whatever reason), this can still be obtained by explicitly specifying that all ^^r,-actions are dependent on all pM/y-actions.
7.1. Dependencies in linear time The idea of action dependencies was transferred to a process-algebraic setting by Janssen, Poel and Zwiers [91], using an approach again advocated in [142]. We can reconstruct the basic elements of the setup of [91] as follows. • They assume a global dependency relation D c Act x Act, which is reflexive and symmetric but not necessarily transitive. The underlying intuition is that a D b if a and b share resources, and so the order in which they are executed may influence the outcome of the computation. We also write a D Aif3b e A: a D b. The complement of D is given by / c Act x Act. It follows that alb only if a and b can be executed independently (or in either order). We also write a I A'li -^{a D A), i.e.,ifV^GA: alb. • They define the weak sequential composition of two processes / and M, denoted r • M, in such a way that only the dependent actions from first and second component are ordered. As a special case, if a I b for all a e S(t) and b e 5(w), then the semantics oftu and t III u coincide; or more generally, if the sorts of t\ and «?, respectively u\ and t2 are independent then the following communication closed layers law holds: (t\\\\U2)'(t2\\\U2)
=
{tl't2)\\\(Ui-U2).
In fact, in [91,142] strong and weak sequential composition are both present within the same formalism; since the novelty is in the latter, we ignore the former in this section. • They require that refinement preserves independencies, in the sense that if a is refined into u and a I b for some b, then also b I S(u). (This requirement is not explicitly stated in [91], but it is necessary for the theory to be sound.) • They do not consider invisible actions or hiding. The technical reason for this is that the information added by the dependency relation would be lost upon hiding. Although one can envisage an approach in which there is a family of invisible actions in which the dependency relation is somehow retained, this has not been worked out. In the remainder of this section, we therefore ignore hiding and invisible actions. This results in a semantics where refinement distributes over weak sequential composition: (t\ ' t2)[a -> u] = t\[a ^^ u]' t2[a -^ u]. Taking the example at the beginning of this section and interpreting the abstract sequential composition put; get as the weak put • get instead, and assuming putj I getj for i ^ j , it
Action refinement
1119
follows that refinement does not impose more ordering than necessary: {putget)[put^put\
\\\put2\[get-> get\ l^getj]
= iputx \\\put2) • {get^ \\\get2) =puti -get^ \\\put2'get2. Janssen et al. [91] use a compositional, linear-time semantics. The linear time nature has to do with the fact that they consider sets of traces as their semantic model, in which the moment of choice is not recorded. The traces are partially ordered (hence pomsets, see Section 5.1) in a special manner, closely related to Mazurkiewicz traces: two occurrences are ordered if and only if the associated actions are dependent. This means that even if parallel execution is specified, dependent actions in different operands are interleaved; thus, the traces of a \\\ b with a D b dxt given by \a -> b\ and \b ^ a\ and not by \^. As usual in a trace-based semantics, the choice operator is modelled by taking the union of trace sets. Atomic refinement. The above informal discussion of the refinement operator does not precisely correspond to the solution of [91]. Namely, within the setting of action dependencies, one has once more the choice between atomic and non-atomic refinement, discussed at length earher in this chapter (Sections 1.3 and 3). It is the former that has been worked out in [91]; in particular, they also include the atomizer (r) we discussed in Section 3. This gives rise to a language Lang^^^ with weak sequential composition and atomizer, generated by the following grammar:-^ T ::=0 I 11 a I T + T I U
I T IIIT I (T) I T[« ^ T] I jc I fxx.J.
See also Table 16 for a complete overview of the different languages used in this chapter. In the linear-time setting of [91], there is no need to forbid termination in choice or refinement terms; correspondingly, we have not distinguished 'Virgin operands" in the above grammar. Instead, as stated above, the theory is sound only if we impose as a well-formedness condition that refinement has to be D-compatible: DEHNITION
7.1. t{a -^ u] is said to be D-compatible if a I b implies S(u) I b for all
b e Act. In this setting the atomic execution of a term t comes down to the following. In a term of the form {t) \\\ w, those actions aofu that are dependent on some action (in the sort) of t are scheduled either weakly before or weakly after r, where the adjective "weakly" implies that a can still overlap with any initial or final fragment of / of which it is completely independent; but not in the middle (that is, after one action b of t with a D bbwi before another action c of r with a D c). On the other hand, if a is independent of r, i.e., a I S(t), then it may be executed at any time during the execution of (r)."* ^ In fact, only a special case of recursion is considered in [91], namely the Kleene star for weak sequential composition. We conjecture, however, that the theory carries over to full recursion without a problem. '* Thus, in terms of the discussion in Section 3, here the execution of an atomic process is non-interruptible for dependent actions but not for independent ones, and in contrast to the operator worked out in Section 3, here the execution of an atomic process is not all-or-nothing.
1120
R. Gorrieri, A. Rensink
EXAMPLE 7.2. If Z? D a, for / = 1, 2, then axhai'is not an allowed execution sequence of either {a\ -ai) ||| b ox {a\ ||| ai) ||| h\ if furthermore b I aj, then a\ aiba^, is an allowed trace of {a\ ' a2 ' «3> III b. Finally, if c / a/ for / = 1, 2, 3 then {a\ • 02 • ^3) III c puts no constraints whatsoever on the moment of execution of c with respect to the ai.
The main motivation given in [91] for choosing atomic over non-atomic action refinement is to make refinement distribute over parallel composition, i.e., to satisfy (t\ III t2)[a ->u] = ti[a-^ u] III t2[a -^ u]. The following example shows why this is incompatible with non-atomic refinement. (Recall also Section 1.5, where we made exactly the same point in connection with standard interleaving semantics.) 7.3. Consider Act = {a,a\, a2, b} with a D b and «, D ^ for / = 1, 2. As we saw above, the semantics of a \\\b is given by {\a -> bl\b-> all; therefore (a \\\b)[a -^ a\ ' a2\ is modelled by {j^i -^ a2-^ b[ \b-^ a\ ^f- 6r2|}. In other words, the semantics satisfies EXAMPLE
{a III b)[a —> «! ' a2\=a\ - ai-b-^b
a\ 02.
On the other hand, if we interpret action refinement non-atomically (meaning that a[a ^^ t] = r), then the above distributivity property implies (a III b)[a -^ ax • aj] = a[a -^ a\ • ai] III b[a -^ a\ • 02] = (ai • ^2) III b. This contradicts the previous equality, since (a\ - a2)\\\b ^ a\ - a2 • b -\- b - a\ • ^2. With atomic refinement (which satisfies a[a -^ t] = {t) instead), we obtain (a \\\b)[a -^ a\ • ^2] = («i • «2> III b, which is fine, since indeed {a\ • ^2) III ^ = ^1 * ^2 • ^ + ^ • «i • ^2The details of the semantics of [91] are outside the scope of this paper; suffice it to say that it gives rise to a pre-order c^^c Lang^^^ x Lang^/^^ with the following property: PROPOSITION
7.4. ^^ is a pre-congmence over Lang'/^'.
Furthermore, just as in the case of Lang"^^'"\ action refinement distributes over the other operators (see [91, Theorem 3.2]) and thus corresponds to atomized action substitution; that is, the following equality holds up to c^^f = ^^ D ^^ (compare with [91, Corollary 3.3]): t[a -^ u] — t{{u)la}. This implies that the following also holds (compare with Theorem 6.7): THEOREM
7.5. t -^ flat''''''''{t) for any t e Lang'/^\
1121
Action refinement 7.2. Application: Critical sections
As an example of the use of action dependencies, consider again the system of Section 3.4: Sys^ := Proc\ \\\ Proci where for / = 1,2 Proci := ncsi; csi; Proci. The non-critical sections, ncsi, do not depend on any action of the other process; i.e., we have ncsi I ncsj and ncsi I csj for i ^ j . Asa. consequence, in the semantics of Sys^ the occurrences of ncsj are unordered with respect to csj (for i ^ j)\ for instance, a valid trace is
Now consider the same refinement as in Section 3.4: Sysi :=Syss[cs\ -^ a\; b\][cs2 -^ bi + C2]. In order for the refinements to be D-consistent, we must have ncsi I aj whenever i ^ j ' , moreover, we assume all actions of the critical sections are mutually dependent. This time, the implementation does not suffer from the problem discussed in Section 3.4, where we found that the non-critical sections may not overlap with the critical sections. For instance, a valid trace of Sysj is
where ncs2 is unordered with respect to a\ and b\ and hence may be scheduled in between them.
7.3. Dependencies in branching time As we have seen above (Example 7.3), the main motivation in [91] for considering atomic refinement was to obtain distributivity over parallel composition. If we abandon this property, there is no intrinsic difficulty in modelling either non-atomic refinement or parallel composition with synchronization in a setting with action dependencies. For this purpose, we define the language Lang^^\ with the following grammar: T ::= OA k I T + T I L J I T lU T I T[5 -> T] \x\fix
.1.
1122
R. Gorrieri, A. Rensink
(Note that internal actions and hiding are again omitted, for reasons discussed above. See also Table 16 for a complete overview of the different languages used in this chapter.) The new constant 0^ denotes partial termination and generalizes both 0 and 1; it is discussed below in some detail. In contrast to 1, however, 0^ is not considered an auxiliary operator; in fact, Lang^^ has no auxiliary operators and hence the concept of "virgin operand" plays no role in the well-formedness of terms of Lang^^^\Instead, we impose several wellformedness conditions to do with the dependency relation; see below. Another new aspect of Lang^^^ is that its refinement operator maps a vector of actions to refining agents, instead of just one: the motivation for this is also given below. Operational semantics. Table 14 contains a branching time operational semantics for Lang^^^, insofar it deviates from the semantics given before (Tables 2 and 6). The semantics for the flat fragment of Lang^^^ was developed in [125] and extended with refinement in [136]; the solution presented here is based on an improved version in [126]. We briefly discuss the salient points. Partial termination. Compared with the linear time case, there are some interesting complications having to do with the interplay between weak sequential composition and choice. EXAMPLE 7.6. Consider actions a,b,ce Act such that a D c and b I c, and consider the process (a -\- b) - c. The linear time behaviour of this process consists of a trace where a and c are executed in sequence, and a trace where b and c are executed independently. The
Table 14 Transition rules for Lang^" bIa
aIA
,44
u^u
A,' t-u^t'
-u'
t\\^u^t'
ixx.t —^ fix.t
lU "'
t\a -^ Xi\ -^ t'[a -^ ft]
nx.t —^ r' tJ^t'
t • It
t —^ t
bi
> t' • U
[a]
t[a -^ fi] - ^ t'[a -^ u]
u-^u'
t • U
^ t' • ll'
t —^ t
Hi —> ll
t[a - > w] - ^ u' • t'[a ^ w]
Action refinement
1123
corresponding branching time behaviour imphes that c can be executed initially, but this resolves the choice between a and b. In capturing these effects operationally, one has to take into account that • the second operand of weak sequential composition can be active even if the first has not yet terminated; • actions performed by the second operand of weak sequential composition may resolve choices in the first. For this purpose, we have introduced the concept oipartial termination: instead of a deadlock constant 0 and a termination constant 1, we now have a family of constants OA, where A stands for the deadlock alphabet. 0^ is deadlocked for all actions a that are dependent on some b e A, and terminated for all other actions. The notion of ''termination for a given action" is captured by a family of new transition labels /a ^or a e A: t —^ t' expresses that t is terminated for a, where invoking the termination possibly resolves some choices by which the term becomes t'. For instance, we have that a —^ a'xib I a and 0^ —^ OA if « / ^ . The latter implies that the deadlock constant 0 of Lang corresponds to O^r/ (no termination at all) whereas the termination constant 1 corresponds to O0 (termination for all actions). We continue using 0 and 1 as abbreviations for these special cases. From the rules in Table 14, it can be seen that partial termination resolves choice if precisely one of the operands terminates and the other cannot. In Example 7.6, for instance, b —^ b but a -A-, and hence a-hb —^ b\ we obtain the derivation bl c b ^ b a ^ b ^ b (a-\-b)'C-^b-l
which is indeed the expected behaviour. (To avoid generating infinite state spaces for virtually all recursive terms, one then also has to add a mechanism to get rid of superfluous I's, such as in the target term of the above transition; this can be done for instance by normalizing terms with respect to some structural congruence that includes the axiom r.l^r.) Recursion. The termination behaviour of recursion has a problem connected to the negative premise in two of the rules for choice, if one takes the natural extension of the standard operational rule for recursion to partial termination:
t{^x.t/x]-^t' iJiX.t - ^ EXAMPLE
t'
7.7. Let«, Z?, c € Act with ale
and b I c, and consider the process t = /xx.ia-
1124
R. Gorrieri, A. Rensink
X -\-b) with Sx = [a, b). If we assume t - A , we obtain a contradiction: r4>
bic
a 't - 7 ^
b - 7 ^ Z? .
t ^ b On the other hand, no transition of the form t —^ t' can be derived, since this would require an "infinite unfolding" of the recursion. Problems due to negative premises have been studied in depth in [80,58]. A crucial point in our solution is to take the sort of process variables (see Table 11) into account within the operational rules: • A recursive term always terminates, without unfolding, for any action that is independent of the entire sort of the recursion variable. For instance, for the term r == /xx. (a • x -f Z?) in Example 7.7 we obtain t —^ t. • The previous rule (in Example 7.7) for the partial termination of recursion is restricted to v^-transitions with a D Sx, because otherwise we could unfold recursive terms arbitrarily often in the derivation of a vf,-transition; for instance, for the same term t above
a -t —^ at a-t + b^a-t-hb at + b < •
A related problem is that, due to the changed nature of termination, the standard notion of guardedness (Definition 2.1) is not appropriate any more, but needs to be strengthened. 7.8. We first define what it means for a term to be a D-guard for an action € Act. 0/1 is a D-guard fox a'\ia D b for some b e A\ X is a D-guard for a if a D b for some b e Sx; Z? is a D-guard for a if a D b; / + M is a D-guard for a if both t and u are D-guards for a; t[b -^ u] is a D-guard for a if r is a D-guard for a; For all other operators op, op(t\,..., r„) is a D-guard for a if one of the r, is a D-guard for a. Next, we define what it means for a variable to be D-guarded in a term. • jc is D-guarded in y (G Proc) if x ^y\ • jc is D-guarded in r; M if jc is D-guarded in t and either t is a D-guard for all a e Sx or X is D-guarded in u; • JC is D-guarded in fxy.t if either x = y or x is D-guarded in t\
DEFINITION
a • • • • • •
Action refinement • For all other operators op, x is D-guarded in opit\,...,
1125 r„) if JC is D-guarded in all ti.
For instance, the term /xx.(fl • x -\- b) in Example 7.7 is D-guarded if a D b but not if alb/ b (because then a —^ a but bi b D b e *Sv). We require D-guardedness as a necessary condition for well-formedness. Refinement. The operational rules for refinement in Table 14 are essentially the same as for the sequential language Lang^'^^^ (see Table 2), except that we now use weak rather than strong sequential composition. However, for these rule to make sense, the refinement should be compatible with the dependency relation, in a stronger sense than in the linear time case (Definition 7.1). DEHNITION 7.9. t[a -> u] is said to be strictly D-compatible if it is D-compatible and, moreover, for all b e Act, a Db implies
(i) u - 7 ^ and (ii) c Dbiox2Mu-^. The additional condition expresses that dependencies should be preserved as well as independencies: if a and b are dependent then u must be deadlocked for b (ensuring that if b has been specified sequentially after a then b cannot occur before u has started) and b must be deadlocked for all initial actions of u (implying the dual property, namely that if a is to occur after b then no initial action of u can occur before b). The interesting thing about the current setting is that the operational rules remain correct even in the context of parallel composition with synchronization: interleaving bisimulation is a congruence for action refinement. (Of course, what we have here is not really the standard interleaving setting, since the action dependencies provide additional information just like the event annotations in the event-based semantics of Section 4; however, since here the information is provided globally rather than locally in each individual transitions, it is less visible.) Unfortunately, strict D-compatibility is more restrictive than one would like. For instance, the term t[get -^ u] where t = (put • get)[put -^ put^ IWpnti] and u = get^ \\\ get2 is not well-formed: according to D-compatibility, due to the fact that get2 D puti we must have get D put2\ however, since u - ^ ^ but nevertheless get^ I put2. condition (ii) of strong D-compatibility is violated. A similar violation occurs if we first refine get and then put. In fact, this particular design step can only be understood if we assume both refinements to take place at the same time. Looking back, this is in fact what we silently assumed in the discussion. Thus, rather than considering single-action refinements -[a -^ w], we should allow simultaneous refinements .[^i ^- M 1,...,«,, ^- w„] (with ai ^ aj for / :^ 7), also written in vector notation as-[a -> u]. Strict D-compatibility is extended accordingly. DEFINITION
7.10. t[a-^ u] is said to be strictly D-compatible if for all b e Act
(1) ai I b implies <S(M/) / b;
(2) ai D b implies (i) Uj -^^ and (ii) c D b for all M, —>.
1126
R. Gorrieri, A. Rensink
This indeed holds for t = get;put and the refinement put -> puti\\\put2,get -> get I \\\get2 under consideration; for instance, get D put and indeed for all r(put) —^ (meaning c =puti for / G {1, 2}) we have r(get) - ^ . Well-formedness. To summarize the well-formedness conditions on Lang^^'": • Recursion is required to be D-guarded; • Refinement is required to be strictly D-compatible. 7.1. Behavioural semantics. Strong bisimilarity (Definition 2.6) is once more a congruence; for the proof see [126]. PROPOSITION
7.11. ^ isa congruence over Lang^^'^.
As an example, consider again the buffer discussed at the start of this section, and let putj I getj for i ^ j . Using the operational rules, we can derive for instance (put • get)[put -^ put I \\\put2. get -^ get^ \\\ ^e^] - ^ ^ (1 \\\put2) • (1; get)[put -^ put^ \\\put2.get -> get^ ||| get2] ^ % (1 \\\put2) • (1 \\\get2) • (1; l)lput->put^ \\\put2,get^get^
HU^r,].
This shows that a low-level getj -action can occur directly after the corresponding putj action, without having to wait for other/7wr,-actions to be executed as well; thus, the desired flexibility is achieved. Another issue reported in [126] is the development of a denotational partial-order model for Lang^^^, for the purpose of showing that the above interleaving semantics is compatible with existing interpretations of action refinement. The denotational model is event-based, based on the families of posets model of [117], extended to take partial termination into account. The details are beyond the scope of this section; suffice it to say that one can define an isomorphism over the denotational model that is a congruence for Lang^^^^ and strictly stronger than ^ , and moreover, there is a straightforward transformation from the denotational model into labelled transition systems (including vf,-transitions). The fact that in the presence of action dependencies, the interleaving paradigm is strong enough to give rise to a compositional model for action refinement was discussed separately in [70].
7.4. Application: A simple data base Once more consider the data base example of Section 2.5 (which does not include the copyoperation of Section 4.6). The 2-state version of this data base was specified by Data\ :— State \ where for / = 1, 2 Statei := ^ry,; Statei -\- upd\; State \ + updy, State2.
Action refinement Datal
, O upd^
Data]
1127 qry2{
1 cnf //\
mi
Fig. 10. Refinement oi Data~^ using action dependencies: qry^ D reqj but ^rv, / cnf.
We then refined upd^ into r^^,; cnf for / = 1, 2, where r^^, is a request to change the state to / and cnf is the confirmation that this has been done. In the standard setting of Section 2.5 this automatically implies that qry is disabled in between reqi and cnf (see Figure 2). If one wants to allow qry also at that point (because the change to the state has already been made, so it is safe to read it), this can be achieved using action dependencies by specifying qry^ I cnf for / = 1,2 (and all other actions mutually dependent), and setting r = {upd^ -^ req^ • cnf, upd2 -> req2 • cnf) as before. Note that r is strongly Z)-consistent: we have qryi D updj for all /, 7, and indeed (i) r(updj) -/-> and (ii) qry I D GJ for all r{updj) —^ (namely, GJ = reqj). The behaviour of the system Data^ and its refinement Data] := Data^lr] is depicted in Figure 10. It should be noted that the previous solution, which did not allow the overlap, can still be derived if we set qryj D cnf instead.
7.5. The dual view: Localities Another way to integrate the concept of action dependencies into process algebra is by taking the dual view of localities. In the context of action refinement, this was worked out by Huhn in [89,90]. We briefly recapitulate the main points of this approach. The basic assumption is that a system is described by the parallel composition of a finite, indexed set of sequential sub-systems, such that all actions performed by any given sub-system are mutually dependent, and this is the only possible source of dependencies. Actions are refined locally at each sequential sub-system, possibly differently at each location; refinement has to preserve and reflect the locality of actions. More precisely, one considers a finite set of locations Loc and a mapping I: Act -> 2^^' defining at what localities an action may occur; then a D b for a,b e Act if and only if i{a) n i{b) y^0.Lti us denote Acti = {a e Act \ I e i(a)} for the alphabet of location /. Overall system behaviour is specified by terms of the form O/ez^^r^/. denoting the parallel composition of sequential processes f/, where S{ti) c Acti for all / e Loc, with implicit synchronization over all common actions. The semantics of such a parallel composition is given by an ordinary labelled transition system. Action refinement is interpreted in this context by a family of images for a given abstract action, namely one for each location that partakes in the action. Thus, in general, an action is mapped simultaneously to a different concrete process at each location. Operationally,
1128
R. Gorrieri, A. Rensink
therefore, the effect of a global action refinement is captured by the local action refinements, which in turn are refinements of a sequential system and hence analogous to the treatment in Section 2. In particular, at each location / e i{a), the essential rule for the behaviour of a refined system is given by ti - ^ t[ ui - A u\ ti[a -^ ui] —> u\\ tjla -^ u/] where the subscript / indicates that we are dealing with the process at location /. There are some restrictions in [90] on the allowable (families of) refinement functions, which are closely related to the preservation of (in)dependencies imposed in the previous subsection. • Only the locations / e l{a) may refine a, and S{ui) c Acti for all / G Loc. This imphes that refinement is D-compatible (Definition 7.1). • None of the local refinements may map onto a terminated process. This goes somewhat in the direction of strict D-compatibility: If a D b then a and b share a location, say /; since ri(a) -^^ for all such shared /, it follows that b cannot "overtake" r{a). Refinement on the system level is interpreted by distribution to the local level: that is, one may specify a global refinement -[a -> u] where w is a vector of local images w/; {Y\iti)[a -^ u] is then defined to correspond to lliitiia -^ w/]). If we use Lang^^^ to denote the resulting locality-based language, then the following result is an immediate consequence of the format of the operational rules: PROPOSITION
7.12. -- is a congruence over Lang loc
Furthermore, the fact that action refinement is essentially performed on local, sequential systems imphes that action refinement and action substitution coincide (see Section 6.2): THEOREM
7.13. t--flat{t) for any t e Lang loc
The motivating example of this section can be dealt with by considering Loc = {1,2}, i.e., a system with two locahties, and assuming i(put) = i(get) = {1,2}. The specification is then given by put; get \\\put; get (one sequential term for each location), and the local refinements by put -> put; and get -^ geti for / = 1, 2. Refinement then yields (put; get)[put ^ put^][get -^ get^] \\\ (put; get)lput-> put2][get-^ get2] which is equivalent to the desired solution, puty; get\ Wlputi; ^^^.
8. Vertical implementation Finally, we present a different, more radical solution to the lack of flexibility of the action refinement operator that we noted in the previous section. The presentation is based on
Action refinement
1129
[119,123]. It consists of re-interpreting action refinement so that it does not take the form of an operator (effectively a function .[a -> u] .Lang -> Lang for all u) but rather of a relation <^'~^" c LangA^^^ x Lang^^^^ where Lang-^^^^ is the flat fragment of Lang (see Section 4), i.e., without the refinement operator. (See also Table 16 for a complete overview of the different languages used in this chapter.) That is, if a system is abstractly specified by a term t\, and a design step is taken that maps an abstract action <3 to a term w, the result is not uniquely determined but instead can be any term ti satisfying the requirement
^^"^" is called a vertical implementation relation, in analogy with the usual implementation relations (i.e., pre-orders) such as trace or failure inclusion (see, e.g., [27,43]). This notion is interesting especially if we consider simultaneous refinements (see also Section 7.3); thus, actually we will consider indexed relations of the form ^""^"c Lang^^'^ x Lang^^^' where a -> M is a finite list of refinement mappings. In this section, we will often denote such vectors by r, and occasionally interpret r as a function r.Act -^ Lang-^^'^ that maps all ai onto M, and is the identity everywhere else. For instance, consider again the small buffer example used as motivation in the previous section. We started with a specification put; get and a (simultaneous) refinement given by r =put -> put I \\\put2y get -^ get^ \\\ gety, by fixing a dependency relation, we arrived at a uniquely determined implementation. Using the concept of vertical implementation, on the other hand, there could be a number of correct implementations; for instance put\get ^' (put^\\\put2yAget^ \\\get2). put; get ^' iput^; get^ IWputj); g^^' put; get ^' put^;get^ IWputj: get2. A major advantage of this approach is that we can stay in the realm of interleaving semantics, just as in the case of dependency-based refinement. This is due to the fact that the congruence question simply disappears once we have abandoned the idea of refinement as an operator. For instance, the following design steps all give rise to perfectly valid vertical implementations (compare Section 1.3): a\\\b ^^^-^^i:"2 ai;a2\\\b, a\\\b ^«-^'i:^/2
a\;a2;b-^b;ai;a2,
a;b-\-b;a
^^^^^'1:^/2 a\;a2\\\b,
a;b-\-b;a
^^^-"i-^': a\; a2; b-{-b; a\; ai.
As a consequence, it is possible to formulate a single, unified framework in which the standard concept of implementation (which, in contrast, one might call horizontal) and vertical implementation are integrated. In fact, given that there are many variations on the standard concept of implementation (based, e.g., on traces, testing or bisimulation), one can imagine analogous variations on vertical implementation.
1130
R. Gorrieri, A. Rensink
Below, we propose a specific vertical implementation relation, based on delay bisimulation (see Section 2.4). Another vertical implementation relation, based on weak bisimulation, was worked out in [123,124]; a testing-based relation was proposed in [118]. We then formulate some properties that one would naturally expect a vertical implementation relation to satisfy, inspired by properties of horizontal implementation (e.g., transitivity, monotonicity); we assert that vertical delay bisimulation indeed satisfies these properties.
8.1. Refinement functions Vertical implementation relations are a new area of study, and the results that have been achieved hold only for a restricted class of refinement functions. For the purpose of this section, we therefore impose some strong restrictions on the allowable refinements. See [124] for a more extensive discussion. First of all, we only consider refinement images in a restricted sub-language Lang''^^, generated by the following grammar: J::=a\T;T\J-\-T. (Note that this limits actions to a e Act, disallowing invisible actions.) Furthermore, we impose as a well-formedness condition on Lang''^^ that terms must be distinct, in the following inductively defined sense: • Every action a 6 Act is said to be distinct; • t\;t2 and t\ + /2 are said to be distinct if t\ and /2 are distinct and S(t\) O S{t2) = 0. Furthermore, given a set of actions A c Act, a simultaneous refinement r:Act -^ Lang''^^ (using only well-formed terms as images) is called distinct on A if S{r{a)) C\ S{r(b)) — 0 foxa e A and b e Act \{a}. This has the consequence that, given a ^-transition performed by the r-image of some action a e A, both the action a and the position in r(a) where b occurs are uniquely determined. In the remainder of this section, we will implicitly only consider vertical implementation relations ^^ between pairs t\ and tj such that r is distinct on 5(^1). Note that the image of put -> put^ 111/?"^ is not in Lang^^^ (and neither is the image of get)', hence we cannot treat the motivating example in its current form. Below, we consider the somewhat simpler case of r = (put -> puti; put2 and get -^ geti; g^6); we still expect the following valid vertical implementations. put; get <^ put I; get^; /7W/2; getj, put; get ^' puti; (geti Wlputj); get2. We furthermore use the following refinement function-related concepts: • For every refinement function r, the function Sr :Act -> 1^^^ maps all actions to the alphabet of their r-images; that is, for all a € A Sr'.a\-^
S{r{a)).
Action refinement
1131
This is also extended to sets of actions A c Act:
SriAt^
\JSr(a). aeA
• For every refinement function r and set of actions A, r/A denotes the function that is the identity on A and coincides with r elsewhere; that is, /.
\a ,^ [r{a)
r/A :ah^ \
if aeA, otherwise.
• For all refinement functions r\ and n , ri 4- r2 denotes the function that maps all a e Act to the choice between the r/-images: (r\ •i-r2)'.a\-^
r\(a)^r2{o).
8.2. Vertical delay bisimulation We develop a vertical implementation relation based on a variant of weak bisimulation called delay bisimulation, which we already introduced in Definition 2.11/'' We actually drop the quaUfier "delay" in the remainder of this section, when this does not give rise to confusion. An important extension with respect to the standard notion of bisimulation is that we have to take into account that in any given state of the implementation, there may be associated refined actions whose execution has not yet terminated. These will be collected in a (multi)set of residual {ox pending) refinements and will be used to parameterize the bisimulation. Thus, bisimulations are not binary but ternary relations.^ Furthermore, in contrast to standard bisimulation, the simulation directions from specification to implementation and vice versa are no longer symmetric. To simulate the abstract transitions of the specification by the implementation (with the set of pending refinements as an intermediary), we define the concept of down-simulations the other direction is called an up-simulation. Finally, we also require a residual simulation which captures how the pending refinements are processed by the implementation. Residual sets. A residual set for r will be a multiset of non-terminated proper derivatives of r-images, formally represented by a function R: Lang^"^'' -^ N. We will write t e R if R(t) > 0. To be precise, the collection of residual sets for r is defined as follows: RS(r) = {R:Lang'''^ -^N\Wu
eR: 3a eAct^a eAct^: r(a):=^u
-^
}.
^ Previously (in [123]), we took weak bisimulation as a basis for vertical extension; in doing so, we encountered some problems that we conjectured to be related the fact that weak bisimulation is not a congruence for the refinement operator in the sequential language Lang^^'^' (see Section 2). Since delay bisimulation is the coarsest congruence for refinement contained in weak bisimulation (Proposition 2.12), its vertical extension is smoother than that of weak bisimulation. ^ Other ternary bisimulation-based relations are, for instance, history-presennng bisimulation [62], and symbolic bisimulation [86].
1132
R. Gorrieri, A. Rensink
We use the following constructions over residual sets: 0:M
h^ 0,
[ty.u ^
jl 10
if« = randr / otherwise, Ri{u)^R2(u),
R\^R2:u
h>
RiORi'.u
\-> max{/?i(w)-/?2(«),0}.
The behaviour of a residual set corresponds to the synchronization-free parallel composition of its elements. Formally: R-^R'
:<=:^ 3r G R: 3(r - ^ t'): R' = {Re [r]) 0 [t%
Note that terminated terms do not contribute to the residual set, and a / r. The reason why we can ignore terminated terms is that (due to well-formedness) it is certain that such terms no longer display any operational behaviour (in terms of Section 2, termination is final). Notation for ternary relations. In the following, we will often work with ternary relations of the form p c. N x N x RS(r). We use the notation n \ p^ni to abbreviate {n\,n2, R) ^ P\ in other words, p^ is interpreted as the binary relation {{n\,n2)\(n\,n2, R) ^ p). DEHNITION 8.1. Let T be a labelled transition system. A strict down-simulation up to r over T is a ternary relation pc.NxNx RS(r) such that for all n \ p^n2. if «i - ^ n\ then one of the following holds: (1) a = T and n^^p^n2', (2) a e {r, / } a n d 3 ( « 2 = ^ - ^ n^) such that «',/O'^AI'^; (3) a e Act and V(r(a) -^ uy. 3(n2=>-^ n2) such thai n'^p^^'^n^.
Note that down-simulation only imposes conditions on triples (n\,n2, R) where /? = 0, i.e., there are no pending refinements. For such triples, apart for the simulation of internal and termination transitions (which are standard for delay bisimulation), it is required that any action a of the specification («1) is refined into a term r(a) of which all initial actions are simulated by the implementation (^2), such that the successors of n \ and M2 are again related, with the successor ofr(a) pending. The reason for the additive "strict" will become clear later this section. DEHNITION 8.2. Let T be a labelled transition system. An up-simulation up to r over T is a ternary relation p ^ N x N x RS(r) such that for all n \p^n2. if ni -^ fA then one of the following holds: (1) y = T andn\p^n'^\ (2) y G {r, / } and 3(^1 = > ^ n\) such that «',p^//-,; (3) 3a e Act: 3{n\ =^ -^ n\) and3{r{a) -^ u') mchihain'^p^^^'^'hi'^; (4) 3{n\ ^n\) and 3 ( / ? - ^ R') such that w'p'^'/?;.
Action refinement
1133
Thus, if the implementation's move y is not an internal or termination transition, either it corresponds to the initial concrete action of a refined abstract action a (in which case, since r is distinct, a is uniquely determined), or it is an action of a residual refinement (which again is uniquely determined), in which case the specification is allowed to move silently. Note that these two cases (Clauses (3) and (4) in the definition) are mutually exclusive, again due to the distinctness of r. 8.3. Let T be a labelled transition system. A strict residual simulation over T is a ternary relation pQN x N x RS{r) such that for all /? 7^ 0, linxp^ni then V(/? - ^ DEFINITION
This specifies that any move of a pending refinement has to be (delay-)simulated by the implementation, while the specification remains as it is. This implies that pending refinements can be "worked off" in any possible order, or indeed in parallel, by the implementation. This property can be construed as an operational formulation of non-interruptability: that which is started can always be finished (see also Section 3). The combination of downsimulation, up-simulation and residual simulation gives rise to vertical bisimulation. 8.4. Let T be a labelled transition system. • A strict vertical bisimulation up to r over T is a ternary relation p ^ N x N x RS(r) that is both a strict down-simulation up to r, an up-simulation up to r and a strict residual simulation. • Strict vertical bisimilarity up to r over T, denoted ;:
DEHNITION
The subscript "V" is related to the adjective "strict" and the V-quantifiers in the definitions of strict down- and residual simulation; see also below. The following is an example of an actual strict vertical bisimulation. EXAMPLE 8.5. Letr:a\-^a\;a2. The following figure shows strict vertical bisimulations proving a\b <^a\\a2\b and a\b <^a\\{a2 IIIb), where the dotted lines connect related states and their labelling is the residual set indexing the relation:
ai:{«2P)
1134
R. Gorrieri, A. Rensink
However, this does not yet quite allow the design step we used in our (modified) motivating example: that is, put^; (get^ \\\put2); geti is not a vertical implementation of put; get. The reason is that the sequence put^\{getx \\\put2)\ get2 - ^ (get^ lll/?w^); get2 - ^
(1 lllpwr^); get2
of the implementation cannot be strictly bisimulated: the only possibility would be put; get - ^ get -^
1
with residual sets /?o = 0 (initially), R\ = \put2] (after the first step) and Ri = \put2\ 0 [get2\ (after the second step). Since Ri ^ ^ , strict residual simulation requires that the implementation can do get2 already, which is not the case. To improve on this, we formulate a second, weaker notion of down-simulation and residual simulation, which state that not all transitions of a refinement image, respectively all transitions of the residual have to be simulated, but rather at least one. DEFINITION 8.6. Let T be a labelled transition system and assume p ^N
x N x RSir). • p is a lax down-simulation up to r if for all n \ p^n2 and n \ - ^ n\, one of the following holds: (1) Of = r Sindn\p^n2; (2) a 6 {r, / } and 3(^2 = ^ - ^ ^2) such thatnjp'^«2; (3) a e Act Sind 3(r(a)-^u'y. 3(n2=^-^ n2) suchih2iin\ p^'^'^n2• pissilaxresidualsimulationifforaW R ^^,if n\p^n2ihen3(R -^ R'): 3(^2=^—> ^2) such that «ip^ ^2• p is a lax vertical bisimulation up to r if it is both a lax down-simulation up to r, an up-simulation up to r and a lax residual simulation. • Lax vertical bisimilarity up to r, denoted ;:
Note that the V-quantifiers in Definitions 8.1 and 8.3 have been turned into 3; this is precisely what makes ^g weaker than <'^. Now we indeed have put; get <^^ puti; (geti \\\put2); get2 (where r = (put -^ put^; put2. get -> get^; get2) as before); witness Figure 11. Due to the nature of our refinement functions, which are distinct and therefore cannot deadlock, the lax relation is indeed (strictly) weaker than the strong one. PROPOSITION
8.7. For all distinct r,
8.3. Requirements for vertical implementation Apart from our one motivating example, one would like to have objective criteria to decide between the strict and lax versions of vertical bisimulation; and indeed to know whether these relations can be made part of a larger framework for design, as discussed at the start
Action
1135
refinement put^\{put2 \\\get]^)\get2
Fig. 11. A lax vertical bisimulation.
Table 15 Proof rules for vertical implementation / c'^^ u _= R^
— R, R 1
P
~ ~ ~ R« t\\t2^'' ux\U2 '^"^
tdt' -=
t
-=z
P
~ RQ r/AC'-/^ w/5,-(/\) "^ L'l; i'->
a;/E''Mi;(M2llli^)
=—Ri
"
a\t\z'-
t c'l u
ux:iii2\\\v
of this section. To answer these questions, we formulate a set of general proof rules for vertical implementation, and investigate to what degree either version of vertical bisimulation satisfies them. The rules are collected in Table 15. Note that they feature a generic relation symbol c ' standing for any vertical implementation relation, and a generic symbol c standing for a horizontal implementation relation. In this context, ^ is called the basis of c'^, and c ' a vertical extension of c . We briefly discuss the rules. • The first group of rules (R1-R3) expresses our basic assumption of working modulo the horizontal implementation relation. R1 states that every term implements itself as long as no refinement takes place; R2 says that c'^^ (where id is the identity refinement, mapping each action to itself) is compatible with the horizontal implementation relation; while R2 explains the interplay between horizontal and vertical implementation. Note that, as a consequence, we also have the derived rule t CM t C'^ u
1136
R. Gorrieri, A. Rensink
that, in conjunction with R2, ensures that c and c'^ are indeed the same relation. Note also that Ri and R2 imply that c is reflexive, whereas R1-R3 together imply that E is transitive; hence c is a pre-order, which indeed is the standard requirement for horizontal implementation relations. • The second group of rules (R4-R10) essentially express congruence of vertical implementation with respect to the operators of Lang^^^^. For instance, if the refinement functions in these rules are set to id, then the properties expressed by the rules collapse to the standard pre-congruence properties of ^ for the operators of Lang^^^^. (In other words, the horizontal implementation relation c needs to be a pre-congruence, at least.) Rules R4 and R5 simply express that deadlock and termination are independent of the abstraction level. R6 is the core of the relationship between the refinement function r and the vertical implementation relation: it expresses the basic expectation that r{a) should be an implementation for a. R7-R10 are quite obvious, as they inductively go into the structure of the components. Note that in Rio, the synchronization set A of the specification is refined in the implementation. Rule R9 is similar, with the proviso that the refinement images of the actions that are hidden is set to the identity. An interesting special case of R9 is given by the following derived rule: tO-u
A=
{a\r{a)i^a}
Hence, by hiding all the actions that are properly refined, the vertical implementation is turned back into a horizontal implementation relation. • The last group of rules (R11-R13) describes design steps that are different from the ones using the congruence-like rules of the previous group. In fact, these rules capture the gain over the traditional refinement operator: Rn and R12 allow certain parts of refinement images to overlap in the implementation, even if the specification imposes an ordering between the corresponding abstract actions, whereas R13 allows refinements to be implemented partially. It seems natural to require that a vertical implementation relation satisfies at least rules Ri-Rio, and as many of the other rules as possible. In [124], we proved that this is the case for rooted vertical weak bisimulation; the proof carries over to rooted strict vertical bisimulation (:
8.8. ^y satisfies the rules in Table 15 except R12 and R13.
Unfortunately, lax vertical bisimilarity (Definition 8.6) does not satisfy the parallel composition rule. EXAMPLE 8.9. Consider r :a \-^ a\ + ai. \ti t = a and M/ = ai for / = 1, 2. We have t <^:^u\ andr ^^ M2; however,^! 11^,.^. ^2 —d 0 and hence/ \\at 2:^d « 2^g 0—d "1 Il5r(«)"2.
The reason lies in the existential nature of the lax down-simulations (and also of the lax residual simulations, although the above example does not show that): the implementations
Action refinement
1137
of the parallel components both have to have some matching transition, but they need not be the same. However, this is the only proof rule that is problematic, and then only for synchronization actions. 8.10. :
t{^'
u\
tiQ' U2 r/A = id
t\ \\At2 Q' u\ WAUI
The situation is not yet very satisfactory: for lax vertical implementation, the failure of Rio is a grave disadvantage, since synchronization is the basic interaction mechanism between system components: if one cannot synchronize on an action after its refinement, the formaUsm is not very useful. On the other hand, strong vertical implementation does not allow some design steps that seem intuitively reasonable and attractive - such as the one of our motivating example. The situation is alleviated, however, by the fact that strong and lax refinement can be combined so as to merge the advantages of both to a large degree. Namely, it is possible to implement one operand of a synchronization using the lax vertical bisimulation, and the other using the strong version; the resulting implementation will still be a vertical implementation, in the lax version. Formally: THEOREM U \\At2<3U\
8.11. Z^r A
C
Acr and assume r/A = id. If t\ <'^ u\ and ti <'^ "2, then
||5,(A)W2.
EXAMPLE 8.12. To see the possible interplay between strict and lax vertical implementation, consider a booking agent, whose function on an abstract level consists of a continuous series of book actions, and two customers that concurrently invoke this action. Algebraic specifications are given by
Agent^ := book; Agent^, Userss := book\\\book. Now consider a refinement r : book \-^ req\ (yes + no), specifying that a booking consists of a request, which may be granted {yes) or refused (no). A possible implementation that is lax for the agent and strict for the users is given by Agentj = req\ (yes \\\ req): Empty. Empty = (no\\\ req); Empty, Users/ = req; (yes + no) \\\ req; (yes -\- no). The agent will receive the request of a second customer in parallel with the reply to the first, but replies yes to the first one only. The customers take either yes or no for an answer. We have Agents <'^ Agentj and Userss :
1138
R. Gorrieri, A. Rensink
Informally, the reason why this works is that every (down- or residual) simulated transition that exists on the lax side exists on the strict side as well; hence they can be combined into a simulated transition of the synchronized behaviour. We arrive at the following schema regarding the synchronization of vertical implementations: • Strict with strict yields strict; • Strict with lax yields lax; • Lax with lax does not yield a valid implementation.
8.4. Further developments We briefly review two issues regarding vertical implementation, worked out in [124] for the strict case, that have been omitted from the presentation above. Open terms and recursion. Table 15 contains no proof rule for recursion. Thus, for instance, we cannot prove the relation Agent^ <'^ Agenti in Example 8.12 algebraically. Intuitively, a proof rule would take the form
lix.t Q^ jix.u However, here t and u are (in general) open terms; we have not discussed how to interpret vertical bisimulation over such. In fact, the most natural definition, which says that t C' u iff all closed instances of t and u are related, is not satisfactory: for then the relation x^^ X would be inconsistent except for r — id. In fact, in t^'u, the occurrences of x in t (on the abstract side) should be interpreted differently from the occurrences of x in u (the concrete side). The solution developed for this in [124] (which we will not go into here) consists of adding an environment to the proof rules which records precisely these differences in interpretation. The above proof rule for recursion, extended appropriately with such environments, is sound for strict and lax vertical bisimilarity, provided we restrict ourselves to strongly guarded terms (meaning that any occurrence of the recursion variable in the body of a recursive term is guarded by a visible action). Action substitution. When the rules in Table 15 are extended with a rule for recursion as discussed above, it can be seen that (simultaneous) action substitution in the line of Section 6 will automatically give rise to a correct implementation (with respect to any vertical implementation relation that satisfies all these rules). More precisely: let t[u/a} denote the simultaneous substitution of all «,-occurrences in r by w,, defined through a straightforward generalization of Table 11. Then for any vertical implementation relation ^a-^u ^^^ ^^y ^^j.^ ^ ^ Lang^^'\ we have t ^^-"" t{ll/a}. This provides a link to the interpretation of action refinement as an operator, since in Section 6 we have seen that this operator can in many cases also be mimicked by action substitution.
Action refinement
1139
Table 16 Overview of language fragments and well-formedness conditions Language Section 0 0^ 1
Lang 4
seq 2
atom 3
E\t 4
ST 5.4
D, lin 7.1
/
/
/
/
/
/
he flat 8 7.5
/
/
/
/
ref 8
/ 1)
a
/
/
/
/
/
/
/
/
/
/
/ /
ea 1)
/
a V+V
/
/
/
/^>
/
T;V TT
/
/
/
/^>
/
TIUT T|||T
/
/
/
/
/-^>
/-^>
/
/
/^>
/
/
/^>
/
/
/
/
/
/^> /
/-'>
/
nf (V) *T
D.bra 7.3
/ / /
1)
1/A l[a -> V] l[a ^ V, ? ^ T]
/
/
/
/6)
/6)
/6,
/-^>
/
/
/ /3)7)
/2'
/ / 3)8)
l{a ^ V] l[a -> V]
/ /
X
/
/
.[T] ^ixN
/
/
/
/
/
/
/^'
/ 3 ) 11)
/
/
/ /
eX
9)
/ 10)
/ 10)
/
/
Well-formedness conditions (conditions in the left hand column apply to all languages): '^auxiliary operator; may not occur in virgin operands (V in the grammar): -^event annotations are compatible; -^^ operands are not virgin (i.e., may contain auxiliary operators); '^^terms are distinct (Section 8.1); '^^either operand is abstract (Section 3.1); ^in Section 6, both operands are closed terms; ^^ refinement is D-compatible (Definition 7.1); ^^ refinement is strictly D-compatible (Definition 7.10); '^' A is guarded in V (Definition 2.1); in Section 6, /iJc.V is well-sorted; '^^not allowed in the fragments Lang^" and Lang'^^'^f-^": ' " A is D-guarded in V (Definition 7.8).
1140
R. Gorrieri, A. Rensink
8.5. Application: A simple data base Let us consider once more the data base example of Section 2.5 (not including the copy operation considered in Section 4.6). We will show that, under lax vertical refinement, the n-state version of the data base, Data'^, is an implementation of the state-less (or 1-state) version, Data^^. The specifications are Data^ := (qry -h upd); Data\, Data'l := State], StatCi :— qry I; Statei -\- V^ updj^; StatCk (for / = 1 , . . . , AZ). ^=1
Let r map qry to Xl/=i ^rV/ ^^^ "W to Xl/Li "W/ ^ then it follows that Data\ ^^ Data"^. In fact, this implementation relation can be proved algebraically, using the rules of Table 15 extended to cope with recursion as in [124] (briefly discussed above). The main point is that (in lax refinement) qry <^^ qryi for arbitrary /, i.e., it is not necessary to implement all ^ry-^ctions whenever qry is specified on the abstract level. If we also consider a user of the data base who actually queries it, this can be modelled by a process Users synchronizing with Data^^ over qry. Since Data"^ is a lax vertical implementation of Data^^, in order to refine the interaction with the user, we have to implement Users in the strong sense, meaning that whenever Users specifies a query, this must be implemented as the choice between all possible ^r>'/-actions. In fact, this is a reasonable requirement: since the user does not know the state of the data base at the moment he issues the query, he must accept all possible answers. In a sense, the above example is not a case of proper action refinement, since all rimages terminate after a single action. Alternatively, also the refined «-state database can be derived as an implementation of Datay For instance, for the case where n —2, both the implementation Data~j'^^^ obtained in Section 2.5 (see Figure 2) and DataJ obtained in Section 7.4 (see Figure 10) are valid lax implementations of Data\ under the refinement r
qry2 Fig. 12. Lax vertical implementation of a state-less as a 2-state data base, while refining upd.
Action refinement
1141
defined by upd h^ (req^ -\- req2)\ cnf, qry h^ qry^ -^ qryiFor instance, Figure 12 shows the lax vertical bisimulation proving Data\ :
Acknowledgements We wish to thank Mario Bravetti, Pierpaolo Degano, Thomas Firley, Walter Vogler and Heike Wehrheim for their comments on preliminary versions of this chapter.
References [1] L. Aceto, Full abstraction for series-parallel pomsets, TAPSOFT '91, Vol. 1, Lecture Notes in Comput. Sci. 493, S. Abramsky and T.S.E. Maibaum, eds. Springer-Verlag (1991), 1-25. [2] L. Aceto, Action refinement in process algebras, Ph.D. Thesis, University of Sussex, Cambridge University Press (1992). [3] L. Aceto, History-preserving, causal and mixed-ordering equivalence over stable event structures, Fundamenta Informaticae 17 (4) (1992), 319-331. [4] L. Aceto, B. Bloom and F.W. Vaandrager, Turning SOS rules into equations. Inform, and Comput. I l l (1) (1994), 1-52. [5] L. Aceto and U. Engberg, Failures semantics for a simple process language with refinement. Foundations of Software Technology and Theoretical Computer Science, S. Biswas and K.V. Nori, eds. Lecture Notes in Comput. Sci. 590, Springer-Veriag (1991), 89-108. [6] L. Aceto, W. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [7] L. Aceto and M.C.B. Hennessy, Termination, deadlock, and divergence, J. ACM 39 (1) (1992), 147-187. [8] L. Aceto and M.C.B. Hennessy, Towards action-refinement in process algebras. Inform, and Comput. 103 (1993), 204-269. [9] L. Aceto and M.C.B. Hennessy, Adding action refinement to afiniteprocess algebra. Inform, and Comput. 115(1994), 179-247. [10] R.J.R. Back, A method for refining atomicity in parallel algorithms, PARLE '89, Vol. I: Parallel Architectures, Lecture Notes in Comput. Sci. 366, E. Odijk, M. Rem and J.-C. Syre, eds. Springer-Veriag (1989), 199-216. [11] J.C.M. Baeten and W.P Weijland, Process Algebra, Cambridge University Press (1990). [12] J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, Springer-Veriag (1989). [13] J.W. de Bakker and E.P de Vink, Bisimulation semantics for concurrency with atomicity and action refinement, Fundamenta Informaticae 20 (1994), 3-34. [14] H.P Barendregt, The Lambda Calculus, 2nd edn.. Studies in Logic and the Foundations of Math. 103, North-Holland, Amsterdam (1984). [15] T. Basten, Branching bisimilarity is an equivalence indeedl. Inform. Process. Lett. 58 (1998), 141-147. [16] J.A. Bergstra and J.W. Klop, Process algebra for synchronous communication. Inform, and Control 60 (1984), 109-137. [17] E. Best, R. Devillers and J. Esparza, General refinement and recursion operators for the Petri box calculus, STACS-93, Lecture Notes in Comput. Sci. 665, P Enjalbert, A. Finkel and K.W. Wagner, eds, SpringerVerlag(1993), 130-140.
1142
R. Gorrieri, A. Rensink
[18] B. Bloom, S. Istrail and A.R. Meyer, Bisimulation cant be traced, J. ACM 42 (1) (1995), 232-268. [19] G. Boudol, Atomic actions. Bull. Eur. Ass. Theoret. Comput. Sci. 38 (1989), 136-144. [20] G. Boudol and I. Castellani, On the semantics of concurrency: Partial orders and transition systems, TAPSOFT '87, Vol. 1, Lecture Notes in Comput. Sci. 249, H. Ehrig, R. Kowalski, G. Levi and U. Montanari, eds. Springer-Verlag (1987), 123-137. [21] G. Boudol and I. Castellani, Flow models of distributed computations: Three equivalent semantics for CCS, Inform, and Comput. 114 (2) (1994), 247-314. [22] W. Brauer, R. Gold and W. Vogler, A suney of behaviour and equivalence preserving refinements of Petri nets. Advances in Petri Nets 1990, Lecture Notes in Comput. Sci. 483, G. Rozenberg, ed.. Springer-Verlag (1990), 1-46. [23] M. Bravetti, M. Bernardo and R. Gorrieri, Towards performance evaluation with general distributions in process algebras. Concur '98: Concurrency Theory, Lecture Notes in Comput. Sci. 1466, D. Sangiorgi and R. De Simone, eds. Springer-Verlag (1998), 405^22. [24] M. Bravetti and R. Gorrieri, Deciding and axiomatizing ST bisimulation for a process algebra with recursion and action refinement. Technical Report UBLCS-99-1, Department of Computer Science, University of Bologna (February 1999). [25] M. Bravetti and R. Gorrieri, Interactive generalized semi-Markov processes, Proc. of the 7th Int. Workshop on Process Algebras and Performance Modeling, J. Hillston and M. Silva, eds, Prensas Universitarias de Zaragoza (1999), 83-98. Url: http://www.es.unibo.itrbravetti/papers/papm99.ps. [26] E. Brinksma, B. Jonsson and F. Orava, Refining interfaces of communicating systems, TAPSOFT '91, Vol. 2, Lecture Notes in Comput. Sci. 494, S. Abramsky and T.S.E. Maibaum, eds. Springer-Verlag (1991), 297-312. [27] S.D. Brookes, C.A.R. Hoare and A.W. Roscoe, A theory of communicating sequential processes, J. ACM 31 (3) (1984), 560-599. [28] M. Broy, (Inter-)action refinement: The easy way. Program Design Calculi, NATO ASI Series F: Computer and System Sci. 118, M. Broy, ed. (1993), 121-158. [29] M. Broy, Compositional refinement of interactive systems, J. ACM 44 (6) (1997), 850-891. [30] N. Busi, Raffinamento di azioni in linguaggi concorrenti. Master's Thesis, Universita degli Studi di Bologna (1992). In Italian. [31] N. Busi, R.J. van Glabbeek and R. Gorrieri, Axiomatising ST bisimulation equivalence. Programming Concepts, Methods and Calculi, IFIP Trans. A-56, E.-R. Olderog, ed., IRP (1994), 169-188. [32] L. Castellano, G. De Michelis and L. Pomello, Concurrency vs. interleaving: An instructive example. Bull. Eur. Ass. Theoret. Comput. Sci. 31 (1987), 12-15. Note. [33] F. Cherief, Contribution a la semantique du parallelisme: Bisimulations pour le raffinement et le vrai parallelisme, Ph.D. Thesis, University of Grenoble (1992). In French. [34] F. Cherief and P. Schnoebelen, x-bisimulation and full abstraction for refinement of actions. Inform. Process. Lett. 40 (1991), 219-222. [35] W.R. Cleaveland, ed.. Concur '92, Lecture Notes in Comput. Sci. 630, Springer-Verlag (1992). [36] R. Costantini, Abstraktion in ereignisbasierten Modellen verteilter Systeme, Ph.D. Thesis, University of Hildesheim (1995). In German. [37] J.P. Courtiat and D.E. Saidouni, Relating maximality-based semantics to action refinement in process algebras. Formal Description Techniques VII, IFIP WG 6.1, D. Hogrefe and S. Leue, eds, Chapman-Hall (1994), 293-308. [38] I. Czaja, R.J. van Glabbeek and U. Goltz, Interleaving semantics and action refinement with atomic choice. Advances in Petri Nets 1992, Lecture Notes in Comput. Sci. 609, G. Rozenberg, ed.. Springer-Verlag (1992), 89-109. [39] P. Darondeau and P. Degano, Causal trees. Automata, Languages and Programming, Lecture Notes in Comput. Sci. 372, G. Ausiello, M. Dezani-Ciancaglini and S. Ronchi Delia Rocca, eds. Springer-Verlag (1989), 234-248. [40] P. Darondeau and P. Degano, Causal trees = interleaving -\- causality. Semantics of Systems of Concurrent Processes, Lecture Notes in Comput. Sci. 469,1. Guessarian, ed.. Springer-Verlag (1990), 239-255. [41] P. Darondeau and P. Degano, About semantic action refinement, Fundamenta Informaticae XIV (1991), 221-234.
Action refinement
1143
[42] P. Darondeau and P. Degano, Refinement of actions in event structures and causal trees, Theoret. Comput. Sci. 118(1993), 2 1 ^ 8 . [43] R. De Nicola and M.C.B. Hennessy, Testing equivalences for processes, Theoret. Comput. Sci. 34 (1984), 83-133. [44] R. De Simone, Higher-level synchronizing devices in Meije-SCCS, Theoret. Comput. Sci. 37 (1985), 245267. [45] P. Degano, R. De Nicola and U. Montanari, On the consistency of 'truly concurrent' operational and denotational semantics. Third Annual Symposium on Logic in Computer Science, IEEE, Computer Society Press (1988), 133-141. [46] P. Degano, R. De Nicola and U. Montanari, Partial orderings descriptions and obserx'ations ofnondeterministic concurrent processes. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Springer-Verlag (1989), 438-466. [47] P. Degano, R. De Nicola and U. Montanari, A partial ordering semantics for CCS, Theoret. Comput. Sci. 75(1990,223-262. [48] P. Degano and R. Gorrieri, Atomic refinement for process description languages. Mathematical Foundations of Computer Science 1991, Lecture Notes in Comput. Sci. 520, A. Tarlecki, ed.. Springer-Verlag (1991), 121-130. Extended abstract; full version: Technical Report 17-91, Hewlett-Packard Pisa Science Center. [49] P. Degano and R. Gorrieri, An operational definition of action refinement. Technical Report TR-28/92, Universita di Pisa (1992). [50] P. Degano and R. Gorrieri, A causal operational semantics of action refinement. Inform, and Comput. 122 (1995), 97-119. [51] P. Degano, R. Gorrieri and G. Rosolini, A categorical view of process refinement. Semantics: Foundations and Applications, Lecture Notes in Comput. Sci. 666, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Springer-Verlag (1992), 138-153. [52] R. Devillers, Maximality preserving bisimulation, Theoret. Comput. Sci. 102 (1992), 165-183. [53] J.V Echagiie Zappettini, Semantique des systemes reactifs: Raffinement, bisimulations et semantique operationnelle structuree dans les systeemes de transitions asynchrones, Ph.D. Thesis, Institut National Polytechnique de Grenoble (1993). In French. [54] R. Gerth, R. Kuiper and J. Segers, Interface refinement in reactive systems. Concur '92, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed.. Springer-Verlag (1992), 77-93. [55] J.L. Gischer, The equational theory ofpomsets, Theoret. Comput. Sci. 61 (1988), 199-224. [56] R.J. van Glabbeek, Comparative concurrency semantics and refinement of actions, Ph.D. Thesis, Free University of Amsterdam (1990). [57] R.J. van Glabbeek, The refinement theorem for ST-bisimulation semantics. Programming Concepts and Methods, IFIP, North-Holland Publishing Company (1990). [58] R.J. van Glabbeek, The meaning of negative premises in transition system specifications II, Automata, Languages and Programming, Lecture Notes in Comput. Sci. 1099, F. Meyer auf der Heide and B. Monien, eds. Springer-Verlag (1995), 502-513. Full report version: STAN-CS-TN-95-16, Department of Computer Science, Stanford University. [59] R.J. van Glabbeek, The linear time - branching time spectrum. Chapter 1 of this volume. To be checked. [60] R.J. van Glabbeek and U. Goltz, Equivalence notions for concurrent systems and refinement of actions. Mathematical Foundations of Computer Science 1989, Lecture Notes in Comput. Sci. 379, A. Kreczmar and G. Mirkowska, eds. Springer-Verlag (1989), 237-248. Revised and extended in [64]. [61] R.J. van Glabbeek and U. Goltz, A deadlock-sensitive congruence for action refinement, SFB-Bericht 342/23/90 A, Technische Universitat Munchen, Institut fiir Informatik (November 1990). [62] R.J. van Glabbeek and U. Goltz, Equivalences and refinement. Semantics of Systems of Concurrent Processes, Lecture Notes in Comput. Sci. 469, I. Guessarian, ed.. Springer-Veriag (1990), 309-333. Revised and extended in [64]. [63] R.J. van Glabbeek and U. Goltz, Refinement of actions in causality based models. Stepwise Refinement of Distributed Systems - Models, Formalisms, Correctness, Lecture Notes in Comput. Sci. 430, J.W. de Bakker, W.-P de Roever and G. Rozenberg, eds. Springer-Veriag (1990), 267-300. Revised and extended in [64].
1144
R. Gorrieri, A. Rensink
[64] R.J. van Glabbeek and U. Goltz, Refinement of actions and equivalence notions for concurrent systems, Hildesheimer Informatik-Bericht 6/98, University of Hildesheim (1998). To appear in: Acta Informatica. [65] R.J. van Glabbeek and F.W. Vaandrager, Petri Net models for algebraic theories of concurrency, PARLE Parallel Architectures and Languages Europe, Vol. 11: Parallel Languages, Lecture Notes in Comput. Sci. 259, J.W. de Bakker, A.J. Nijman and PC. Treleaven, eds. Springer-Verlag (1987), 224-242. [66] R.J. van Glabbeek and F.W. Vaandrager, The difference be tureen splitting in n and /? + 1, Inform, and Comput. 136 (2) (1997), 109-142. [67] R.J. van Glabbeek and W.P. Weijland, Refinement in branching time semantics, Proc. AM AST Conference, Iowa State University (1989), 197-201. [68] R.J. van Glabbeek and W.P. Weijland, Branching time and abstraction in bisimulation semantics, J. ACM 43 (3) (1996), 555^00. [69] U. Goltz, R. Gorrieri and A. Rensink, Comparing syntactic and semantic action refinement. Inform, and Comput. 125 (2) (1996), 118-143. [70] U. Goltz and H. Wehrheim, Modelling causality via action dependencies in branching time semantics. Inform. Process. Lett. 59 (1996), 179-184. [71] R. Gorrieri, Refinement, atomicity and transactions for process description languages, Ph.D. Thesis, Report no. TD-2/91, Universita di Pisa (1991). [72] R. Gorrieri, A hierarchy of system descriptions via atomic linear refinement, Fundamenta Informaticae 16 (1992), 289-336. [73] R. Gorrieri and C. Laneve, The limit of split^-bisimulations for CCS agents. Mathematical Foundations of Computer Science 1991, Lecture Notes in Comput. Sci. 520, A. Tarlecki, ed.. Springer-Verlag (1991), 170-180. [74] R. Gorrieri and C. Laneve, Split and ST bisimulation semantics. Inform, and Comput. 116 (1) (1995), 272-288. [75] R. Gorrieri, S. Marchetti and U. Montanari, A~CSS: Atomic actions for CCS, Theoret. Comput. Sci. 72 (1990), 203-223. [76] R. Gorrieri and U. Montanari, Towards hierarchical specification of systems: A proof system for strong prefixing, Intemat. J. Found. Comput. Sci. 11 (3) (1990), 277-293. [77] R. Gorrieri and U. Montanari, On the implementation of concurrent calculi in net calculi: Two case studies, Theoret. Comput. Sci. 141 (1995), 195-252. [78] R. Gorrieri, M. Roccetti and E. Stancampiano, A theory of processes with durational actions, Theoret. Comput. Sci. 140 (1995), 73-94. [79] J. Grabowski, On partial languages, Fundamenta Informaticae IV (2) (1981), 427-498. [80] J.F. Groote, Transition system specifications with negative premises, Theoret. Comput. Sci. 118 (1993), 263-299. [81] J.F. Groote and F.W. Vaandrager, Structured operational semantics and bisimulation as a congruence. Inform, and Comput. 100 (1992), 202-260. [82] I. Guessarian, ed.. Semantics of Systems of Concurrent Processes, Lecture Notes in Comput. Sci. 469, Springer-Verlag (1990). [83] J.I. den Hartog, E.P. de Vink and J.W. de Bakker, Full abstractness of an interleaving semantics for action refinement. Rapport IR-443, Faculteit der Wiskunde en Informatica, Vrije Universiteit Amsterdam (February 1998). [84] M.C.B. Hennessy, Axiomatising finite concurrent processes, SIAM J. Comput. 15 (5) (1988), 997-1017. [85] M.C.B. Hennessy, Concurrent testing of processes. Acta Inform. 32 (6) (1995), 509-543. [86] M.C.B. Hennessy and H. Lin, Symbolic bisimulations, Theoret. Comput. Sci. 138 (2) (1995), 353-389. [87] M.C.B. Hennessy and R. Milner, Algebraic laws for nondeterminism and concurrency, J. ACM 23 (1) (1985), 137-161. [88] C.A.R. Hoare, Communicating Sequential Processes, Prentice-Hall (1985). [89] M. Huhn, Action refinement and property inheritance in systems of sequential agents. Concur '96: Concurrency Theory, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer-Verlag (1996), 639-654. [90] M. Huhn, On the hierarchical design of distributed systems, Ph.D. Thesis, University of Hildesheim (1997).
Action refinement
1145
[91] W. Janssen, M. Poel and J. Zwiers, Action systems and action refinement in the development of parallel systems. Concur '91, Lecture Notes in Comput. Sci. 527, J.C.M. Baeten and J.F. Groote, eds, SpringerVerlag (1991), 298-316. [92] L. Jategaonkar, Observing "true" concurrency, Ph.D. Thesis, Massachusetts Institute of Technology (1993). Available as report MIT/LCS/TR-618. [93] L. Jategaonkar and A.R. Meyer, Testing equivalences for Petri nets with action refinement. Concur '92, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed., Springer-Verlag (1992), 17-31. [94] L. Jategaonkar and A.R. Meyer, Self-synchronization of concurrent processes, Proc. 8th Annual IEEE Symposium on Logic in Computer Science, IEEE, Computer Society Press (1993), 409-417. [95] B. Jonsson, Arithmetic of ordered sets. Ordered Sets, I. Rival, ed., Reidel Pub. Co. (1982), 3 ^ 1 . [96] S. Katz, Refinement with global equivalence proofs in temporal logic, DIM ACS Series in Discrete Math. and Theoret. Comput. Sci. 29 (1997), 59-78. [97] P.M.W. Knijnenburg and J.N. Kok, The semantics of the combination of atomized statements and parallel choice. Formal Aspects of Computing 9 (5/6) (1997), 518-536. [98] L. Lamport, On interprocess communication. Part /: Basic formalisms. Distributed Computing 1 (1986), 77-85. [99] R. Langerak, Transformations and semantics for LOTOS, Ph.D. Thesis, University of Twente (November 1992). [100] R. Langerak, Bundle event structures: A non-interleaving semantics for LOTOS, Formal Description Techniques - V, i n P WG 6.1, M. Diaz and R. Groz, eds, North-Holland Pubhshing Company (1993), 203-218. [101] K.S. Larsen, A fully abstract model for a process algebra with refinements. Master's Thesis, Aarhus University (1988). [102] R. Loogen and U. Goltz, Modelling nondeterministic concurrent processes with event structures, Fundamenta Informaticae XIV (1991), 39-73. [103] A. Mazurkiewicz, Concurrent program schemes and their interpretations, DAIMI Report PB-78, Aarhus University (1977). [104] A. Mazurkiewicz, Basic notions of trace theory. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P de Roever and G. Rozenberg, eds, Springer-Verlag (1989), 285-363. [105] A. Meyer, Obserxing truly concurrent processes. Theoretical Aspects of Computer Software, Lecture Notes in Comput. Sci. 789, M. Hagiya and J.C. Mitchell, eds, Springer-Verlag (April 1994), 886. [106] A. Meyer, Concurrent process equivalences: Some decision problems, STACS-95, Lecture Notes in Comput. Sci. 900, E.W. Mayr and C. Puech, eds, Springer-Verlag (1995), 349. [107] R. Milner, A modal characterisation ofobsen'able machine-behaviour, GAAP '81, Lecture Notes in Comput. Sci. 112, E. Astesiano and C. Bohm, eds, Springer-Verlag (1981). [108] R. Milner, Communication and Concurrency, Prentice-Hall (1989). [109] F. MoUer, Axioms for concurrency, Ph.D. Thesis, University of Edinburgh (1989). Available as report CST-59-89 and ECS-LFCS-89-84. [110] M. Nielsen, U. Engberg and K.S. Larsen, Fully abstract models for a process language with refinement. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P de Roever and G. Rozenberg, eds, Springer-Verlag (1989), 523-549. [ I l l ] A. Obaid and L. Logrippo, An atomic calculus of communicating systems. Protocol Specification, Testing, and Verification, VII, IFIP WG 6.1, H. Rudin and C.H. West, eds, North-Holland Publishing Company (1987). [112] E.-R. Olderog, ed.. Programming Concepts, Methods and Calculi, IFIP Trans. A-56, IFIP (1994). [113] E.-R. Olderog and C.A.R. Hoare, Specification-oriented semantics for communicating processes. Acta Inform. 23(1986), 9-66. [114] G.D. Plotkin, A structural approach to operational semantics. Technical Report DAIMI FN-19, Aarhus University (1981). [115] VR. Pratt, Modeling concurrency with partial orders, Intemat. J. Parallel Programming 15 (1) (1986), 33-71. [116] A. Rabinovich and B.A. Trakhtenbrot, Behaviour structure and nets, Fundamenta Informaticae XI (4) (1988), 357^04.
1146
R. Gorrieri, A. Rensink
[117] A. Rensink, Posetsfor configurations\. Concur '92, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed.. Springer-Verlag (1992), 269-285. [118] A. Rensink, Models and methods for action refinement, Ph.D. Thesis, University of Twente, Enschede, Netheriands (August 1993). [119] A. Rensink, Methodological aspects of action refinement. Programming Concepts, Methods and CalcuH, M P Trans. A-56, E.-R. Olderog, ed., IRP (1994), 227-246. [120] A. Rensink, Causal traces, Hildesheimer Informatik-Bericht 39/95, Institut fiir Informatik, University of Hildesheim (December 1995). [121] A. Rensink, An event-based SOS for a language with refinement. Structures in Concurrency Theory, Workshops in Computing, J. Desel, ed.. Springer-Verlag (1995), 294-309. [122] A. Rensink, Algebra and theory of order-deterministic pomsets, Notre Dame Journal of Formal Logic 37 (2) (1996), 283-320. [123] A. Rensink and R. Gorrieri, Action refinement as an implementation relation, TAPSOFT '97: Theory and Practice of Software Development, Lecture Notes in Comput. Sci. 1214, M. Bidoit and M. Dauchet, eds. Springer-Veriag (1997), 772-786. Revised in [124]. [124] A. Rensink and R. Gorrieri, Vertical bisimulation, Hildesheimer Informatik-Bericht 9/98, University of Hildesheim (June 1998). To appear in: Inform, and Comput. [125] A. Rensink and H. Wehrheim, Weak sequential composition in process algebras. Concur '94: Concurrency Theory, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer-Verlag (1994), 226241. [126] A. Rensink and H. Wehrheim, Dependency-based action refinement. Mathematical Foundations of Computer Science 1997, Lecture Notes in Comput. Sci. 1295,1. Privara and P. Ruzicka, eds. Springer-Verlag (1997), 468^77. Extended report version: CTIT Technical Report 99-02, University of Twente. To appear in: Acta Inform. [127] G. Rozenberg, ed.. Advances in Petri Nets 1992, Lecture Notes in Comput. Sci. 609, Springer-Veriag (1992). [128] D. E. Saidouni, Semantique de maximalite: application au raffinement d'actions dans LOTOS, Ph.D. Thesis, LAAS-CNRS, Toulouse (1996). In French. [129] A. Tarlecki, ed.. Mathematical Foundations of Computer Science 1991, Lecture Notes in Comput. Sci. 520, Springer-Verlag (1991). [130] R. Valette, Analysis of Petri Nets by stepwise refinement, J. Comput. System. Sci. 18 (1979), 3 5 ^ 6 . [131] W. Vogler, Failures semantics based on inten'al semiwords is a congruence for refinement, Distribut. Comput. 4 (1991), 139-162. [132] W. Vogler, Modular Construction and Partial Order Semantics of Petri Nets, Lecture Notes in Comput. Sci. 625, Springer-Verlag (1992). [133] W. Vogler, Bisimulation and action refinement, Theoret. Comput. Sci. 114 (1993), 173-200. [134] W. Vogler, The limit of Split,j-language equivalence. Inform, and Comput. 127 (1) (1996), 41-61. [135] D. J. Walker, Bisimulation and divergence. Inform, and Comput. 85 (1990), 202-241. [136] H. Wehrheim, Parametric action refinement. Programming Concepts, Methods and Calculi, IFIP Trans. A-56, E.-R. Olderog, ed., IRP (1994), 247-266. Full report version: Hildesheimer Informatik-Berichte 18/93, Institut fur Informatik, University of Hildesheim (November 1993). [137] H. Wehrheim, Specifying reactive systems with action dependencies, Ph.D. Thesis, University of Hildesheim (1996). [138] G. Winskel, Synchronization trees, Theoret. Comput. Sci. 34 (1984), 33-82. [139] G. Winskel, Event structures, Petri Nets: Applications and Relationships to Other Models of Concurrency, Lecture Notes in Comput. Sci. 255, W. Brauer, W. Reisig and G. Rozenberg, eds. Springer-Veriag (1987), 325-392. [140] G. Winskel, An introduction to event structures. Linear Time, Branching Time and Partial Order in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds. Springer-Veriag (1989), 364-397. [141] N. Wirth, Program development by stepwise refinement, Comm. ACM 14 (4) (1971), 221-227. [142] J. Zwiers and W. Janssen, Partial order based design of concurrent systems, A Decade of Concurrency, Lecture Notes in Comput. Sci. 803, J.W. de Bakker, W.-P. de Roever and G. Rozenberg, eds, SpringerVerlag (1994), 622-684.
Action refinement
1147
Subject index abstract terms, 1072 action dependency - branching time, 1121-1127 -linear time, 1118-1121 action refinement -atomic, 1051, 1070-1077, 1111, 1119 - D-compatibility, 1119 -dependency-based, 1117-1128 -event-based, 1077-1090 -non-atomic, 1051 -operator, 1050 -relaxed forms, 1056 -semantic, 1052, 1106-1117 -sequential, 1060-1070 -strict D-compatibility, 1125 -syntactic, 1052, 1106-1117 atomizer operator, 1072 bisimilarity -branching, 1069 -causal, 1094 -delay, 1069 --vertical, 1131-1134 -event, 1081 -pomset, 1093 -split, 1096 -strong, 1067 -weak, 1068 congruence, 1067, 1069, 1075, 1083, 1095, 1104, 1126, 1128
-coarsest, 1069 -pre-, 1120 critical sections (example), 1076, 1121 data base (example), 1069, 1089, 1105, 1140 event annotations, 1078 event structures -stable, 1083 event-based semantics, 1077-1090 flattening, 1109 interleaving, 1053 (^-completeness, 1105 sequential composition, 1061 -weak, 1118 syntactic substitution, 1052, 1106-1117, 1138 termination, 1063 -partial, 1122 transition system, 1063 -causal, 1094^1095 -event, 1080, 1092, 1094, 1101 -pomset, 1092-1093 -ST, 1099-1101 true concurrency, 1053 vertical implementation, 1057, 1128-1141
This Page Intentionally Left Blank
Part 6 Tools and Applications
This Page Intentionally Left Blank
CHAPTER 17
Algebraic Process Verification J.F. Groote^ M.A. Reniers^ ' cm, P.O. Box 94079, NL-1090 GB Amsterdam, The Netherlands, Faculty of Mathematics and Computing Science, Eindhoven University of Technology, P.O. Box 513, NL-5600 MB Eindhoven, The Netherlands E-mail: JanFriso. Groote @ cwi. nl " Faculty of Mathematics and Computing Science, Eindhoven University of Technology, P.O. Box 513, NL-5600 MB Eindhoven, The Netherlands CWI, P.O. Box 94079, NL-1090 GB Amsterdam, The Netherlands E-mail: [email protected]
Contents 1. Introduction 2. Process algebra with data: //CRL 2.1. Describing data types in /uCRL 2.2. Describing processes in /xCRL 3. A strategy for verification 3.1. Linear process operators 3.2. Proof principles and elementary lemmata 3.3. The general equality theorem 3.4. Pre-abstraction and idle loops 4. Verification of the Serial Line Interface Protocol 5. Calculating with n-\-\ similar processes 5.1. Introduction 5.2. Linearization of two different parallel processes 5.3. Linearization of parallel processes 6. The Tree Identify Protocol of IEEE 1394 in/iCRL 6.1. Description of the Tree Identify Protocol 6.2. Correctness of the implementation 7. Confluence for process verification 7.1. Introduction 7.2. Confluence and r-inertness 7.3. Confluence of Unear process equations 7.4. State space reduction 7.5. An example: Concatenation of two queues Acknowledgements HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. AU rights reserved 1151
1153 1156 1156 1162 1172 1173 1175 1176 1179 1180 1186 1186 1186 1187 1190 1191 1192 1196 1196 1197 1200 1202 1203 1205
1152 References Subject index
J.F. Groote, MA. Renters 1205 1208
Abstract This chapter addresses the question how to verify distributed and communicating systems in an effective way from an explicit process algebraic standpoint. This means that all calculations are based on the axioms and principles of the process algebras. The first step towards such verifications is to extend process algebra (ACP) with equational data types which adds required expressive power to describe distributed systems. Subsequently, linear process operators, invariants, the cones and foci method, the composition of many similar parallel processes, and the use of confluence are explained, as means to verify increasingly complex systems. As illustration, verifications of the serial line interface protocol (SLIP) and the IEEE 1394 tree identify protocol are included.
Algebraic process verification
1153
1. Introduction The end of the seventies, beginning of the eighties showed the rise of process algebras such as CCS (Calculus of Communicating Systems) [38], CSP (Communicating Sequential Processes) [27], and AC? (Algebra of Communicating Processes) [7,8]. The basic motivation for the introduction of process algebras was the need to describe and study programs that are dynamically interacting with their environment [3,37]. Before this time the mathematical view on programs was that of deterministic input/output transformers: a program starts with some input, runs for a while, and if it terminates, yields the output. Such programs can be characterized by partial functions from the input to the output. This view is quite suitable for simple 'batch processing', but it is clearly inadequate for commonly used programs such as operating systems, control systems or even text editors. These programs are constantly obtaining information from the environment that is subsequently processed and communicated. The development of distributed computing, due to the widespread availability of computer networks and computing equipment, makes that proper means to study interacting systems are needed. Process algebras allow for a rather high level view on interacting systems. They assume that we do not know the true nature of such systems. They just regard all such systems as processes, objects in some mathematical domain. A process is best viewed as some object describing all the potential behaviour a program or system can execute. We only assume that certain (uninterpreted) actions a, b, c , . . . are processes, and that we can combine processes using a few operators, such as the sequential composition operator or the parallel composition operator. A number of axioms restrict these operators, just to guarantee that they satisfy the basic intuitions about them. This basically constitutes a process algebra: a domain of processes, and a set of operators satisfying certain axioms. Unfortunately, axioms are not always sufficient, and more general 'principles' are employed. All these principles, however, adhere to the abstract view on processes. There are many approaches in the literature that, contrary to the process algebra approach, study processes as concrete objects, such as failure traces [43], traces decorated with actions that cannot be executed at certain moments, Mazurkiewicz traces [36], which contain an explicit indication of parallelism, event structures [52], Petri nets [31,45], objects in metric spaces [11], etc. etc. A partial overview of process models is given in [49,50]. A very useful perspective, which we employ for illustrations, is the view of a process as an automaton of which the transitions are labelled with actions. Each traversal through the automaton is a run of the process. This view allows one to compactly depict the operational behaviour of a process. In this chapter, we want to increase our understanding of processes by manipulating them, proving their properties, or proving that certain processes have the same behaviour. We stress again that we do this strictly from the abstract process algebraic perspective. This means that all our calculations in this chapter are based on the axioms and principles. There are two major difficulties one runs into if one tries to do process algebraic verifications in this way, applied to more than just trivial examples, namely restricted expressivity and lack of effective proof methodologies. The basic reason for the expressivity problem is that basic process algebras cannot explicitly deal with data. Often this problem is circumvented by annotating data in the sub-
1154
J.F. Groote, MA. Renters
scripts of process variables. A consequence of this is that the number of process variables becomes large or infinite, which is less elegant. Furthermore, it is impossible to communicate data taken from infinite data domains. This generally is dealt with by considering only finite, but sufficiently large data domains. A true problem, however, is that for larger verifications the majority of the calculations tend to shift to the data. The role of data as second class citizens hinders its effective manipulation. This has a direct repercussion on the size and difficulty of the systems that can be handled. The other problem is that the axioms and principles are very elementary. This means that although there are very many ways to prove some property of processes, finding a particular proof turns out to be an immense task. What is called for are proof methodologies, i.e., recipes and guidelines that lead in reasonable time to relatively short proofs. We have addressed the first problem by extending one of the basic process algebras, with data. The result is /xCRL (micro Common Representation Language). Basically, it is a minimal extension to ACP with equational abstract data types. Special care has been taken to keep the language sufficiently small, to allow study of the language itself, and sufficiently rich to precisely and effectively describe all sorts of protocols, distributed algorithms and, in general all communicating systems. In /xCRL process variables and actions can be parameterized with data. Data can influence the course of a process through a conditional (if-then-else)construct, and alternative quantification is added to express choices over infinite data sorts. Recently, the language has been extended with features to express time [23], but time is not addressed in this chapter. /xCRL has been the basis for the development of a proof theory [20], and a toolset [10] allowing to simulate /xCRL specifications and to perform all forms of finite state analysis on them. Using the toolset, it is even possible to do various forms of symbolic process manipulations, on the basis of the axioms, and currently this is an area under heavy investigation. A lot of effort went into the specification and (manual) verification of various interactive systems [2,4,16,18,26,32-34]. When doing so, we developed a particular methodology of verification, culminating in the cones and foci technique [24], which enabled an increase in the order of magnitude of systems that could be analyzed. As we strictly clung to the basic axioms and principles of process algebra, it was relatively easy (but still time consuming) to check our proofs using proof checkers such as Coq [12], PVS [47] and Isabelle [41,42] (for an overview see [19]). The first observation we ran into was that proving systems described in the full /xCRL process syntax is inconvenient, despite the fact that the language is concise. Therefore, a normal form that is both sufficiently powerful to represent all systems denotable in /xCRL and that is very straightforward was required. We took Linear Process Operators or Linear Process Equations as the normal form. This format resembles I/O automata [35], extended finite state machines [30] or Unity processes [9]. It is explained in Section 3.1. An obvious verification problem that we often encounter is to prove an implementation adhering to its specification. We found this to be hard for basically the same reasons in all instances we studied. By equivalence we generally understand rooted branching bisimilarity. In this case the verification task is roughly that visible actions in the implementation should be matched by visible actions in corresponding states in the specification and vice versa. The difficulty is that often an action in the specification can only be matched in the
Algebraic process verification
^
1155
External actions
e>- Progressing internal actions Fig. 1. A cone and a focus point.
implementation by first doing a large number of internal steps. The implementation contains many cone-like structures as sketched in Figure 1, where internal actions in the cone precede the external actions at the edge of the cone. The cones and foci method employs these structures, as summarized in the generalized equality theorem (see Section 3.3), reducing the proof of equality to a proof of properties of data parameters that are relatively easy to handle. In this method the notion of invariant has been introduced. Despite the fact that invariants are the most important technical means to carry out sequential program verification, they were virtually absent in process algebra. Although it can be shown that formally invariants are not needed, in the sense that each process algebraic proof using invariants can be transformed into one without explicit use of this notion, we believe that invariants are important. The reason for this is that it allows to split a proof in on the one hand finding appropriate invariants, and on the other hand proving an equivalence or property. Another difficulty is that one often needs to prove properties of distributed systems that consist of an arbitrary number, say «, similar processes. It turns out that calculating the parallel composition of these n processes with induction on n is cumbersome (see, e.g., [33]). The reason for this is that it requires to describe the behaviour of only a subset of the n processes. However, if one looks at the problem from a different angle, the parallel composition becomes a simple mechanical procedure. This is exactly the topic of Section 5. Section 7 deals with confluence which is one of the most obvious structures occurring in distributed systems. In Milner's seminal book on process algebra [38], a full chapter was devoted to the subject. In Section 7 it is shown how confluence can be used to simplify the behaviour of a system considerably, after which it is much easier to understand and analyze it. We feel slightly unsatisfied that only the topics mentioned above are addressed in this chapter. There is much more known and to be known about process verification. We could
1156
J.E Groote, MA. Renters
not include the large number of potentially effective techniques about which ideas exist, but which have not yet developed sufficiently in the process algebra context to be included. One may think about classifying distributed systems in several categories with similar structures, the use of symmetry in distributed systems, and the use of history and especially prophecy variables. Even if we would have attempted to include such ideas, we would soon be incomplete, as we feel that algebraic process verification is only at the brink of its development. The next section starts with a thorough explanation of the language /xCRL. We subsequently address the topics mentioned above. Interleaved with these we prove two distributed systems correct, as an illustration of the method. The material presented in this chapter is based on a number of publications. Section 2 is based on [21]. The cones and foci method and the general equality theorem presented in Section 3 are taken from [24]. The verification of the SLIP protocol in Section 4 is slightly adapted from [19]. The linearization of a number of similar processes presented in Section 5 is taken from [22]. The example of the Tree Identify Protocol of IEEE 1394 (Section 6) is taken from [48]. Section 7 on confluence is based on [25].
2. Process algebra with data: /xCRL In this section we describe /xCRL, which is a process algebra with data. The process algebra /xCRL is used in different contexts and for different purposes. On the one hand it is used as a formal specification language with a strict syntax and (static) semantics. As such it can be used as input for a formal analysis toolset. On the other hand it is a mathematical notation, with the flexibility to omit obvious definitions, to only sketch less relevant parts, introduce convenient ad hoc notation, etc. In this section we stick quite closely to /xCRL as a formal language. In the subsequent sections we are much less strict, and take a more mathematical approach.
2.1. Describing data types in jiCRL In [JiCRL there is a simple, yet powerful mechanism for specifying data. We use equationally specified abstract data types with an explicit distinction between constructor functions and 'normal' functions. The advantage of having such a simple language is that it can easily be explained and formally defined. Moreover, all properties of a data type must be defined explicitly, and henceforth it is clear which assumptions can be used when proving properties of data or processes. A disadvantage is of course that even the simplest data types must be specified each time, and that there are no high level constructs that allow compact specification of complex data types. Still, thus far these shortcomings have not outweighed the advantage of the simplicity of the language. Each data type is declared using the keyword sort. Therefore, a data type is also called a data sort. Each declared sort represents a non-empty set of data elements. Declaring the sort of the Booleans is simply done by: sort
Bool
Algebraic process verification
1157
Table 1 Basic axioms for Bool Booll B00I2
- ( t = f) -^(b = \)^b
=i
Because Booleans are used in the if-then-else construct in the process language, the sort Bool must be declared in every /xCRL specification. Elements of a data type are declared by using the keywords func and map. Using func one can declare all elements in a data type defining the structure of the data type. For example, by sort
Bool
func
t, fi^-Bool
one declares that t (true) and f (false) are the only elements of sort Bool. We say that t and f are the constructors of sort Bool. Not only the sort Bool, but also its elements t and f must be declared in every specification; they must be distinct, and the only elements of Bool. This is expressed in axioms Booll and Bool2 in Table 1. In axiom Bool2 and elsewhere we use a variable b that can only be instantiated with data terms of sort Bool. If in a specification t and f can be proven equal, for instance if the specification contains an equation t = f, we say that the specification is inconsistent and it looses any meaning. We often write 0 and -•0 instead of 0 = t and (^ = t, respectively. It is now easy to declare the natural numbers using the constructors 0 and successor S. sort
Nat
func
0 :^^ Nat S.Nat ^ Nat
This says that each natural number can be written as 0 or the result of a number of applications of the successor function to 0. If a sort D is declared without any constructor with target sort D, then it is assumed that D may be arbitrarily large. In particular D may contain elements that cannot be denoted by terms. This can be extremely useful, for instance when defining a data transfer protocol, that can transfer data elements from an arbitrary domain D. In such a case it suffices to declare in fiCRL: sort
D
The keyword map is used to declare additional functions for a domain of which the structure is already given. For instance declaring a function A on the Booleans, or, declaring
1158
J.F. Groote, MA. Renters
the + on natural numbers, can be done by adding the following lines to a specification in which Nat and Bool have already been declared: map
A: Bool x Bool -^ Bool + : Nat X Nat -^ Nat
By adding plain equations between terms assumptions about the functions can be added. For the two functions declared above, we could add the equations: var
jc:Bool n,n^: Nat
rew
X A t = jc XAf = f
n-j-S(n') = S(n+n') Note that before each group of equations starting with the keyword rew we must declare the variables that are used. The machine readable syntax of /xCRL only allows prefix notation for functions, but we use infix or even postfix notation, if we believe that this increases readability. Moreover, we use common mathematical symbols such as A and + in data terms, which are also not allowed by the syntax of /xCRL, for the same reason. Functions may be overloaded, as long as every term has a unique sort. This means that the name of the function together with the sort of its arguments must be unique. For example, it is possible to declare max: Nat x Nat -> Nat and max: Bool x Bool -^ Bool, but it is not allowed to declare a function / : Bool -> Bool and / : Bool -^ Nat. Actually, the overloading rule holds in general in /xCRL. The restrictions on declarations are such that every term is either an action, a process name or a data term, and if it is a data term, it has a unique sort. Although we have that every term of a data sort equals a term that is only built from the constructor functions this does not mean that we always know which constructor term this will be. For example, if we introduce an additional function 2 for the sort Nat by means of the declaration map
2 :-^ Nat
this does not give us which constructor term equals the constant 2. This information can be added explicitly by adding an equation rew
2 = 5(5(0))
Algebraic process verification
1159
When we declare a sort D, it must be nonempty. Therefore, the following declaration is invalid. sort func
D f:D->D
It declares that D is a domain in which all the terms have the form f{f(f(...))). ie., an infinite number of applications of / . Such terms do not exist, and therefore D must be empty. This problem can also occur with more than one sort. For example, sorts D and E with constructors from D to E and E io D. Fortunately, it is easy to detect such problems and therefore it is a static semantic constraint that such empty sorts are not allowed (see [21]). In proving the equality of data terms we can use the axioms, induction on the constructor functions of the data types and all deduction rules of equational logic. An abstract data type can be used to prove elementary properties. We explain here how we can prove data terms equal with induction, and we also show how we can prove data terms to be nonequal. An easy and very convenient axiom is Bool2. It says that if a Boolean term b is not equal to t, it must be equal to f or in other words that there are at most two Boolean values. Applying this axiom boils down to a case distinction, proving a statement for the values t and f, and concluding that the property must then universally hold. We refer to this style of proof by the phrase 'induction on Booleans'. A typical example is the proof of b Ab = b. Using induction on Bool, it suffices to prove that this equality holds for b = { and ^ = f. In other words, we must show that t A t = t and f A f = f. These are trivial instances of the defining axioms for A listed above. Note that the sort Bool is the only sort for which we explicitly state that the constructors t and f are different. For other sorts, like Nat, there are no such axioms. The division between constructors and mappings gives us general induction principles. If a sort D is declared with a number of constructors, then we may assume that every term of sort D can be written as the application of a constructor to a number of arguments chosen from the respective argument sorts. So, if we want to prove a property pid) for all d of sort D, we only need to provide proofs for p{cn ( J i , . . . , dn)) for each M-ary constructor c,i: S\ X " ' X Sn ^^ D and each dj a term of sort 5/. If any of the arguments of c„, say argument dj, is of sort D then, as dj is smaller than d, we may use that p(dj). If we apply this line of argumentation, we say we apply induction on D. Suppose we have declared the natural numbers with constructors zero and successor, as done above. We can for instance derive that 0 -\- n = n for all n. We apply induction on Nat. First, we must show that 0-1-0 = 0, considering the case where n =0. This is a trivial instance of the first axiom on addition. Secondly, we must show 0 -h S(n') = S{n'), assuming that n has the form S(n'). In this case we may assume that the property to be proven holds already for n\ i.e., 0 -h «' = n'. Then we obtain: 0-\-S(n) = S(0-\-n) = S(n).
1160
J.E Groote, MA. Renters
As an example, we define a sort Queue on an arbitrary non-empty domain D, with an empty queue [ ] , and in to insert an element of D into the queue. The arbitrary non-empty domain is obtained by the specification of sort D without constructors.
sort func
Z), Queue [] :-> Queue in: D X Queue
Queue
We extend this with auxiliary definitions toe to get the first element from a queue, untoe to remove the first element from a queue, isempty to check whether a queue is empty and -f-f to concatenate two queues. map
toe: Queue -^ D untoe: Queue -^ Queue isempty: Queue -> Bool
var
d,d':D q,q'\
rew
Queue
toe[in{d, [])) = d toe(in(d, in(d\ q))) = toe(in{d\
q))
untoe{in(d, [])) = [] untoe{in{d, in{d\ q))) = in{d, untoe(in{d\
q)))
isempty{[ ]) = t isempty (in{d, ^)) = f in(d, q)-\-\-q' = in(d,
q-^+q')
A queue q\ from which the last element has been removed can be given by untoe(q\) a queue q2 into which the last element of ^i has been inserted is given by in(toe(q\), Now we prove -^isemptyiqx) - » untoe{q\)-\-\-in(toe{q\),q2)
and qi)-
=^i++^2-
Suppose that ~>isempty(q\). We prove the proposition by induction on the structure of queue ^ 1 . Base, Suppose that <7i = [ ]. Then isempty([ ]) = t, which contradicts the assumption that -^isempty {q\). Induction step. Suppose that q\ = in(d, q\) for some d:D and q\: Queue. By induction we have -^isempty(q[) -> untoeiq[)-^-hin{toe(q[), qi) = <7l++<72. Then we can distinguish the following two cases for ^ j : • ^1 = []• In this case we have untoe(q\)-\-^in{toe{q\),
qi)
= untoe{in{d, []))+-\-in{toe{in{d,
[])),^2)
A Igebraic process verification
=
1161
[]^+in(d,q2)
= in(d, qi) = m(^,[]++(?2) = mW,[])+H-(3r2 = ^14-4-^2.
• ^J = in{d', q'(). In this case we have untoe{q\)-\-~{-in{toe{q\), qi) = untoe{in{d, in{d\ q\')))-h-hin{toe{in{d, in(d\ q\))). qi) = in[d, untoe[in(d', q[')))+-\-in[toe{in(d\
in(d,q\)^-^q2
= q\++q2' Note that we used that untoe(q[)-^-i-in(toe(q[),q2) = q[-i-i-q2' This is allowed as we can derive that isempty{q'^) = isempty{in(d\ ^J')) = f. Using the previous proposition we can easily prove that -^isemptyiq) -^ untoe{q)+-\-in{toe{q), [])= for all q'.Queue. For if we take q\—q and ^2 = [ ] we obtain: -^isemptyiq) ~> untoe{q)-^-\-in{toe{q),[]) = ^4-4-[]. Assuming that we can prove ^+-!-[] = ^, it is not hard to see that we thus have obtained -^isemptyiq) -> untoe(q)++in{toe{q), [])=zq. The property <^4-+[] = q for all q.Queue can be proven with induction on the structure of q: Base. Suppose that ^ = [ ]. Clearly <^+-h[ ] = [ ]+-h[ ] = [ ] = ^. Induction step. Suppose that q =in(d,q). By induction we have ^'-H+[] = ^^ Then g-f+[ ] = m(tf, gO-f+[ ] = m(^, ^^+4-[ ]) = mW, ^') = ^. In ^CRL it is possible to establish when two data terms are not equal. This is for instance required in order to establish that two processes cannot communicate. There is a characteristic way of proving that terms are not equal, namely by assuming that they are equal, and showing that this implies t = f, contradicting axiom Bool 1. We give an example showing that the natural numbers zero (0) and one (S(0)) are not equal. We assume that the natural numbers with a 0 and successor function S are appropriately declared. In order to show zero and one different, we need a function that relates Nat to Bool. Note that if there is no such function, there are models of the data type Nat where
1162
J.F. Groote, M.A. Renters
zero and one are equal. For our function we choose 'less than or equal to', notation ^ , on the natural numbers, defined as follows: map var rew
< : Nat x Nat -^ Bool n.m.Nat 0^ «=t S{n) ^ 0 = f S{n) < S{m) =n
^m
Now assume 0 = 5(0). Clearly, 0 ^ 0 = t. On the other hand, using the assumption, we also find 0 ^ 0 = S(0) ^ 0 = f. So, we can prove t = f. Hence, we may conclude 0 ^ S(0). This finishes the most important aspects of the data types. There are several standard libraries available [51,40] of which some also contain numerous provable identities. The general theory about abstract data types is huge, see for instance [14].
2.2. Describing processes in /iCRL 2.2.1. Actions. Actions are abstract representations of events in the real world that is being described. For instance sending the number 3 can be described by send(3) and boiling food can be described by boilifood) where 3 and food are terms declared by a data type specification. An action consists of an action name possibly followed by one or more data terms within brackets. Actions are declared using the keyword act followed by an action name and the sorts of the data with which it is parameterized. Below, we declare the action name timeout without parameters, an action a that is parameterized with Booleans, and an action b that is parameterized with pairs of natural numbers and data elements. The set of all action names that are declared in a fiCRL specification is denoted by Act. act
timeout a : Bool
b.Natx D In accordance with mainstream process algebras, actions in /xCRL are considered to be atomic. If an event has a certain positive duration, such as boiling food, then it is most appropriate to consider the action as the beginning of the event. If the duration of the event is important, separate actions for the beginning and termination of the event can be used. In the tables with axioms we use the letters a and a' for action names, and in order to be concise, we give each action a single argument, although in /xCRL these actions may have zero or more than one argument. The letter c is used for actions with an argument, and for the constants 8 and r, which are explained in Section 2.2.3 and Section 2.2.8 respectively. 2.2.2. Alternative and sequential composition. The two elementary operators for the construction of processes are the sequential composition operator, written as p • q and the alternative composition operator, written as /? + <7. The process p • q first performs the
Algebraic process verification
1163
Table 2 Basic axiomsi for AtCRL Al X -\-y =- y +x A2 ^ + (V f- Z) = (JC + v) + Z A3 X -\-X =- X A4 (x + v) • z = x • z-^y • z A5 (X • y) • z=x(yz)
actions of /?, until p terminates, and then continues with the actions in ^. It is common to omit the sequential composition operator in process expressions. The process p -h q behaves like p ox q, depending on which of the two performs the first action. Using the actions declared above, we can describe that a(3,d) must be performed, except if a time out occurs, in which case a(\) must happen. a{3,d)-\~ timeout • a(\) Observe that the sequential composition operator binds stronger than the alternative composition operator. In Table 2 axioms A1-A5 are listed describing the elementary properties of the sequential and alternative composition operators. For instance, the axioms Al, A2 and A3 express that -h is commutative, associative and idempotent. In these and other axioms we use variables X, y and z that can be instantiated by process terms. For processes we use the shorthand jc c y for jc -h j = >' and we write x ^y for y c.x. This notation is called summand inclusion. It is possible to divide the proof of an equality into proving two inclusions, as the following lemma shows. LEMMA
2.1. For arbitrary fiCRL-terms x and y we have: ifx C y and y ^x, then x = y.
Suppose x c.y and y c x. By definition we thus have (1) X -\- y = y, and (2) y-{-x=x.
PROOF.
T-u
u. •
^2)
,
Al
Thus we obtam: x = y-^x=x-\-y
,
(1)
= y.
^
D
2.2.3. Deadlock. The language /xCRL contains a constant 5, expressing that no action can be performed, for instance in case a number of computers are waiting for each other, and henceforth not performing anything. This constant is called deadlock. A typical property for 5 is /7 -h 5 = /?; the choice in p -\-q is determined by the first action performed by either p or q, and therefore one can never choose for 8. In other words, as long as there are alternatives deadlock is avoided. In Table 3 the axioms A6 and A7 characterize the main properties of 5. 2.2.4. Process declarations. Process expressions are expressions built upon actions indicating the order in which the actions may happen. In other words, a process expression represents the potential behaviour of a certain system.
1164
J.E Groote, MA.
Renters
Table 3 Axioms for deadlock A6 A7
x-\-8 = x 8-x = 8
In a /xCRL specification process expressions appear at two places. First, there can be a single occurrence of an initial declaration, of the form init
p
where /? is a process expression indicating the initial behaviour of the system that is being described. The init section may be omitted, in which case the initial behaviour of the system is left unspecified. The other place where process expressions may occur are in the right hand side of process declarations, which have the form: proc
X(x\:s\,...,Xn:sn)
=p
Here X is the process name, the JC/ are variables, not clashing with the name of a constant function or a parameterless process or action name, and the Si are sort names. In this rule, process X(x[, ...,x„) is declared to have the same behaviour as the process expression p. The equation in a process declaration must be considered as an equation in the ordinary mathematical sense. This means that in a declaration such as the one above an occurrence of X(u\,.. .,Un) may be replaced by p(u\/x\,.. .,Un/xn), or vice versa, p(u\/xu . •., Un/Xn) may be replaced by X{u\,..., w„). An example of a process declaration is the following clock process which repeatedly performs the action tick and displays the current time. In this example and also in later examples we assume the existence of a sort Nat with additional operators which represents the natural numbers. We simply write 1 instead of 5'(0), 2 instead of 5(5(0)), etc. Furthermore, we assume that the standard functions on naturals are defined properly. Examples of such functions are + , ^ , <, >, etc. act
tick
display: Nat proc CIock(t: Nat) = tick • Clockit - f l ) -h display(t) • Clock(t) init Clock(0) 2.2.5. Conditionals. The process expression p q where p and q are process expressions, and Z? is a data term of sort Bool, behaves like p if b is equal to t (true) and behaves like ^ if Z? is equal to f (false). This operator is called the conditional operator, and operates precisely as an then_if_else construct. Through the conditional operator data influences process behaviour. For instance a counter, that counts the number of a actions that
Algebraic process verification Table 4 Axioms for conditionals CI C2
1165
Table 5 Axioms for alternative quantification
x < t > v = jc X
SUMl
E./:D'^=^
SUM3
j:x=j:x-^xd
SUM4
X:,y:/)(^^+^^) = E ^ + E ^
SUM5 SUMU
(j:x)x=Y:cii)(^dx)
(yci:D(xd=Yd))-^j:x=:j:y
occur, issuing a b action and resetting the internal counter after 10 a's, can be described by: proc
Counter(n\Nat) = a • Counter(n H- 1) < n < 10 > ^ • Counter(0)
The conditional operator is characterized by the axioms C1 and C2 in Table 4. All the properties of conditionals that we need are provable from these axioms and BooU, Bool2. The conditional operator binds stronger than the alternative composition operator and weaker than the sequential composition operator. LEMMA 2.2. The following identities hold for arbitrary fiCRL-terms x, y, z and for arbitrary Boolean terms b, b\, bi. (1) X y =x 6 -\- y <—^b> 6\ (2) x ^ = x 8-\-x
2.2.6. Alternative quantification. The sum operator or alternative quantification J2d:D ^(^) t>ehaves like P(d\) + P(d2) H , i.e. as the possibly infinite choice between P(di) for any data term dj taken from D. This is generally used to describe a process that is reading some input. E.g. in the following example we describe a single-place buffer, repeatedly reading a natural number n using action name r, and then delivering that value via action name 5. proc Buffer = ^
r(n) -sin) - Buffer
n -.Nat
Note that alternative quantification binds stronger than the alternative composition operator and weaker than the conditional operator. In Table 5 the axioms for the sum operator are listed. The sum operator X^J.D /^ is a difficult operator, because it acts as a binder just like the lambda in the lambda calculus (see, e.g., [1]). This introduces a range of intricacies with substitutions. In order to avoid having to deal with these explicitly, we allow the use of explicit lambda operators and variables representing functions from data to process expressions. In the tables the variables jc, y and z may be instantiated with process expressions and the capital variables X and Y can be instantiated with functions from some data sort to
1166
J.F. Groote, M.A. Renters
process expressions. The sum operator ^ expects a function from a data sort to a process expression, whereas ^^Q expects a process expression. Moreover, we take Xlt/:D P ^^^ Y^Xd'.D.piohc equivalent. When we substitute a process expression p for a variable x or a function Xd.D.p for a. variable X in the scope of a number of sum operators, no variable in p may become bound by any of these sum operators. So, we may not substitute the action a(d) for x in the left hand side of SUMl in Table 4, because this would cause d to become bound by the sum operator. So, SUMl is a concise way of saying that if J does not appear in p, then we may omit the sum operator in Xl^ D PAs another example, consider axiom SUM4. It says that we may distribute the sum operator over a plus, even if the sum binds a variable. This can be seen by substituting for X and Y Xd:D.a(d) and Xd\D.b{d), where no variable becomes bound. After fireduction, the left hand side of SUM4 becomes J ] ^ D ( ^ W ) "*• ^(^)) ^^^ ^^^ ^S^^ \\2ir\d side is ^d.^aid) -\- J2d:D ^i^). In conformity with the A.-calculus, we allow a-conversion in the sum operator, and do not state this explicitly. Hence, we consider the expressions T.d:D P^d) a » d He.D P(^) ^^ ^qual.
The axiom SUMS allows to split single summand instances from a given sum. For instance the process expressions Yln.Nat^^^^ ^^^ Z!/? yv^// ^C'^) +^(2) ^^^ obviously the same, as they allow an a{n) action for every natural number n. Using SUM3 we can prove them equal. Instantiate X with Xn.a(n) and d with 2. We obtain: ^Xn.ain)
= ^XnM{n)
+ {Xn.a(n))2.
By )S-reduction this reduces to Y.n:Nat^M = Y^mNat^^^) + «(2). We show how we can eliminate a finite sum operator in favour of a finite number of alternative composition operators. Such results always depend on the fact that a data type is defined using constructors. Therefore, we need induction in the proof, which makes it appear quite involved. This apparent complexity is increased by the use of axioms SUMS and SUMl 1. Consider the equality ^ r ( n ) < « ^ 2 > 5 = r(0)-hr(l)4-r(2),
(1)
n-.Nat
assuming that the natural numbers together with the ^ relation have been appropriately defined. The result follows in a straightforward way by the following lemma that we prove first. LEMMA
2.S. For all m\Nat we find (S is the successor fiinction):
^ X n = XO-h Yl ^'^(^)n:Nat
PROOF.
m.Nat
Using Lemma 2.1 we can split the proof into two summand inclusions.
Algebraic process verification
1167
(C) We first prove the following statement with induction on n: XnCXO+ ^
XS(m).
m.Nat
- (n=0) Trivial using A3.
XO-h ^
XS(m)
•.Nat m:Nat
SUM3
X0+ J2
XS{m)-^XS{n)
m -.Nat
2
Xn.
So the statement has been proven without assumptions on n (i.e. for all n). Hence, application of SUMl 1, SUM4 and SUMl yields: ^XwCXO-f ^ tr.Nat
XS{m),
m.Nat
as was to be shown. (2) Using SUMS it immediately follows that for all m
Y^
Xn^X^^XSim).
iv.Nat
So, SUM 11, SUM4 and SUMl yield: ^
Xn2X0-h ^
n.Nat
X5(w).
D
m.Nat
Equation (1) can now easily be proven by: y ^ r{n)
^2>8
tr.Nat
^'"'= " r ( 0 ) < 0 ^ 2 > 5 + ^
r(/i'+!)<«'+1^2>5
u':Nat
^'"'^''"r(0) + r ( l ) < 1 ^ 2 > 5 + ^
r ( n " + 2) < « " + 2 ^ 2>5
n":Nat Lemma 2.3
= "r(0) + r(l)+r(2)<2<2>5+ ^ n"':Nat
=
r(0) + /-(l) + r(2).
r ( 3 + « ' " ) < « ' " + 3 ^ 2>6
1168
J.F. Groote, M.A. Renters
All the identities on data that we have used in the proof above can be proved from the axioms on natural numbers in Section 2.1. An important law is sum elimination. It states that the sum over a data type from which only one element can be selected can be removed. This lemma occurred for the first time in [17]. Note that we assume that we have a function eq available, reflecting equality between terms. LEMMA 2.4 (Sum elimination). Let D be a sort and eq: D x D -> Bool a function such that for all d, e:D it holds that eq(d, e) = t iffd = e. Then
^ X J < ^ ^ ( J , ^ ) > 5 = X^. d.D
PROOF. According to Lemma 2.1 it suffices to prove summand inclusion in both directions. (C) Using Lemma 2.2.2 above we find:
Xe = Xe < eq(d, e)>8 -\- Xe < -^eq(d, e) > 5. Using SUMl 1 and SUM4 we find:
Y^Xe = Y^Xd< eq(d, e)>8^^Xe< d.D
d:D
--eqid, e)>8.
d:D
Using SUMl and the summand inclusion notation we obtain:
d.D
(2) By applying SUM3, and the assumption that eq(e, e) = t, we find: 2~]Xd <eq(d,e)>8^
Xe <\eq(e,e)>8 = Xe.
D
d:D
LEMMA
2.5. If there is some e:D such that b(e) holds, then X = y^x
8.
d.D
2.2.7. Encapsulation. Sometimes, we want to express that certain actions cannot happen, and must be blocked, i.e., renamed to 8. Generally, this is only done when we want to force this action into a communication. The encapsulation operator 9// (// ^ Act) is specially designed for this task. In 9//(/7) it prevents all actions of which the action name is mentioned in H from happening. Typically, ^{b]{ci 'b(3) -c) =a ' 8, where a, b and c are action names. The properties of 9// are axiomatized in Table 6.
Algebraic process verification
1169
Table 6 Axioms for encapsulation. DD Dl D2 D3 D4 SUMS
a//(5) = 5 dH{a{d)) dH{a{d))
= a(d) =6
if
a^H
if
aeH
^Hix + y) = dH{x) + dH{y) dnix y) = dHix)-dH{\)
dH(j:x)
= Ecr.DdHiXd)
Table 7 Axioms for internal actions and abstraction Bl B2
c • r =c X'iz •(y-^z)-\-y)=x
TID TIT Til TI2 TI3 TI4 SUM9 DT
rj{S) = 8
iy + z)
r/(r) = r Tiiaid))=a{d) Ti{aid)) = T T/(x + y) = T/(A)H-r/(v) T^lix •y) = r/Cv) • r / ( y )
if
ail
if
ael
r/(E^) = E./:D^/(^^) dH(T) = T
2.2.8. Internal actions and abstraction. Abstraction is an important means to analyze communicating systems. It means that certain actions are made invisible, so that the relationship between the remaining actions becomes clearer. A specification can be proven equal to an implementation, consisting of a number of parallel processes, after abstracting from all communications between these components. The internal action is denoted by r. It represents an action that can take place in a system, but that cannot be observed directly. The internal action is meant for analysis purposes, and is hardly ever used in specifications, as it is very uncommon to specify that something unobservable must happen. Typical identities characterising T are a • r • /? = A • /?, with a an action and p a process expression. It says that it is impossible to tell by observation whether or not internal actions happen after the a. Sometimes, the presence of internal actions can be observed, due to the context in which they appear. For example, A -h r • Z? 7^ a + Z?, as the left hand side can silently execute the r, after which it only offers a b action, whereas the right hand side can always do an a. The difference between the two processes can be observed by insisting in both cases that the a happens. This is always successful in a + b, but may lead to a deadlock ina -\-T - b. The natural axiom for internal actions is Bl in Table 7. Using the parallel composition operator (Section 2.2.9) and encapsulation, Bl can be used to prove all closed instantiations of B2 [50], and therefore B2 is also a natural law characterising internal actions. The semantics that is designed around these axioms is rooted branching bisimulation. The
1170
J.F. Groote, MA. Renters
axioms in all other tables hold in strong bisimulation semantics, which does not abstract from internal actions. The first semantics abstracting from internal actions is weak bisimulation [38]. Weak bisimulation relates strictly more processes than rooted branching bisimulation, which in turn relates more processes than strong bisimulation. It is a good habit to prove results in the strongest possible semantics, as these results automatically carry over to all weaker variants. We do not consider these semantics explicitly in this section. The reader is referred to for instance [8,49,39]. In order to abstract from actions, the abstraction operator TI {I c. Act) is introduced, where / is a set of action names. The process r/ {p) behaves as the process /?, except that all actions with action names in / are renamed to r. This is clearly characterized by the axioms in Table 7. 2.2.9. Parallel processes. The parallel composition operator can be used to put processes in parallel. The behaviour of p\\q is the arbitrary interleaving of actions of the processes p and q, assuming for the moment that there is no communication between p and q. For example the process a \\ b behaves like a - b-\-b a. The parallel composition operator allows us to describe intricate processes. For instance a bag reading natural numbers using action name r and delivering them via action name s can be described by: act
r, s : Nat
proc 5«g = ^
r(«) • (5(n) II Bag)
tr.Nat
Note that the elementary property of bags, namely that at most as many numbers can be delivered as have been received in the past, is satisfied by this description. It is possible to let processes p and q in p \\ q communicate. This can be done by declaring in a communication section that certain action names can synchronize. This is done as follows: comm
a\b = c
This means that if actions a{d\, ...,d„) and b(d\,..., J„) can happen in parallel, they may synchronize and this synchronization is denoted by c{d\,..., J,?). If two actions synchronize, their arguments must be exactly the same. In a communication declaration it is required that action names a, b and c are declared with exactly the same data sorts. It is not necessary that these sorts are unique. It is for example perfectly right to declare the three actions both with a sort Nat and with a pair of sorts D x Bool. If a communication is declared as above, synchronization is another possibility for parallel processes. For example the process a\\b\s now equivalent io ab-{-ba^c. Often, this is not quite what is desired, as the intention generally is that a and b do not happen on their own. For this, the encapsulation operator can be used. The process d[aM]i<^ II ^) is equal to c. Axioms that describe the parallel composition operator are in Table 8. In this table the communications between action names from the communication section are represented by the communication function y. In order to formulate the axioms two auxiliary parallel
Algebraic process verification
1171
Table 8 Axioms for parallelism in /xCRL CMl
jc lly^AflLv + y L j c + x l v
CM2 CM3 CM4 SUM6
c |_ JC = c • JC c • JC IL V = c • (jc II v) (Jc + >')lLz = Jc|Lz + y|Lc ( E ^ ) L-^ = Ed-.oi^dlx)
CF
fl(J)|fl'(^)
CDl CD2 CTl CT2 CM5 CM6 CM7 CMS CM9
8\c = 8 c\8 = 8
SUM?'
x\ij:X)
= I ^^^'^'^^^^'^^'^^^'^^'^^ 18
if K(a, ^/) defined otherwise
T\C = 8
c|r = 5 c • jc|c'= (c|c') • JC cjc'• X = (c|c') • JC c-jc|c'-y = (c|c')-(jc || y) U + y)|z = Jc|z + y|c ;c|(y + z) = Jc|y + x|z
SUM? (x;x)|x = i:^/.^(x^|x)
= ZcID^^\Xd)
composition operators have been defined. The left merge |L is a binary operator that behaves exactly as the parallel composition operator, except that its first action must come from the left hand side. The communication merge | is also a binary operator behaving as the parallel composition operator, except that the first action must be a synchronization between its left and right operand. The core law for the parallel composition operator is CMl in Table 8. It says that in JC || y either JC performs the first step, represented by the summand x IL 3;, or >' can do the first step, represented by j |L JC, or the first step of x || y is a communication between JC and y, represented by JC | y. All other axioms in Table 8 are designed to eliminate the parallel composition operators in favour of the alternative composition and the sequential composition operator. The operators for parallel composition (II, IL, and I) bind stronger than the conditional operator and weaker than the sequential composition operator. Data transfer between parallel components occurs very often. As an example we describe a simplified instance of data transfer. One process sends a natural number n via action name s, and another process reads it, via action name r and then announces it via action name a. Using an encapsulation and an abstraction operator we force the processes to communicate, and make the communication internal. Of course we expect the process p to be equal to r - a(n). var act comm
n:Nat r,s,c,a :Nat r \s = c
proc
P = r{c}id{r.s}ls(n) II Y^ m .Nat
r(m)a(m)\\
1172
J.E Groote, MA. Renters Table 9 Axioms for renaming in /uCRL RD RT Rl R3 R4 SUMIO
PR(S) = 8 P/?(T) = T
PR(a(d)) = R(a)(d) PRix -\~ y) = PRix) -^ pRiy) PR(xy) = PR{x)pR(y) PR(EX) = Ecr.DPR(^d)
Assuming that eq is an equality function on natural numbers, we have P = ^c}h{r,s}ls(n)\\
Y^
^
nr.Nat
^
r(m)'a{m)]\
= %}(9{r.s}f^(«)- Y^r(m)'a(m)^^
^
m-.Nat
^ ^
Y^r{m)
+ y ^ c{m) -aim) <eq(n,m)>8 m:Nat
— r{c} I — /
22J
- {s(n)\\a(m))
nv.Ncit
I 1 ' ^
^^^^' ^('^) ^ ^^("' m)>8\
T'a(m)
<eq(n,m)>8
m .Nat
= r • a{n). 2.2.10. Renaming. In some cases it is efficient to reuse a given specification with different action names. This allows, for instance, the definition of generic components that can be used in different configurations. We introduce a renaming operator pR. The subscript R is 3. sequence of renamings of the form a -^ b, meaning that action name a must be replaced by b. This sequence of renamings is not allowed to contain distinct entries that replace the same action name. For example the subscript a ^^ b,a -^ chnoi allowed. So, clearly, PR{P) is the process p with its action names replaced in accordance with R, An equational characterization of the renaming operator may be found in Table 9. 3. A strategy for verification In process algebra it is common to verify the correctness of a description (the implementation) by proving it equivalent in some sense, e.g., with respect to rooted branching bisimulation, to a more abstract specification. When data is introduced into the descriptions, proving equivalence is more complex, since data can considerably alter the flow of control in the process. The cones and foci technique of [24] addresses this problem. A requirement of the cones and foci proof method is that the processes are defined by a linear equation
Algebraic process verification
1173
(Definition 3.1). The linearization of process terms is a common transformation in process algebra. Informally, all operators other than •, + and the conditional are eliminated. Therefore, we first present the linear process operator.
3.1. Linear process operators We start out with the definition of 'linear process operator'. The advantage of the linear format is that it is simple. It only uses a few simple process operators in a restricted way. In particular, it does not contain the parallel composition operator. In general a linear process operator can easily be obtained from a /xCRL description, including those containing parallel composition operators, without undue expansion (see also Section 5). Other formats, such as transition systems or automata, generally suffer from exponential blow up when the parallel composition operator is eliminated. This renders them unusable for the analysis of most protocols. We use linear process operators and linear process equations. DEFINITION
3.1. A linear process operator (LPO) over data sort D is an expression of
the form XMt/:D.^^c,(//(J,^/))./7(g,(^,^/))<6,(^,^/)>5 iel
ei'.Ei
for some finite index set /, action names c, e Act U {T}, data sorts E/, D,, and functions fi :D X Ei -> D/, gii D X Ej -> D, and bi'.D x Ei -^ Bool. (We assume that r has no parameter.) Here D represents the state space, c, are the action names, // represents the action parameters, gi is the state transformation and hi represents the condition determining whether an action is enabled. Note that the bound variable p ranges over processes parameterized with a datum of sort D. We use a meta-sum notation Yliei P^ for pi -j- p2 + * + Pn assuming / = { 1 , . . . , n}; the p/'s are called summands of X],^/ Pi- ^^^ / = 0 we define 52,e/ Pi =^' W^ generally use letters 0,^, and S to refer to LPOs. According to the definition in [5], an LPO may have summands that allow termination. We have omitted these here, because they hardly occur in actual specifications and obscure the presentation of the theory. Moreover, it is not hard to add them if necessary. LPOs have been defined as having a single data parameter. Most LPOs that we consider have several parameters, but these may be reduced to one parameter by means of Cartesian products and projection functions. Often, parameter lists get rather long. Therefore, we use the following notation for updating elements in the list. Let d abbreviate the vector d\, ...,d,j.A summandof the form J^eiE ^iifii^^ ^i))' p{d\/di)
1174
J.F. Groote, MA. Renters
Given a process operator ^, the associated linear process equation (LPE) can be written as X{d) = ^Xd. Conversely, given a linear process equation X(d) = p, the associated LPO can be written as XX.Xd.D.p. As a consequence we can choose whether to use linear process operators or equations at each point. Notions defined for LPOs carry over to LPEs in a straightforward manner and vice versa. As an example consider the unreliable data channel that occurs in the alternating bit protocol [8], usually specified by:
d-.Dh.Bit
The channel K reads frames consisting of a datum from some data type D and an alternating bit. It either delivers the frame correctly, or loses or garbles it. In the last case a checksum error ce is sent. The non-deterministic choice between the two options is modeled by the actions j and / . I f j is chosen the frame is delivered correctly and if / happens it is garbled or lost. The process K can be transformed into linear format by introducing a special variable ik indicating the state of the process K. Just before the r action this state is 1. Directly after it, the state is 2. The state directly after action j is 3, and the state directly after / is 4. We have indicated these states in the equation by means of encircled numbers: proc
K=^J2
J2 '*(<^'^)) -©0' •Q)s{{d.b))-^j''QS3,(ce))'(j)K
d'.Dh-.Bit
With some experience it is quite easy to see that the channel K has the following linear description: proc
K{d\D, b.Bit, ik'.Nat)
d':Db':Bit
^j-K(3/ik)<eqiik.2)>8 -^j''K(4/k)<eq{ik,2)>8 ^s{{d,b))'K{\/ik)<eq(ik.3)>8 -\-sice)-K(l/ik)<eq{ikA)>8. Note that we have deviated from the pure LPO format: in the last four summands there is no summation over the data types D and Bit, in the second and third summand j and / do not carry a parameter and in the first summand there are actually two sum operators. This is easily remedied by introducing dummy summands and dummy arguments, and pairing of variables. Note that linear process equations are not very readable, and therefore, they are less suited for specification purposes.
Algebraic process verification
1175
3.2. Proofprinciples and elementary lemmata In order to verify recursive processes, we need auxiliary rules. The axioms presented in the previous section are not sufficiently strong to prove typical recursive properties. We introduce here the principles L-RDP (Linear Recursive Definition Principle) and CL-RSP (Convergent Linear Recursive Specification Principle). All the methods that we present in the sequel are derived from these rules.' Processes can be defined as fixed points for convergent LPOs and as solutions for LPEs. In this chapter we use the term solution for both. DEHNITION 3.2. A solution of an LPO 0 is a process p, parameterized with a datum of sort D, such that for all d:D we have p(d) =
For each LPO 0 , we assume an axiom which postulates that 0 has a canonical solution. Then, we postulate that every convergent LPO has at most one solution. In this way, convergent LPOs define processes. The two principles reflect that we only consider process algebras where every LPO has at least one solution and converging LPOs have precisely one solution. DEHNITION 3.4. The Linear Recursive Definition Principle (L-RDP) says that every linear process operator ^ has at least one solution, i.e., there exists a p such that for all d:D we have p(d) = ^pd. The Convergent Linear Recursive Specification Principle (CL-RSP) [5] says that every convergent linear process operator has at most one solution, i.e. for all p and q if p = ^p and q = ^q, then for all d:D we have p(d) =q(d).
The following theorem, proven in [5], says that if an LPO is convergent in the part of its state space that satisfies an invariant /, then it has at most one solution in that part of the state space. It has been shown to be equivalent to CL-RSP in [5]. 3.5. An invariant of an LPO 0 written as in Definition 3.1 is a function I :D -> Bool such that for all / G /, ^, :£"/, and d:D we have:
DERNITION
bi(d,ei)Al(d)-^l{gi(d.ei)), 3.6 (Concrete Invariant Corollary). Let 0 be an LPO. If, for some invariant I of0, the LPO kp.kd.0pd 8 is convergent and for some processes q, q\ parameterized by a datum of sort D, we have 1(d) -^ q(d) = 0qd and 1(d) -^ q'(d) = 0q'd, thenl(d)-^q(d)=q'(d). THEOREM
' Elsewhere we also use Koomen's Fair Abstraction Rule, but as we avoid processes with internal loops, we do not need KFAR here.
1176
J.E Groote, MA.
Renters
To develop the theory it is convenient to work with a particular form of LPOs, which we call (action) clustered? Clustered LPOs contain, for each action a, at most one summand starting with an a. Thus clustered LPOs can be defined by summation over a finite index set / of actions. DEFINITION 3.7. Let Act c Act U {r} be a finite set of action names. A clustered linear process operator (C-LPO) over Act is an expression of the form 0=kp.Xd:D.
^
^a(/,.W,^..))/7(^,,(J,^,,))
aeAct ea'.Ea
The first part of the following theorem states that it is no restriction to assume that LPOs are clustered. The second part is a prelude on the general equality theorem, as it requires that, for each action, the sorts in the sum operators preceding this action are the same in specification and implementation. A proof is given in [24]. THEOREM 3.8.
(1) Every convergent LPO 0 can be rewritten to a C-LPO 0' with the same solution, provided all occurrences of the same action have parameters of the same type. (2) Consider convergent C-LPOs 0, ^ such that action a occurs both in 0 and in ^ {with parameters of the same data type). There exist convergent C-LPOs 0', ^' having the same solutions as 0, ^, respectively, such that a occurs in 0' and ^' in summands with summation over the same sort Ea. Thetwosummands5((J,Z?)) • K{\/ik)<eq{ik,^)>^ of the channel K can be grouped together as
2inds{ce) • K{\/ik)
<eq{ikA)>^
s(if{eq{ik,?>)Ad.b)^ce))-K{\lik)<eq{ik.^)yeq{ikA)>^Here we assume that ce is of the same sort as the pair {d,b).
3.3. The general equality theorem In this section, we are concerned with proving equality of solutions of C-LPOs 0 and ^. The C-LPO 0 defines an implementation and the C-LPO ^ defines the specification of a system. We use the cones and foci proof method of [24]. We assume that r-steps do not occur in the specification ^. We want to show that after abstraction of internal actions in a set Int the solution of 0 is equal to the solution of ^. We assume that 0 cannot perform an infinite sequence of internal actions. It turns out to be convenient to consider 0 where the actions in Int are already renamed to r. Hence, we speak about a C-LPO S which is 0 where actions in Int have been abstracted from (so - At some places clustered LPOs have been called deterministic. However, this is a bad name, as the process underlying a 'deterministic' LPO is not at all a deterministic process, i.e., a process that can for each action a always do at most one a transition.
Algebraic process verification
1177
Vnti^) = 3)' Note that S is convergent, and hence defines a process. We fix the C-LPOs S and ^ as follows (where the action names are taken from a set Act): S = Xp.kd'.Ds. J2
Yl
^{Md.ea))'p{gaid,ea))
oeAct ea'.Ea
^ =Xq.Xd:D^.
^ aGAct\[T}
J^ a{f;^(d.ea)) - qig'M^ea))
The issue that we consider is how to prove the solutions of S and ^ equal. The main idea of the cones and foci proof method is that there are usually many internal events in the implementation, but they are only significant in that they must progress somehow towards producing a visible event which can be matched with a visible event in the specification. A state of the implementation where no internal actions are enabled is called Si focus point, and there may be several such points in the implementation. Focus points are characterized by a Boolean condition on the data of the process called the focus condition. The focus condition FCs (d) is the negation of the condition which allows r actions to occur. The focus condition FCsid) is true if J is a focus point and false otherwise. DEFINITION 3.9. The focus condition FCs(d) of S is the formula --^e^.E, {bAd. Cj)). The cone belonging to a focus point is the part of the state space from which the focus point can be reached by internal actions; imagine the transition system forming a cone or funnel pointing towards the focus. Figure 1 in Section 1 visualizes the core observation underlying this method. The final element in the proof method is a state mapping h : DE -^ Dip between the data states of the implementation and the data states of the specification. It explains how the data parameter that encodes states of the specification is constructed out of the data parameter that encodes states of the implementation. This mapping is surjective, but almost certainly not injective, since the data of the specification is likely to be simpler than that of the implementation. So in this respect we have a refinement, but in terms of actions we have an equivalence. In order to prove implementation and specification rooted branching bisimilar, the state mapping should satisfy certain properties, which we call matching criteria because they serve to match states and transitions of implementation and specification. They are inspired by numerous case studies in protocol verification, and reduce complex calculations to a few straightforward checks. If these six criteria are satisfied then the specification and the implementation can be said to be rooted branching bisimilar under the General Equality Theorem (Theorem 3.11). The general forms of the matching criteria are given in Definition 3.10. Given the particular actions, conditions and mapping for a system, the matching criteria can be mechanically derived. Of course, the choice of mapping requires some thought, as does the subsequent proof of the criteria. Now we formulate the criteria. We discuss each criterion directly after the definition. DEFINITION 3.10. Let /i: D^ ^ Di// be a state mapping. The following criteria referring io S ,^ and h are called the matching criteria. We refer to their conjunction by C^.^M (d)-
1178
J.F. Groote, MA. Renters
For all er'.Er, a eAct\{r},
and ea'.Ea'.
(1)
S is convergent.
(2)
bAd.er)-^hid)
(3)
=
h{gr(d.er)).
ha{d,ea)^b[Xh{d)^ea).
(4)
FCE{d) A b'^(h{d). ea) ^ ba(d. ea).
(5)
baid^ ea) -^ faid,
(6)
baid, ea) -> h{ga{d, Ca)) = g, {h(d), ea).
€„) = fa{h(d),
€„).
Criterion (1) says that S must be convergent. In effect this does not say anything else than that in a cone every internal action r constitutes progress towards a focus point. Criterion (2) says that if in a state d in the implementation an internal step can be done (i.e., br(d, e^) is valid) then this internal step is not observable. This is described by saying that the state before the r-step and the state after the r-step both relate to the same state in the specification. Criterion (3) says that when the implementation can perform an external step, then the corresponding state in the specification must also be able to perform this step. Note that in general, the converse need not hold. If the specification can perform an a-action in a certain state e, then it is only necessary that in every state d of the implementation such that h{d) — e an «-step can be done after some internal actions. This is guaranteed by criterion (4). It says that in a focus point of the implementation, an action a in the implementation can be performed if it is enabled in the specification. Criteria (5) and (6) express that corresponding external actions carry the same data parameter (modulo h) and lead to corresponding states. Assume that r and q are solutions of E and ^, respectively. Using the matching criteria, we would like to prove that, for all d:D, Cs^ipjjid) impHes r(d) =q{h{d)). In fact we prove a more complicated result. This has two reasons. The first one is that the statement above is not generally true. Consider the case where J is a non-focus point of iS". In this case, r{d) can perform a r-step. Since q cannot perform r-steps, r{d) cannot be equal to q(h(d)). Therefore, in the setting of rooted branching bisimulation we can for non-focus points d only prove r • r(d) = T - q(h(d)). The second reason why we need a more complicated result is of a very general nature. A specification and an implementation are in general only equivalent for the reachable states in the implementation. A common tool to exclude non-reachable states is an invariant. Therefore we have added an invariant to the theorem below. For a proof of this theorem we refer to [24]. THEOREM 3.11 (General Equality Theorem). Let S be a C-LPO and let ^ be a C-LPO that does not contain r-steps. Let h be a state mapping. Assume that r and q are solutions of S and ^, respectively. If I is an invariant of S and lid) —> Cs.^.hid) for all d:Ds, then yd:DE{Kd)-^r(d)
=
q{h{d))
Algebraic process verification
1179
3.4. Pre-ahstraction and idle loops The proof strategy presented in the previous section can only be applied to systems for which the implementation is convergent. This is an all too serious restriction. In this section we present a generalization of the proof strategy which is also capable to deal with idle loops. The most important concept in this generalization is the pre-abstraction function. A preabstraction function divides the occurrences of the internal actions into progressing and non-progressing internal actions. The progressing internal actions are the ones for which the pre-abstraction function gives true and the non-progressing actions are the ones for which the pre-abstraction function gives false. DEFINITION 3.12. Let 0 be a C-LPO and let Int be a finite set of action names. A preabstraction function ^ is a mapping that yields for every action a e Int an expression of sort D X Ea -^ Bool. The partial pre-abstraction function ^ is extended to a total function on Act by assuming §(r)(^, Cr) = t and ^{a){d, Ca) = f for all « e Act \ Int.
The pre-abstraction function § defines from which internal actions we abstract. If the pre-abstraction function of an action yields true (progressing internal action), the action is replaced by r, while if the pre-abstraction function yields false the action remains unchanged. In a nutshell, the adaptation of the proof strategy is that instead of renaming all internal actions into r-actions we only rename the progressing internal actions. As a consequence the notions of convergence and focus point need to be adapted. Instead of considering r-actions, all internal actions involved in the pre-abstraction must be considered. 3.13. Let 0 be a C-LPO with internal actions Int and let § be a preabstraction function. The C-LPO (P is called convergent with respect to ^ iff there exists a well-founded ordering < on D such that for all a € /nf U {r}, (i:D and all ea'.Ea such that ^{a){d,ea)^Q have that ba{d, Ca) implies ga{d, ea)
DEFINITION 3.14. Let ^ be a pre-abstraction function. Tht focus condition of
3.15. Let 0 be a C-LPO over Ext U /nr U {r} (pairwise disjoint) and let ^ be a C-LPO over Ext. Let h : D(p -> Dip and let § be a pre-abstraction function. The following six criteria are called the matching criteria for idle loops and their conjunction is denoted by Cl^^ip^^^hid). For all / eIntU {r}, ^/:£'/, a e Ext, and ea'.Ea'. DEHNITION
(1)
0 is convergent with respect to §.
(2)
bi{d,ei)^h{d)
(3)
=
h{gi(d.ei)).
ba(d,ea)-^b[^{h(d),ea).
1180
J.F. Groote, MA. Renters
(4) (5)
FCsjnu^id) A b[Xh{d), ea) -^ ba(d. ea). baid, ea) -^ faid. €„) = f;,{h{d), e,),
(6)
ba{d. ea) -^ h{ga(d,
ea)) = g'a{h{d).
ea).
3.16 (Equality theorem for idle loops). Let ^ be a C-LPO over Ext U Int U {r} (pairwise disjoint) and ^ a C-LPO over Ext. Let h : Dcp -> Dxp and let ^ be a preabstraction function. Assume that r and q are solutions of
^d-.D^Kd)
^ T . Ti,u{r(d)) =
T-q{h{d))).
A proof of this theorem can be found in [24]. 4. Verification of the Serial Line Interface Protocol In this section we give a completely worked out example of a simple protocol to illustrate the use of /xCRL and the general equality theorem. The Serial Line Interface Protocol (SLIP) is one of the protocols that is very commonly used to connect individual computers via a modem and a phone line. It allows only one single stream of bidirectional information. Basically, the SLIP protocol works by sending blocks of data. Each block is a sequence of bytes that ends with the special end byte. Confusion can occur when the end byte is also part of the ordinary data sequence. In this case, the end byte is 'escaped', by placing an e s c byte in front of the end byte. Similarly, to distinguish an ordinary e s c byte from the escape character e s c , each e s c in the data stream is replaced by two e s c characters. In our modeling of the protocol, we ignore the process of dividing the data into blocks, but only look at the insertion and removal of e s c characters into the data stream. For simplicity we assume that all occurrences of end and e s c bytes have to be 'escaped'. We model the system by three components: a sender (5), inserting escape characters, a channel (C), modeling the medium along which data is transferred, and a receiver (/?), removing the escape characters (see Figure 2). We let the channel be a buffer of capacity one in this example. We use four data types Nat, Bool, Byte, and Queue to describe the SLIP protocol and its external behaviour. The sort Nat contains the natural numbers. With 0 and S we denote the zero element and the successor function on Nat as before. Numerals (e.g., 3) are used as abbreviations. The function eq: Nat x Nat -> Bool is true when its arguments represent the same number. The sort Bool contains exactly two constants t (true) and f (false) and we assume that all required Boolean connectives are defined in a proper way.
s
1
c
2
R
Fig. 2. Architecture of the SLIP protocol.
Algebraic process verification
1181
The sort Byte contains the data elements to be transferred via the SLIP protocol. As the definition of a byte as a sequence of 8 bits is very detailed and actually irrelevant we only assume about Byte that it contains at least two not necessarily different constants e s c and end, and a function eq: Byte x Byte -> Bool that represents equality. sort map
Byte e s c :^- Byte end :-> Byte eq: Byte x Byte -^ Bool
Furthermore, to describe the external behaviour of the system, we use the sort Queue as described in Section 2.1, but this time we take the elements of the queue from the sort Byte. Additionally, we use the auxiliary function len which yields the number of elements in a queue. sort map var rew
Queue len: Queue -> Nat b\Byte q: Queue /^n([]) = 0 len(in{b,q)) = S{len{q))
The processes are defined by guarded process declarations for the channel C, the sender S and the receiver R (cf. Figure 2). The equation for the channel C expresses that first a byte b is read using a read action r\ via port 1, and subsequently this value is sent via port 2 using action S2. After this the channel is back in its initial state, ready to receive another byte. The encircled numbers can be ignored for the moment. They serve to explicitly indicate the state of these processes and are used later. proc
C= @ ^
ri(^) • (^2{b) • @C
h:B\te
Using the r action the sender reads a byte from a protocol user, who wants to use the service of the SLIP protocol to deliver this byte elsewhere. It is obvious that if b equals e s c or end, first an additional e s c is sent to the channel (via action s\) before b itself is sent. Otherwise, b is sent without prefix. proc
5 = (0) ^
r{b) • Q^{S\ (esc) • (^\ {b) • (^
b\B\te
< eq{b, end) V eq{b, e s c ) > ^i (b) • (^S) The receiver is equally straightforward. After receiving a byte b from the channel (via ri) it checks whether it is an e s c . If so, it removes it and delivers the trailing end or e s c . Otherwise, it just delivers b. Both the sender and the receiver repeat themselves indefinitely, too.
1182
J.F. Groote, MA. Renters
h-.Byte
^^h'lByte
'
< eq{h, e s c ) > s{b) • (^R j
The SLIP protocol is defined by putting the sender, channel and receiver in parallel. We let the actions ri and 5^1 communicate and the resulting action is called c\. Similarly, r^ and S2 communicate into Q . comm
51 \r\ —c\ si\r2=
C2
The encapsulation operator 9(r, .^^, ^n.si] forbids the actions r\,s\,r2 and ^2 to occur on their own by renaming these actions to ^. In this way the actions are forced to communicate. The abstraction operation TJC, xi) abstracts from these communications by renaming them to the internal action r. For the SLIP protocol the external actions are r and s. proc
5L/P = T{e,.c2}(a{r,,.,,,-:..:}(5 II C II R))
We want to obtain a better understanding of the protocol, because although rather simple, it is not straightforward to understand its external behaviour completely. Data that is read at r is of course delivered in sequence at s without loss or duplication of data. So, the protocol behaves like a kind of queue. The reader should now, before reading further, take a few minutes to determine the size of this queue. Simultaneously, one byte can be stored in the receiver, one in the channel and one in the sender. If an e s c or end is in transfer, it matters in which of the processes it is stored. If the e s c or end byte is stored in the sender, no leading e s c is produced yet. Hence three bytes can be stored in this case. If the e s c or end byte is stored in the channel, it must have been sent there by the sender. Obviously the sender in this case has first sent a leading e s c byte. This byte is either stored in the receiver or removed by the receiver. In both cases the receiver contains no byte that is visible in the environment. Hence in this case at most two bytes can be stored. Finally, if the e n d or e s c byte is stored in the receiver, the leading e s c byte produced by the sender has been removed already by the receiver. Hence three bytes can be stored in this case (assuming that no other e s c or end byte is in transit). So, the conclusion is that the queue behaves as a queue of size three, except when an e s c or e n d occurs at the second position in the queue (the channel), in which case the size is at most two. For this purpose the auxihary predicate^// is defined. map full: Queue -> Bool var q: Queue rew
full{q) = eq{len{q), 3) V (eq(len(q), 2) A {eq{toe(untoe(q)), e s c ) V eq{toe(untoe(q)), end)))
Algebraic process verification
1183
Using this predicate we obtain the description of the external behaviour of the SLIP protocol below: If the queue is not full, an additional byte b can be read. If the queue is not empty an element can be delivered. proc
Spec{q: Queue) = ^
r{b)' Spec{in{b,q))
<'-fiilI(q)>8
h-.Byte
+ sl(toe(q)) • Spec[untoe(q)) < -'isemptyiq) > 8 The theorem that we are interested in proving is: THEOREM
4.1. We have SLIP = Spec([]).
PROOF. This follows directly from Lemma 4.2 and Lemma 4.4 that are given below.
D
We describe the Unear equation for SLIP. We have numbered the different summands for easy reference. Note that the specification is already linear. proc (a)
Linlmpl{bs - Byte, Ss: Nat, be: Byte, Sc: Nat, br: Byte, Sr: Nat) = y~^ r(b) • LinlmplQ), \,bc, Sc, br.s,-) <eq(Ss,0) > 8 b-.Byte
(b)
+ r • Linlmpl(bs, 2, e s c, 1, Z?,-, 5,-) <eq(Sc, 0) A eq(Ss, 1) A (eq(bs, end) v eq{bs, e s c ) ) > 8
(c)
+ r • Linlmpl(bs,0,bs,
l.br,Sr)
< eq(Sc, 0) A {eq(Ss, 2) V {eq(Ss, 1) A -^[eq{bs. end) V eq(bs, esc)))) >8 (d)
+ r • LinImpI(bs,Ss,bc. 0, Z?,, 1) < eqis,, 0) A eq{Sc, 1) > 5
(e)
4- r • LinlmpKbs, Ss, b,, 0, b,., 2) <eq{Sr, 1) Aeq(br, e s c ) Aeq(Sc, l)>8
(f)
-i-sibr)' LinlmpKbs, Ss, b,-, 5,-, b,-, 0) <^<7(5,-,2) V {eq{Sr, 1) A->eq(br, e s c ) ) > 5
We obtained this form by identifying three explicit states in the sender and receiver, and two in the channel. These have been indicated by encircled numbers in the defining equations of these processes. The states of these processes are indicated by the variables ^s, Sr and Sc respectively. Each of the three processes also stores a byte in certain states. The bytes for each process are indicated by ^s, br and b^. The T in summand (b) comes from abstracting from c\ (esc), in summand (c) it comes from c\ (bs), in (d) from C2(bc) and in (e) fromc2(^c)-
1184
IE Groote, MA. Renters
The following lemma says that LinlmpU the linear equation for SLIP, indeed equals the description of SUP. LEMMA
4.2. For any b\,b2, by. Byte it holds that Linlmpl{b\, 0, ^2, 0, Z73,0) = SUP.
We Hst below a number of invariants of Unlmpl that are sufficient to prove the results in the sequel. The proof of the invariants is straightforward, except that we need invariant 2 to prove invariant 3. LEMMA 4.3. The following expressions are invariants for Unlmpl. (1)
Ss^lASc^l
ASr
^2;
(2)
eqiss, 2) -^ {eqib,, esc) V eq(bs, end));
(3)
^eq(Ss,2)->
{{eq(sc, 0) A -^{eqis,-, 1) A eq(b,., esc))) V
{eq(sc, 1) A {{eq(Sr, 1) A eq{br, esc)) ^ {eq(bc, esc) v eq(bc, end))))) A eq(Ss,2) -^ {{eqisc. 1) A eq(bc, esc) A -^{eqis,, 1) A eq(br, esc))) V {eq(sc, 0) A eqisr, 1) A eq{br, esc))). The next step is to relate the implementation and the specification using a state mapping h : Nat x Byte x Nat x Byte x Nat x Byte -> Queue. For this, we use the auxiliary function cadd (conditional add). The expression caddie, b, q) yields a queue with byte b added to q if Boolean c equals true. If c is false, it yields q itself. map cadd: Bool x Byte x Queue -> Queue var b: Byte q: Queue rew cadd{\,b,q) = q cadd(t, b, q) = in(b, q) The state mapping is in this case:
= cadd[->eq(Ss,0), bs, cadd{eq(sc, 1) A (^eq{bc, esc) v
(^^(A-^,
1) A eq(br, e s c ) ) ) , b^
cadd{eq(sr,2) V {eq(Sr, 1) A -^eq{br, e s c ) ) , ^,-, [])))• So, the state mapping constructs a queue out of the state of the implementation, containing at most bs, be and br in that order. The byte bs from the sender is in the queue if the sender is not about to read a new byte {-^eq{ss,0)). The byte be from the channel is in the queue if the channel is actually transferring data (eq{Sc, 1)) and if it does not contain an escape
Algebraic process verification
1185
character indicating that the next byte must be taken hterally. Similarly, the byte br from the receiver must be in the queue if it is not empty and b,- is not an escape character. The focus condition of the SLIP implementation can easily be extracted and is (slightly simplified using the invariant):
{eq(Sc, 1) -> {-'eqisr, 0) A {eq(Sr, 1) -^ ^eqibr, esc)))). LEMMA 4.4.
Forallb\,b2,by.Byte
Spec{[ ]) = Linlmpl{b\, 0, Z72,0, Z?3,0). We apply Theorem 3.11 by taking Linlmpl for p. Spec for q and the state mapping and invariant provided above. We simplify the conclusion by observing that the invariant and the focus condition are true for Ss = 0, Sc = 0 and Sr = 0. By moreover using that /i(Z?i, 0, Z72, 0, ^3,0) = [ ], the lemma is a direct consequence of the generalized equation theorem. We are only left with checking the matching criteria: (1) The measure 13 — Ss — 3sc — 4^;^ decreases with each r step. (2) (b) Distinction on Sr; use invariant, (c) Distinguish different values of Ss; use invariant, (d) Trivial, (e) Trivial. (3) (a) Let s denote the tuple (bs,Ss,bc, 5,, br,Sr).We must show that Ss = 0 implies -^full(h(s)). From Ss = 0 and the definitions of h and full observe thai ful I {h(s)) can only be the case if 5^ = 1 A (be ^ e s c v (s,- = \ A br = e s c ) ) A (5^ = 2 v (sr = \ A br ^ esc)) and be = e s c v be = end. In all other cases we easily find that -^full{h{s)). If be = e s c we find br = e s c and 5, = 2. We also have Se = 1. Using the invariant we obtain be i^ e s c A be ^ end. This leads to a contradiction and therefore ->fullih(s)). If be = e n d then using the invariant we find that Sr = 1 and br = esc. This contradicts the above assumption. Therefore also in this case -^full(h(s)). (f) Trivial. (4) (a) Let s denote the tuple (bs,Ss,be,Se.br,Sr). We must show that if the focus condition and ->full{h(s)) hold, then eqiSs^O). The proof proceeds by deriving a contradiction under the assumption -^eqiSs.O). If eq(Ss, 1) it follows from the invariant and the focus condition that len(h(s)) = 3, contradicting that -'full(h(s)). If eq(ss,2), then len(h(s)) = 2, toe{untoe{h(s))) = bs and eq{bs, esc) Veq(bs, end) in a similar way. Also in this case this contradicts ->full(h(s)). (f) Let s denote the tuple {bs^Ss^be, Se, br,Sr). We must show that the invariant, the focus condition and the statement -^isemptyihis)) imply eq(sr, 2) v (eq(Sr, 1) A ->eq(br, e s c ) ) . Assume FC and, towards using contraposition, ->eq(sr, 2) A (-^eqisr, 1) v eq(br, e s c ) ) . Using the invariant we deduce eq(sr, 0) v (eqibr, e s c ) A eq(Sr, 1 )• By the second conjunct of the FC (contraposition), we obtain -^eq{Se, I), so by the invariant, eq{Se, 0), and by the first conjunct of FC, eq{ss,0) holds. By the definition of the state mapping h, we easily see that/z(?) = []. (5) (a) Trivial, (f) Use toe{cadd{c\, b\, caddici, Z?2, in{b^. [])))) = ^3(6) (a) Trivial using definitions, (f) Idem. D PROOF.
1186
J.F. Groote, MA. Renters
5. Calculating with n + 1 similar processes 5.1. Introduction Distributed algorithms are generally configured as an arbitrarily large but finite set of processors that run similar programs. Using /xCRL this can be neatly described. Assume that the individual processes are given by P(k), where k:Nat is the index of the process. The following equation puts n + 1 of these processes in parallel: Sysin:Nat) = P(0) <eq(n, 0) > {Sys(n - 1) || Pin)).
(2)
Clearly, the process Sys(n) stands for P(0) \\ P(\) || ... || P(n). We find descriptions along this line in verifications of the bakery protocol [17], Milner's scheduler [33], a leader election protocol [16], grid protocols [6], and a summing protocol [18]. The description in Equation (2) gives rise to two issues. The first one is whether the equation defines in a proper way that Sys is the parallel composition of the processes P{k). It is clear that the parallel composition of processes P(k) is a solution for Sys. In this section we show that, assuming the principle CL-RSP (see Definition 3.4), this is the only solution for Sys in (2). So, an equation in the form of (2) is indeed a proper definition. The second issue is to extract a linear process equation from the description in (2). We show in general terms how given a linear format for the processes P(k),a. process in linear format equivalent to Sys(n) can be given. 5.2. Linearization of two different parallel processes To provide the reader of this section with a basic understanding of the issues involved in the linearization of the parallel composition of processes, we provide a simple example first. Two LPEs will be composed and a linear process equation for their parallel composition will be given. We provide here the linearization of the parallel composition of two linear processes P(d) and P\d'). The parameters d and d' of certain arbitrary sorts D and D' denote the parameters of the LPEs. We assume that the processes are defined by linear equations of the following form:
and P\d':D') = E
E
<\f'M,
e',)). P'{g,(d\e\,))
i'eV e'r.E'.,
We also assume that these equations are convergent, since by CL-RSP this guarantees that they define unique processes.
Algebraic process verification
1187
Now consider the LPE Q{d, d') defined by the following equation: Q{d:D,d':D')
= 1 ] E'»'(/;W'^/)) • Q{gi(d,ei),d')
+ E
E
o:,{f;,id',e',)).Q{d,g',id',e'.,))
i'el' e'.r.E'.,
+E E E iel
i'el'ej-.Ei
E
y{ai{Md,e^)),a:,{f;.(d\e;,))).
e',:E', i
i
Q{gi{d.ei)^g'.,{d\e\,))
Ac\.{d\e],)>S.
The first summand describes the cases that an action from P{d) can be executed. The second summand describes the cases that an action from P'{d') can be executed. The third summand describes the cases that the two processes try to communicate. In each summand the change of the state is only due to the original processes involved in the action that is executed. Although the process Q is strictly speaking not an LPE, it is obvious that an LPE Q' can be given that is equivalent. This is left as an exercise to the reader. THEOREM
5.1. Let P, P\ and Q be the LPEs given above. For all d:D and d'.D' we
have P{d)\\P\d')
= Q{d^d').
5.3. Linearization ofparallel processes We shall now describe the linearization of « + 1 parallel linear processes P(k,d). The natural number k (0 ^ k ^ n) is the index of the process and the parameter d of some arbitrary sort D denotes the other parameters. We assume that each process P(k,d) is defined using a linear equation of the form: P(k:Nat,d:D) = ^^«/(/;(/:,^,^,))P(/:,g/(/:,t/,^/))
(3)
ejiEj
We also assume that this equation is convergent, as this guarantees that this equation defines a unique process. In order to define the parallel composition we need to determine the 'state space' of the LPE Q. The state space of Q is built from the state spaces of the LPEs P(k, d) that are composed in parallel. As we do not know in advance the number of processes composed (i.e., n) we define a new sort DTable, which is a table indexed by natural numbers containing elements of the sort D. In this table the kih entry represents the state space of process
1188
J.F. Groote, M.A. Reniers
P{k,d).\r\ order to do so, we also need an auxiliary function if: Bool x D x D ^- D for if — then — else. map var rew
if: Bool x D x D -^ D d,d':D if(ld,d')=d if{ld^d')=d'
In the sequel we assume an equality function eq:D x D -^ Bool. The constant emT of sort DTable is the empty table. The function upd places a new entry with an index in the table and the function get gets a specific entry from the table using its index. We characterize these operators by one single equation. Note that we do not specify what happens if an element is read from the empty table. We refer to the characterising axiom for tables as the table axiom. Besides this axiom, we use the fact that tables are generated from the empty table by the update function. This allows us the use of induction on these two operations. sort func
DTable emT: -^ DTable
upd :Natx D X DTable -> DTable map get:Nat X DTable^ D var n,m:Nat d'.D rew
dr. DTable get(n, upd{m, d, dt)) = if(eq{n, m), d, get{n, dt))
In the remainder we write dt{i] instead of get{i, dt). We can use the following process definition to put n of the processes P(k,d) in parallel. Sys{n. Nat, dt: DTable) = P(0, dt[0])<eq{n, 0) > {P(n, dt[n]) \\ Sys(n - \,dt)).
(4)
We assume that there is a commutative and associative communication function y that explains how two actions can synchronize. In case two actions do not synchronize it yields 8. In this section we assume the so-called handshaking axiom, that says that no more than two actions can synchronize. In other words, for all actions a\,a2 and a^, y ia\, y (a2, ai,)) — 8 (cf. [8]). In this section we work towards a linear description of Sys{n, dt) (Lemma 5.3). As a bonus we get that Sys(n,dt) has at most one solution (Corollary 5.5). We also provide an alternative transformed linear description which we believe to be more convenient in concrete instances (Theorem 5.6). The following lemma will be useful in the calculations in the sequel.
Algebraic process verification
1189
LEMMA 5.2. Forci,C2:Bool, d.dx.di.dy.D, m,m\,m2,n:Nat, anddt:DTable: (1) --(ci A Q ) -> if(ci, J i , if(c2, dj. ds)) = / / ( Q , ^2, (/'(<:'i, ^1, ^3)); (2) m > n~^ Sys{n,dt) — Sys(n, upd{m,d, dt)); (3) mx^mi-^ upd{m\,d\, upd(m2, d2,dt))[n] = upd{m2,d2,upd{m\,d\,dt))[n\ The first two facts are straightforwardly proven by induction on c\ and n, respectively. The last fact follows directly by the table axiom and the first item of this lemma. D PROOF.
Below we present the main lemma of this section. It gives an expansion of Sys. As has been stated above, we find the form of this expansion not very convenient as it has the condition k\ > k2 in its second group of summands. The more convenient form in Theorem 5.6 restricts the number of alternatives by requiring /2 ^ /i. However, contrary to the linearization in Theorem 5.6 we can prove this lemma by induction on n. LEMMA 5.3. The process Sys as defined in Equations (3) and (4) is a solution for Q in Equation (5) below. Q(n: Nat, dt: DTable) = J1 E iel
J^^i{fi(^^dt[klei))Q{n,upd{k,gi(k,dt[klei),dt))
k-.Nat eiiEi
+ E E E i\el
E
^n>8
E
E y^^'^'^-Mfhikudtik^ie^,))- (S)
/ S e / k\:Ncit kj.Nat e',j:E/, ei^-.E,^
Q{n, upd{k\, gi^ (k\, dt[kil ^/,), upd{k2. gi.(h. dt[k2l ^z.), dt))) < c/, (^1, dt[k\],
^/,) A Cj, (/C2, dt[k2],
eq{fii(k\,dt[k\lei^),
ei,) A
fi,(k2,dt[k2],ei.))
Ak\ >k2Ak\
^n>8.
LEMMA 5.4. Equation (5) is convergent. (3) is convergent, there is a well-founded relation < on Nat x D, such that if Ci(k,d,ei) and a, = T , then (k, gi(k,d,ei)) < (k,d). Using < we can define a well-founded relation -< on Nat x DTable as follows: PROOF. AS
(n\,dt\) < (n2,dt2) iff eq(n\,n2) AfoTMO^k^n\:(k, dt\ [k]) ^ (k, dt2[k]) A for some O^k ^n\ : (k,dt\ [k]) < (k, dt2[k]) where (k\,d\) ^ (^2,^2) iff (k\,di) < (A:2,^2). or eq(k\,k2) and ^^(^1, ^2)It is easy to see that ^ is a convergence witness for Equation (5). COROLLARY
5.5. Equation (4) has at most one solution for the variable Sys.
D
1190
J.F. Groote, MA. Renters
PROOF. Lemma 5.3 says that any solution for Sys in (4) is a solution for Q in (5). By Lemma 5.4 and CL-RSP there is at most one solution for Q in (5). Henceforth, Equation (4) has at most one solution, too. D
We consider the following theorem the main result of this section, as it provides a linear equivalent of Equation (4) that is easy to use and to obtain. We assume that there is a total reflexive ordering ^ on / . As / is an index set, this is a very reasonable assumption. 5.6. The process Sys as defined in Equations (3) and (4) is the {unique) solution for Q in the (convergent) equation below; so Sys(n, dt) = Q{n, dt) for all n\Nat and df.DTahle. THEOREM
Q(n:Nat,dt:DTable) = L iel
E
Ylai{f(k,dt[klei))Q{n,upd{k^gi{k,dt[klei),dt))
k:Nat €•,:£{
T.
T.
T.
T.
/1 € / / 2 e / A/T ^ / 1 k\ :Nat kj -Nat ei j : £ , ,
H
y(ai,.ai,){fu(kudt[k,lei,)y
ei^:Ej^
Q{n, upd{kx, gi, (ki, dt[kil a,), upd[k2, gh{ki, dt[k2l ^/.), dt))) < Ci^ {k\, dt{k\\ ^/,) A c/-, {ki. dt{k2\. e^) A eq{fi,{kx,dt[k\lei,), fi.{k2.dt[k2\.ei^)) A -^eqiki ,k2) Ak\ ^nAk2^n>8.
6. The Tree Identify Protocol of ffiEE 1394 in /xCRL We apply the cones and foci technique (Section 3.3) and the Unearization of a number of similar parallel processes (Section 5) to a fragment of the software for a high performance serial multimedia bus, the IEEE standard 1394 [29], also known as 'Tirewire". Briefly, IEEE 1394 connects together a collection of systems and devices in order to transport all forms of digitalized video and audio quickly, reliably, and inexpensively. Its architecture is scalable, and it is "hot-pluggable", so a designer or user can add or remove systems and peripherals easily at any time. The only requirement is that the form of the network should be a tree (other configurations lead to errors). The protocol is subdivided into layers, in the manner of OSI, and further into phases, corresponding to particular tasks, e.g., data transmission or bus master identification. Various parts of the standard have been verified using various formalisms and proof techniques. For example, the operation of sending packets of information across the network is described using /xCRL in [34] and shown to be faulty using E-LOTOS in [46]. The former is essentially a description only, with five correctness properties stated informally, but not formalized or proved. The exercise of [46] is based on the /xCRL description, adding another layer of the protocol and carrying out the verification as suggested, using the tool CADP [15].
AIgebraic process verification
1191
In this section we concentrate on the tree identify phase of the physical layer which occurs after a bus reset in the system, e.g., when a node is added to or removed from the network. The purpose of the tree identify protocol is to assign a (new) root, or leader, to the network. Essentially, the protocol consists of a set of negotiations between nodes to estabHsh the direction of the parent-child relationship. Potentially, a node can be a parent to many nodes, but a child of at most one node. A node with no parent (after the negotiations are complete) is the leader. The tree identify protocol must ensure that a leader is chosen, and that it is the only leader chosen. The specification of the external behaviour of the protocol merely announces that a single leader has been chosen. In the implementation, nodes are specified individually and negotiate with their neighbours to determine the parent-child relationship. Communication is by handshaking. These descriptions may be found in Section 6.1. They were derived with reference to the transition diagram in Section 4.4.2.2 of the standard [29]. We prove, using the cones and foci technique, that the implementation has the same behaviour with respect to rooted branching bisimulation as the specification, thereby showing that the implementation behaves as required, i.e., a single leader is chosen. The proofs may be found in Section 6.2. Several papers deal with the formal description and analysis of parts of the PI394 protocol. See, e.g., [13,34,46,48].
6.1. Description of the Tree Identify Protocol The /xCRL data definitions used here (e.g., Nat, NatSet, NatSetList) are assumed and not presented; they are straightforward and examples of these or similar types may be found in [34]. The most abstract specification of the tree identify protocol is the one which merely reports that a leader has been found. The network is viewed as a whole, and no communications between nodes are specified. We define Spec = leader- 8. In the description of the implementation each node in the network is represented by a separate process. Individual nodes are specified below as processes Node. Nodes are described by three parameters: • a natural number /: the identification number of the node. This is used to parameterize communications between nodes, and is not changed during any run of the protocol; • a set of natural numbers p: the set of node identifiers of potential parents of the node. The initial value is the set of all neighbours, decreasing to either a singleton (containing the parent node) or the empty set (indicating that the node is the elected leader); • a natural number 5: the current state of the node. We use two state values: 0 corresponds to "still working" and 1 to "finished". The initial value is 0. The identification number of nodes has been introduced to aid specification and does not appear in [29]. In reality a device has a number of ports and knows whether or not a port is connected to another node; there is no need for node identifiers.
1192
J.E Groote, MA. Renters
A node can send and receive messages: an action s{i, j) is the sending of a request by node / to node j to become its parent, and an action r(/, j) is the receiving of a parent request from node / by node j . When the nodes of the network are composed in parallel, these two actions synchronize with each other to produce a c action. An action c(/, j) is the establishment of a child-parent relation between node / and node 7, where / is the child and j is the parent. We define the actions and the communications by the following /xCRL specification: act
s,r,c: Nat x Nat leader
comm
s\r = c
If a node is still active and its set of potential parents is empty, it declares itself leader by the execution of the leader action. By definition, nodes in state 1 are equivalent to deadlock. An individual node with identification number / is defined by means of the process Node(i, p, s). The processes Node{i, p, s) are defined by the following LPE. DEFINITION 6.1 (Implementation of a node). Node{i: Nat, p: NatSet, s'.Nat) = leader • Node(i, /?, 1 ) < 5 ' = 0 A isempty(p) > 8 -f ^
r(jJ)'Node(i,p\{j],s)<s
= OAj e p>8
j -.Nat
-f- ^
s(i, j) 'Node{i, p,\) <s =0 /\ p = {j]> 8.
j -.Nat
The implementation then consists of the parallel composition of n -\- I nodes where the loose send and receive actions are encapsulated: H = {s,r}. This implementation is described by the process Imp(n, PQ), with PQ describing the configuration of the network: ImpiniNat, PQ:NatSetList) = dH{Nodes(n, Po)). where Nodes(n, PQ) = Node(0,
Po[OlO)
{Node(n, Po[nl 0) || Nodesin - 1, PQ)). Po is a list of sets of connections for all nodes indexed by node number; it gives the initial values for the sets of potential parents. Initially all nodes are in state 0.
6.2. Correctness of the implementation As mentioned earlier, the protocol operates correctly only on tree networks, i.e., under the assumption of a good network topology. Networks with loops will cause a timeout in the
A Igebraic process verification
1193
real protocol, and unconnected nodes will simply be regarded as another network. The property of GoodTopology is formalized below. 6.2. Given n:Nat, the maximal node identifier in the network, and a list Po'.NatSetList giving a set of neighbours for all nodes in the network, the conjunction of the following properties is called GoodTopology{n, PQ): • Po is symmetric: V,,y (/ e Po[j] ^ j e PQU]). • Po is a tree, i.e., it is a connected graph with no loops. DEFINITION
As a preliminary step to applying the cones and foci proof method, the process Spec defined in Section 6.1 must be translated into linear form. In order to do so, a data parameter must be added on which to base a state mapping from the data of process Imp. We define L-Spec(b:Bool) = leader • L-Spec(\) 8. Then, the process L-Spec(X) and the original specification Spec are equivalent. THEOREM
6.3. Let Spec and L-Spec be as above. Then L-Spec{\) = Spec.
PROOF. The following computation clearly establishes the equivalence: L-Spec(\) = leader • L-Spec{\) < t > 5 = leader • L-Spec(i) — leader • {leader • L-Spec{\) < f > 5) = leader • 5 = Spec. D
The linearization of Imp is given by the following LPE for L-Imp. L-Imp(n:Nat, P.NatSetList, S.NatList) = Y^ leader • L-Imp(\ / S[i]) < S[i] = 0 A isemptyiP[i]) Ai
^n>8
i -.Nat
+ Y.
c{j,i)L-Imp{(P[i]\[j})/P[i]MS[j])
iJ-.Nat
< S[j] = 0 A P[j] = {/} A S[i] = 0 A 7 € P[i] Ai^jAiJ^n>
8.
This linearization can be derived straightforwardly from the definition of individual nodes using the linearization technique of Section 5. 6.4. Let So'.NatList be the list of initial state values for the nodes, so for all i:Nat we have Soli] = 0. Then Imp(n, PQ) = L-Imp(n, PQ. SO)-
THEOREM
The proof of correctness also requires an invariant on the data states of the implementation. The invariant I(n, P, S) is the conjunction of the invariants listed below. These invariants hold in every state that can be reached from the initial state (n, PQ, So). The variables / and j are universally quantified over {0,...,«}. The notation singleton(X) represents the predicate |X| = 1, i.e., it expresses that the set X contains precisely one element. I,:
5[/] = 0 v 5 [ / ] = l .
1194
J.F. Groote, MA. Renters
I2:
jePdi]^jePmyieP[Jl
I3:
jePQmAJiP[i]^S[n
= \.
I4:
S[i] = 1 -> singleton(P[i]) v isempt}iP[i]).
I5:
7 e P[i] A 5[/] = 0 -> 5[7] = 0 A / € P[jl
The proofs of these invariants are straightforward, and omitted here. Invariant Ii expresses that each of the components is in state 0 or in state 1. Invariant I2 expresses that if the nodes / and j are connected initially, then at all times one is a potential parent of the other. This means that no connections are removed. Invariant I3 expresses that the potential parent relationship between a node j and a node / is only destroyed if / becomes the parent node of j . Invariant I4 states that if a node is done there is at most one potential parent left. Invariant I5 expresses that if a node is still busy and has another node as its potential parent then also this potential parent is still busy and considers the other node as a potential parent. The linearization of L-Imp is not sufficient to allow us to apply Theorem 3.11. A prerequisite for applying the cones and foci technique is that the indices of the alternative quantifications preceding a visible action must be the same in the specification and the implementation; clearly this is not the case. The summation over the node identifiers preceding the leader action in L-Imp correctly reflects that any node can be the root, i.e., there are multiple foci. However, it is not important which node is the root, only that one is chosen, and the Boolean condition guarding the leader action in L-Imp ensures that this is the case. We adapt the specification in such a way that the leader action there is also preceded by an alternative quantification over the node identifiers. Clearly the linear specification obtained in this way is equal to the old linear specification. L-Spec{b-^oo\) = y ^ leader • L-Speci^)
^n>8.
iiNat
The theorem to be demonstrated can now be stated as: THEOREM
6.5. Under the assumption ofGoodTopology(n, PQ) and I(n, PQ, "^O).
r • L-Spec(t) = z • T[,]{L-Imp{n, PQ, SO)). In the special case where n =0 (there is only one node in the network) we have L-Spec{\) = T{c}{L-Imp(n, PQ, SQ)), This is a direct instantiation of Theorem 3.11 with the initial state, because in the initial state the focus condition (defined below) is true if and only if n =0. In order to prove Theorem 6.5 the matching criteria must be satisfied. To show that the matching criteria hold we first define the focus condition and the state mapping for T{C}(L-Imp). The focus condition FC is the condition under which no more r steps can be made, i.e., it is the negation of the condition for making a r step: FC(n, P, S) = V/.,^,{S[i] = 1 V P[i] ^ {j} V S[j] = 1 V / ^ P[j] V / = 7).
Algebraic process verification
1195
The state mapping h is a. function mapping data states of the implementation into data states of the simple specification. In this case h is defined so that it is t before the visible leader action occurs and f afterwards: /i(n,P,5) = -(V,^„(S[/] = l)). If a node can do the leader action then all other nodes are in state 1. So, if a node declares itself the leader, then it is the first to do so, and because after this all nodes are in state 1, there will be no subsequent leader action. LEMMA 6.6 (Uniqueness of root).
yi^n{isempty{P[i])) ^ Vy^.O" ^ / ^ S[j] = 1). We assume nodes /, j ^n such that i i^ j /\ isempty{P[i]) A S[j] = 0, and derive a contradiction. By GoodTopology there is a path of distinct nodes / = / o . . . /,/, = y, such that V)t<,„ (ik^i € PoUk])' By h and isemptyiPUo]) we see that /Q e P[i\]. Then by I3 S[i\] = 1, and by I4 singleton{P[i\]). In a similar way we derive for all 0 < /: ^ m that PUk] = {ik-\} and S[ik] = 1. So in particular S[j] = 1. D PROOF.
The matching criteria. Given the particulars of L-Imp, L-Spec, FC and h, the matching criteria may be mechanically derived from the general forms of Definition 3.10. The instantiated matching criteria are stated below, together with the proofs that they hold. (1) The implementation is convergent. Each r step decreases the number of nodes / for which S[/] = 0 by one. (2) In any data state d = (n, P,S) of the implementation, the execution of an internal step leads to a state with the same /i-image. Suppose an internal action is possible, i.e., there are nodes /, 7 ^ n such that S[i] = 0 A P[i] = [j] A S[j] = 0 A / G P[j] A / ^ j . We see that S[i] = 0 and S[j] = 0 and hence h(d) = t. We have to show that if we reach a state d' = {n, P\ S') by the communication between nodes / and 7, then h{d') = t. We easily find that S'[k] = Slk] forO ^k ^n andk ^ j and S'[j] = 1. Hence S'[i] = 0. Therefore h(d') = t. (3) If the implementation can do the leader action, then so can the specification: (3/^„{S[i] = 0 A isempty{P[i]))) -^ 3,^,^7. Trivial. (4) If the specification can do the leader action and the implementation cannot do an internal action, then the implementation must be able to do the leader action: (3/^,,^) A FC ^ (3/^„ {S[i] = 0 A isempt}(P[i]))).
1196
J.F. Groote, MA. Renters
The specification can do the leader action if it is in a state where its only parameter b equals t. This means that for the corresponding state d in the implementation we have S[i] ^ 1 for some / ^ n. Using invariant Ii we thus obtain S[i] = 0. Now we only have to show that isempty(P[i]). So suppose that -*isempty(P[i]). Let i\ e P[i]. From invariant I5 it follows that S[ii] = 0 A / G P[i\l From FC A S[i] = 0 A S[i\] = 0 A /i € P[i] it follows that P[i\] 7^ {/}. Thus there exists n ^ P[i\], ii 7^ i such that S[i2\ = 0 A /i G P [ / 2 ] . In this way an infinite sequence / = /Q, i\, ii, 13,... can be constructed such that for all k.Nat we have S[k] = 0 A U G P[ik-\-\] A /^ 7«^ /^+2- By I2 we see that this infinite path is also a path in PQ. This contradicts GoodTopology. (5) The implementation and the specification perform external actions with the same parameter. Trivial; the action leader involves no data. (6) After the implementation and the specification perform the leader action, the mapping h still holds: if the implementation can reach data state d' by the execution of the leader action, then h{d') = f. Assume that the implementation can perform the leader action: i.e., S[i] = 0 A isempty{P[iY) for some i ^ n. Then also the specification can do the leader action by item (3) Hence b = t After the execution of the leader action the state of the specification is given by ^ = f. Then by Lemma 6.6 we see that all nodes other than / are in state 1. We also see that by the execution of the leader action the state of node / becomes 1. So after the action all nodes are in state 1, so then the value of h will be f. By Theorem 3.11 it follows that for all n, P, 5 I(n,P,S)
-^ L-Imp(n, P, S)
Instantiation of this equation gives I(n, Po, So) -^ L-Imp(n, PQ, So)
Algebraic process verification
1197
We felt that a more general treatment of the notion of confluence is in order. The first reason for this is that the treatment of confluence has always been somewhat ad hoc in the setting of process theory. This strongly contrasts with for instance term rewriting, where confluence is one of the major topics. In particular, we want to clarify the relation with z-inertness, which says that if 5^ —^—D> s\ then s and s' are branching bisimilar. The second reason is that we want to develop systematic ways to prove distributed systems correct in a precise and formal fashion. In this way we want to provide techniques to construct fault free distributed systems. For this purpose the language /xCRL is used. Experience with several protocols gave rise to the development of new and the adaptation of existing techniques to make systematic verification possible [4,5]. Employing confluence also belongs to these techniques. It appears to enable easier verification of distributed systems, which in essence boils down to the application of r-inertness. In Section 7.2, we address the relationship between confluence and r-inertness on transition systems. We introduce strong and weak confluence. We establish that strong confluence implies r-inertness and we establish that, for convergent transition systems, weak confluence implies r-inertness. To be able to deal with systems with idle loops, for instance communication protocols over unreliable channels, we distinguish between progressive and non progressive internal actions. This leads to a notion of weak progressive confluence that only considers the progressing internal actions. We find that weak progressive confluence is enough to guarantee r-inertness for transition systems that are convergent with respect to progressing internal steps. In Section 7.3, we direct our attention to establishing confluence. It does hardly make sense to establish confluence directly on transition systems, because these are generally far too large to be represented. Therefore, we try to establish confluence on processes described by LPEs [5] because these can represent large transition systems in a compact symbolic way. In Section 7.4, we show how we can use r-inertness and confluence to reduce state spaces both on transition systems and on linear processes. Finally, we provide an example illustrating that the application of confluence often reduces the size of state spaces considerably and simplifies the structure of distributed systems, while preserving branching bisimulation. This is in general a very profitable preprocessing step before analysis, testing or simulation of a distributed system.
7.2. Confluence and r-inertness Throughout this section we fix the set of actions A, which contains an internal action r. 7.1. A transition system is a pair (5, >) with S a set and > c. S x Ax S. The set of triples [> induces a binary relation —^^—[> c 5 x 5 for each a e A as follows: for all s,t e S v/e have (s, t) e -^^—t> iff (s,a, t) G —^—O. We write s -^^—t> t instead of {s, a,t) e \> and {s, t) e —^^—1>. The relation -^^—o c. S x S denotes the reflexive, transitive closure of the relation —^^—>. A transition system (S, >) is called convergent iff there is no infinite sequence of the form ^-i —^—o ^2 —^—> 53 —^H> • • •. DEFINITION
1198
J.F. Groote, M.A. Renters
A relation /? C 5 x 5' is called a branching bisimulation on (5, >) and (5', •) iff for all 5 € 5* and s' e S' such that sRs' we have (1) s -^~o> t-^ (a = T A rRs') v (3UM'(S' - ^ ^ u - ^ ^ w' A SRU A r/^M^). and (2) s' -^-^ t'-^{a = T A sRt') V (3,,.,,' (s - ^ M - ^ ^ - O M' AURS' A u'Rt')). We say that /? is a branching bisimulation on (5, >) iff /? is a branching bisimulation on (5, >) and (5, >). The union of all branching bisimulations is denoted as^^. Next, we present three different notions of confluence on transition systems, namely strong confluence, weak confluence and weak progressive confluence. We investigate whether or not these different notions of confluence are strong enough to serve as a condition for s —^-^t ^ s^ht
(6)
to hold. Transition systems that satisfy Equation (6) for all s,t e S are called r-inert with respect to ^^tf. DEHNITION 7.2. A transition system (5, >) is called strongly confluent iff for all pairs s —^—{> t and s —^—{> s^ of different steps there exists a state t' such that / —^-O t' and s' —^—{> rMn a diagram: a
-or I
V
rl
s' ->t' Omitting the word 'different' in Definition 7.2 would give a stronger notion. This can be seen as follows: the transition system represented by s —^-> t is strongly confluent, but would not be strongly confluent when the word 'different' was omitted. THEOREM
7.3. Strongly confluent transition systems are r-inert with respect to ^^h-
The converse of Theorem 7.3 is obviously not valid. A transition system that is r-inert with respect to ^^/,, is not necessarily strongly confluent. As a counter-example one can take the transition system t<-^—s-^->u.
(7)
This counter-example means that strong confluence is actually a stronger notion than we need since we are primarily interested in r-inertness (with respect to ^^h)- Hence we introduce a weaker notion of confluence, which differs from strong confluence in that it allows zero or more r-steps in the paths from t to t' and from s' to t'.
A Igebraic process verification
1199
DEFINITION 7.4. A transition system (5, o ) is called weakly confluent iff for each pair s -^-H> t and s —^—> s' of different steps one of the following holds: • there exist states t', rj, ^2 such that t - ^ ^ t' and s' - ^ ^ > t\ —^^-i> r2 -^—> ^'- In a diagram:
I
V
*
• a = T and there exists a state r' such that t ——> t' and s' ——> r^ In a diagram: 5
/
>t I
- -
->t'
Weak confluence is too weak to serve as a condition for Equation (6) to hold, i.e., weakly confluent transition systems are not necessarily r-inert with respect to ^^/,. However, if we also assume that the transition system is convergent, then weak confluence implies r-inertness. 7.5. Let (5, >) be convergent and weakly confluent, then (5, T-inert with respect to ^^b-
THEOREM
>) is
Theorem 7.5 relies on convergence of the transition system in question. However, many realistic examples of protocol specifications correspond to transition systems that are not convergent. As soon as a protocol internally consists in some kind of correction mechanism (e.g., retransmissions in a data link protocol) the specification of that protocol will contain an idle loop. Since we strongly believe in the importance of applicability to realistic examples, we considered the requirement that the transition system is convergent a serious drawback. Therefore, we distinguish, as in Section 3.4, between progressive internal actions, denoted by r> and non-progressive internal actions, denoted by T< . This enables us to formulate a notion of confluence, which is sufficiently strong for our purposes and only relies on convergence of the progressive r-steps. 7.6. We use the following notations: • s -^M> t for a progressive r-step from ^ to r, • s —^^-O t for a non-progressive r-step from s iot, • s - ^ - O t for s -^^-D> t or s -^^-o t.
CONVENTION
1200
J.F. Groote, MA. Renters
From now on we try to prove T>-inertness with respect to ^^/,, instead of r-inertness with respect to ^t- In a formula: s -^M> t -^ s^bt
(8)
It should be noted that the definition of branching bisimulation is not affected by the distinction of progressive and non-progressive r-steps. We first provide the definition of weak >-confluence. DEFINITION 7.7. A transition system (5, >) is called weakly >-confluent (pronounce: weakly progressive confluent) iff for each pair s —^^-O s' and s —^^—{> t of different steps one of the following holds: • there exist states t\ s[, ^2 such that t -^^-o t' and s -^^-D> s[ -^^-H> Sj -^^-O t\ or
• a = T and there exists a state t such that t -^^-t> t' and s -^^-C> t. THEOREM 7.8. Let {S, >) be >-convergentand weakly >-confluent, then (5, is T> -inert with respect to -^h-
>)
7.3. Confluence of linear process equations We want to use the notion confluence to verify the correctness of processes. In order to do so, we must be able to determine whether a transition system is confluent. This is in general not possible, because the transition systems belonging to distributed systems are often too large to be handled as plain objects. In order to manipulate with large state spaces, processes described by C-LPEs can be used as in these the state space is compactly encoded using data parameters. In this section we describe how a C-LPE can be shown to be confluent. In the next section we show how confluence is used to reduce the size of state spaces. Recall the definition of a clustered linear process equation of Definition 3.7. A clustered linear process equation is an expression of the form
^(^)= E ^«(/.(^,^.))-pUaW,^.))^..(^,^.)^5.
(9)
aeActeci.Ea
We assume that the internal action r (r> and r< if progressing and non-progressing T's are distinguished) has no data parameter. It is straightforward to see how a linear process equation determines a transition system. The process p{d) can perform an action a(fa(d,ea)) for every a e Act and every data element Ca of sort £«, provided the condition ba(d, Ca) holds. The process then continues as p(ga(d,ea)). Hence, the notions defined in the previous sections carry over directly. Thus, if ba(d, Ca) holds then ajJaicLea)) pW^^-^-^""-^Vp(g.(^,^.)).
AIgebraic process verification
1201
As we distinguish between progressing and non-progressing r's, we use the notion convergence with respect to the progressing r's (i.e., r>). 7.9. A clustered Hnear process equation as given in Equation (9) is called >-convergent iff there is a well-founded ordering < on D such that for all a e Act with a = T> and for all d:D, Ca'.Da we have that ba{d, ea) implies ga(d,ea)
Note that this definition of progressive convergence is in line with the normal notion of convergence (Definition 3.3) in the sense that only the progressive r-steps are considered. We provide sufficient criteria for p to be strongly confluent. Let p be the clustered linear process equation given in Equation (9). THEOREM 7.10. The process p as defined in Equation (9) is strongly confluent iffor all d'.D, a eAct, Ca'.Ea, ex'.Ej such that (i) if a = T then ga(d, Ca) ^ grid, Cr), (ii) ba{d,ea),and (iii) br(d,er) the following property holds: there exist e[^\Eci and e[:Ej such that fa{d,
Ca) = fa{gz{d,
Cj),
e[)
Aba{gT(d,ej),e'^) Abr{ga(d,ea),e[) A 8a {grid,
Cr), e^) = gr {ga(d, Ca). e'^).
The criteria can best be understood via the following diagram. p{d)
p(ga{d,ea))
^
t>p{gr{d,er))
>p(gT(ga(d,ea),e^))
=
piga{gT{d,er),eJ)
Note that in this diagram p(gaid,ea)) and p(gj(d,er)) are supposed to be different if a = r (see condition (i) in the above definition). Now that we have derived a rather simple condition for strong confluence we turn our attention to weak progressive confluence. This is more involved, because we must now speak about sequences of transitions. In order to keep notation compact, we introduce some notation. Let cr, a ' , . . . range over lists of pairs («, Ca) with a € Act and ea'.Ea- We define Gd{<^) with d e Dhy induction over the length of a: QdW = d, Qd{cr{a,ea)) = ga{Gcli
1202
J,R Groote, MA. Renters
Each a determines an execution fragment: pid)
>p{gA
"'^"'g'""'--""
>p{g4a{a,e,)))
determined by a
is the execution fragment determined by a (a, ea). This execution fragment is allowed for p(d) iff the conjunction Bd(cr) of all conditions associated to the actions in a evaluates to true. The Boolean Bdicr) is also defined by induction to the length of cr: Sj(X) = true, Bd{(r{a,ea)) = Bdicr) Aba{Gdicr),ea). We write 7ri(cr) for the sequence of actions that is obtained from a by applying the first projection to all its elements. For example, n\({a,eci){b,eh)) = ab. In the following theorem we provide sufficient criteria for a C-LPE p to be weakly >-confluent. Due to its generality the theorem looks rather complex. However, in those appUcations that we considered, the lists that are existentially quantified were mainly empty, which trivializes the main parts of the theorem. 7.11. The process p as defined in Equation (9) is weakly >-confluent if p is >-convergent and for all d:D, a eAct, ea'.Ea, Cr^'.Er^ such that (i) if a = r> then g«(d, Ca) ^ gT> W, ^r), (ii) ba(d,ea), and (iii) br^{d,erj the following property holds: there exist cr\,a2, cry, and e^j'.E'^^ such that
THEOREM
TTiCor/) = r* A fa(d,
for all i = 1,2, 3
Ca) = fa{Gg,^{d.er^)icr\).
e[)
^Bgaid,e,)(cr3)
ABg^^(d.er^)i(y)
where cr = cri {A, e'^)a2, or a = z and a — cr\a2.
7.4. State space reduction In this section, we employ the results about confluence and r-inertness that we have obtained thus far to achieve state space reductions and to simplify the behaviour of processes. First, we present the results on transition systems in general, and then on linear process equations. This is done as for transition systems the results are easy to understand. However, as argued in the previous section, the results can be applied more conveniently in the setting of hnear process equations.
Algebraic process verification
1203
DEFINITION 7.12. Let T\ = (5, >) and T2 = (S, • ) be transition systems. We call T2 a Tau-Prioretized-reduction {TP-reduction) of T\ iff
(i)
• c
[>,
(ii) for all s,s' eS'iis
-^—^ s' then s " • s' or s ^^ • 5" for some 5''.
Clearly, Tj can be obtained from T\ by iteratively removing transitions from states as long as these keep at least one outgoing progressive r-step. It does not need any comment that this may considerably reduce the state space of T\, especially because large parts may become unreachable. The following theorem says that if T\ is r> -inert with respect to -^h, then a TP-reduction maintains branching bisimulation. As confluence implies r-inertness, this theorem explains how confluence can be used to reduce the size of transition systems. 7.13. Let T\ = (5, >) and Ti = (5, • ) be transition systems. IfT\ is T>-inert with respect to -^h cind Ti is a >-convergent TP-reduction of T\ then for each state s e S: s-^hs. THEOREM
As has been shown in the previous section, weak >-confluence can relatively easy be determined on C-LPEs. We provide a way to reduce the complexity of a C-LPE. Below we reformulate the notion of a TP-reduction on C-LPEs. We assume that /? is a C-LPE according to Equation (9) and that the data sort Er is ordered by some total ordering <. DEHNITION
7.14. The TP-reduction of p is the linear process
Pr(d)= ^
^a{fa{d,ea))'Pr{8a(d,ea))
a eAct €(,:£(,
where \--^er^:ErJea<er^
Ab(d,erJ)
ifa^T>, ifa = T>.
Note that for the sake of conciseness, we use an existential quantification in the condition Ca(d,ea), which does not adhere to the formal definition of fxCRL. THEOREM
7.15. If the linear process p is >-convergent and weakly >-confluent, then for
alld'.D p{d)^hPr{d). 7.5. An example: Concatenation of two queues We illustrate how we apply the theory by means of an example, where the structure of the processes is considerably simplified by a confluence argument. Consider the following Hnear process Qiqx.qi) describing the concatenation of two queues q\ and qi. The architecture of this process is given in Figure 3.
1204
J,F. Groote, MA. Renters ^('•) J — ;Qi; — I
^
I — -Q2 n—I
<••)
Fig. 3. Architecture of the concatenation of the queues.
Qiqx.qi) =
^r{d)'Q[in{d,q\),q2)<true>S d:D
+ r • Q(untoe{q\), in(toe{q\),q2))
<-'isempty(q\)>8
-\-s[toe(q2)) • Q{q\,untoe(q2)) <-'isempty(q2) > S. As we can see, the process Q{q\,q2) can always read a datum and insert it in ^i. If ^2 is not empty then the 'toe' of q2 can be sent. The internal action r removes the first element of ^1 and inserts it in ^2. Using Theorem 7.10 we can straightforwardly prove that l2(^i, ^2) is strongly confluent. Let us consider the strong confluence in more detail with respect to the read action r{d). Q(q\, qi)
> Q(untoe(q\), in(toe(q\), ^2))
r(d)\ V
Qiin(d,q\),q2) This situation can only occur if both the read action rid) and the r action are enabled: t and —^isemptyiqx). To establish strong confluence in this specific case we must find: Q(untoe{q\)Jn{toe{q\),q2)) I
nd') I
Q(in(d\ untoe{q\)), in{toe{q\),q2)) Q(in(d,q\),q2)
- -->
Q{untoe{in{d,q\))Jn(toe(in(d,q\)),q2))
for some d'.D such that the data parameters of the two read actions are equal {d = d'). Furthermore, we need that the states resulting after the execution of these actions are equal. The state after the r{d') action is given by (in{d\ untoe(q\)), in(toe(q\), ^2)) and after the T action by (untoe(in(d, q\)), in(toe(in(d, q\)), ^2)) respectively. With the observation that the equality of states is defined to be pairwise equality we obtain the following condition: for all queues q\,q2 and d:D -^isempty{q\)^3d':D
i d = d' A -^isempty{in(d,q\)) A in{d\untoe{q\))
— untoe(in(d, q\))
A in(toe(q\), ^2) = in{toe[in{d, ^i)), ^2) ).
Algebraic process verification
1205
Similarly, we can formulate the following conditions for the action s. For all queues —>isempty{q2) A -^isempty{q\) -> ( toe{q2) = toe{in(toe(q\),qi)) A —^isempty{in(toe{q\), qi)) A ->isempty(q\) A untoe(q\) = untoe{q\) A untoe{in{toe{q\), qi)) = m(ro^(^i), untoeiqi)) ). With the appropriate axioms for queues, the validity of these facts is easily verified. For the a = r we find that the precondition a = r -^ ga{d,ea) ^ grid.er) is instantiated to T = T -^ (untoe{q\) 7^ untoe(q\) v in{toe{q\), q2) i^ in{toe{q\), ^2)). which is a contradiction. Now, by Theorem 7.15, the following TP-reduced version (see Definition 7.14) of Q(^\, qi) is branching bisimilar to Q(q\, qi)Qriqx.qi) = ^ ^ W ) • Qr{in(d,q\),q2)
d:D
-f r • Qr{untoe{q\), in{toe(q\),q2)) <-^isempty{q\) >8 -f s{toe{q2)) • Qr{q\, untoeiqi)) < -^isemptyiq2) A isempty{q\) > 8. Note that after the TP-reduction q\ never contains more than one element!
Acknowledgements We would like to thank Harm van Beek, Michiel van Osch, Piet Rodenburg, and Mark van der Zwaag for their valuable comments on several versions of this chapter.
References [1] H.P. Barendregt, The Lambda Calculus, North-Holland (1981). [2] M.A. Bezem, R.N. Bol and J.F. Groote, formalizing process algebraic verifications in the calculus of constructions. Formal Aspects of Comput. 9 (1997), 1^8. [3] H. Bekic, Towards a mathematical theory of processes. Technical Report TR25.125, IBM Laboratory, Vienna (1971). [4] M.A. Bezem and J.F. Groote, A correctness proof of a one-bit sliding window protocol in pCRL, The Comput. J. 37 (4) (1994), 289-307. [5] M.A. Bezem and J.F. Groote, Invariants in process algebra with data, CONCUR'94: Concurrency Theory, Uppsala, Sweden, Lecture Notes in Comput. Sci. 836, B. Jonsson and J. Parrow, eds. Springer-Verlag (1994), 401-416.
1206
IF. Groote, MA. Renters
[6] J.A. Bergstra, J.A. Hillebrand and A. Ponse, Grid protocols based on synchronous communication, Sci. Comput. Programming 29 (1997), 199-233. [7] J.A. Bergstra and J.W. Klop, Process algebra for synchronous communication. Inform, and Control 60 (1-3) (1984), 109-137. [8] J.C.M. Baeten and W.P Weijland, Process Algebra, Cambridge Tracts in Theoret. Comput. Sci. 18, Cambridge University Press (1990). [9] K.M. Chandy and J. Misra, Parallel Program Design: A Foundation, Addison-Wesley (1989). [10] CWI, jiCRL: A language and toolset to study communicating processes with data (2000). http://www.cwi. nlTmcrl/. [11] J.W. de Bakker and E. de Vink, Control Flow Semantics, MIT Press (1996). [12] G. Dowek, A. Felty, H. Herbelin, G. Huet, C. Murthy, C. Parent, C. Paulin-Mohring and B. Werner, The Coq proof assistant user's guide. Version 5.9, Technical Report, INRIA-Rocquencourt and CNRS-ENS Lyon (1993). [13] M.C.A. Devillers, W.O.D. Griffioen, J.M.T. Romijn and F.W. Vaandrager, Verification of a leader election protocol -formal methods applied to IEEE 1394, Technical Report, Computing Science Institute, University ofNijmegen(1997). [14] H. Ehrig and B. Mahr, Fundamentals of Algebraic Specification: Equations and Initial Semantics, EATCS Monographs on Theoret. Comput. Sci. 6, Springer-Veriag (1985). [15] J.-C. Fernandez, H. Garavel, A. Kerbrat, R. Mateescu, L. Mounier and M. Sighireanu, CADP (CAESAR?ALDEBARAN Development Package): A protocol validation and verification toolbox, Proc. CAV'96, Lecture Notes in Comput. Sci. 1102, R. Alur and T.A. Henzinger, eds. Springer-Veriag (1996), 437-440. [16] L.-A. Fredlund, J.F. Groote and H. Korver, Formal verification of a leader election protocol in process algebra, Theoret. Comput. Sci. 177 (1997), 459^86. [17] J.F. Groote and H. Korver, Correctness proof of the bakery protocol in p.CRL, Algebra of Communicating Processes, Workshops in Computing, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Springer-Veriag (1994), 63-86. [18] J.F. Groote, F Monin and J. Springintveld, A computer checked algebraic verification of a distributed summing protocol. Technical Report 97/14, Department of Mathematics and Computing Science, Eindhoven University of Technology (1997). [19] J.F Groote, F Monin and J. van de Pol, Checking verifications of protocols and distributed systems by computer, Proc. CONCUR'98, Sophia Antipolis, Lecture Notes in Comput. Sci. 1466, D. Sangiorgi and R. de Simone, eds. Springer-Veriag (1998), 629-^55. [20] J.F. Groote and A. Ponse, Proof theory for fxCRL: A language for processes with data. Semantics of Specification Languages, Proceedings of the International Workshop on Semantics of Specification Languages, Utrecht, The Netheriands, 25-27 October 1993, Workshops in Computing, D.J. Andrews, J.F. Groote and C.A. Middelburg, eds. Springer-Veriag (1994), 232-251. [21] J.F. Groote and A. Ponse, The syntax and semantics of fiCRL, Algebra of Communicating Processes, Utrecht 1994, Workshops in Computing, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds, SpringerVerlag (1995), 26-62. [22] J.F Groote, A note on n similar parallel processes, ERCIM Workshop on Formal Methods for Industrial Critical Systems, S. Gnesi and D. Latella, eds, Cesena, Italy (1997), 65-75. [23] J.F Groote, The syntax and semantics of timed fiCRL, Technical Report SEN-R9709, CWI, Amsterdam (1997). [24] J.F. Groote and J. Springintveld, Focus points and convergent process operators. A proof strategy for protocol verification. Technical Report 142, University Utrecht, Department of Philosophy (1995). [25] J.F. Groote and M.P.A. Sellink, Confluence for process verification, Theoret. Comput. Sci. 170 (1-2) (1996), 47-81. [26] J.F. Groote and J.C. van de Pol, A bounded retransmission protocol for large data packets. A case study in computer checked verification, Proc. AMAST'96, Munich, Germany, Lecture Notes in Comput. Sci. 1101, M. Wirsing and M. Nivat, eds, (1996), 536-550. [27] C.A.R. Hoare, Communicating Sequential Processes, International Series in Comput. Sci., Prentice-Hall International (1985). [28] G.J. Holzmann and D. Peled, An improvement informal verification, Proc. FORTE '94, Berne, Switzerland (1994).
Algebraic process verification
1207
[29] IEEE Computer Society, IEEE Standard for a high performance serial bus (1996). [30] ITU-T, Recommendation Z.IOO: Specification and Description Language (SDL), ITU-T, Geneva (June 1994). [31] K. Jensen, Coloured Petri Nets. Basic Concepts, Analysis Methods and Practical Use, EATCS Monographs on Theoret. Comput. Sci., Springer-Verlag, Beriin (1992). [32] J.J.T. Kleijn, M.A. Reniers and J.E. Rooda, A process algebra based verification of a production system, Proc. 2nd IEEE Conference on Formal Engineering Methods, Brisbane, Australia, December 1998, J. Staples, M.G. Hinchley and S. Liu, eds, IEEE Computer Society Press (1998), 90-99. [33] H. Korver and J. Springintveld, A computer-checked verification ofMilner's scheduler, Proc. Intemat. Symposium on Theoretical Aspects of Computer Software (TACS'94), Sendai, Japan, Lecture Notes in Comput. Sci. 789, M. Hagiya and J.C. Mitchell, eds. Springer-Veriag (1994), 161-178. [34] S.P. Luttik, Description and formal specification of the link layer of PI 394, Technical Report SEN-R9706, CWI, Amsterdam (1997). [35] N.A. Lynch, Distributed Algorithms, Morgan Kaufmann (1996). [36] A. Mazurkiewicz, Basic notions of trace theory. Linear Time, Branching Time and Partial Orders in Logics and Models for Concurrency, Lecture Notes in Comput. Sci. 354, J.W. de Bakker, W.-P de Roever and G. Rozenberg, eds. Springer-Veriag (1988), 285-363. [37] R. Milner, A mathematical model of computing agents. Proceedings Logic Colloquium 1973, H.E. Rose and J.C. Shepherdson, eds, North-Holland (1973), 158-173. [38] R. Milner, A Calculus of Communicating Systems, Lecture Notes in Comput. Sci. 92, Springer-Veriag (1980). [39] R. Milner, Communication and Concurrency, International Series in Computer Science, Prentice-Hall International (1989). [40] S. Mauw and G.J. Veltink, A process specification formalism, Fundamenta Informaticae XIII (1990), 85139. [41] L.C. Paulson, Isabelle: the next 700 theorem provers. Logic and Computer Science, P. Odifreddi, ed.. Academic Press (1990), 361-386. [42] L.C. Paulson, Isabelle: A Generic Theorem Prover, Lecture Notes in Comput. Sci. 828, Springer-Veriag (1994). [43] I.C.C. PhilUps, Refusal testing, Theoret. Comput. Sci. 50 (1987), 241-284. [44] H. Qin, Efficient verification of determinate processes, CONCUR'91, Proc. 2nd International Conference on Concurrency Theory, Amsterdam, The Netherlands, Lecture Notes in Comput. Sci. 527, J.C.M. Baeten and J.F. Groote, eds. Springer-Veriag (1991), 471^94. [45] W. Reisig, Petri Nets: An Introduction, EATCS Monographs in Theoret. Comput. Sci. 4, Springer-Veriag, Berlin (1985). [46] M. Sighireanu and R. Mateescu, Validation of the link layer protocol of the IEEE-1394 serial bus (EireWire): An experiment with E-LOTOS, Technical Report 3172, INRIA (1997). [47] N. Shankar, S. Owre and J.M. Rushby, The PVS proof checker: A reference manual Technical Report, Computer Science Laboratory, SRI International, Menlo Park, CA (1993). [48] C. Shankland and M.B. van der Zwaag, The tree identify protocol of IEEE 1394 in pCRL, Formal Aspects of Comput. 10 (1998), 509-531. [49] R.J. van Glabbeek, The linear time - branching time spectrum, CONCUR'90 - Theories of Concurrency: Unification and Extension, Amsterdam, Lecture Notes in Comput. Sci. 458, J.C.M. Baeten and J.W. Klop, eds. Springer-Veriag (1990), 278-297. [50] R.J. van Glabbeek, The linear time - branching time spectrum II. The semantics of sequential processes with silent moves, CONCUR'93, Proc. International Conference on Concurrency Theory, Hildesheim, Germany, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer-Veriag (1993), 66-81. [51] J.J. van Wamel, Verification techniques for elementary data types and retransmission protocols, Ph.D. Thesis, University of Amsterdam (1995). [52] G. Winskel, Event structures, Petri Nets: Applications and Relationships to Other Models of Concurrency, Lecture Notes in Comput. Sci. 255, Brauer, Reissig and G. Rozenberg, eds. Springer-Veriag (1987), 325392.
1208
J.F. Groote, MA. Renters
Subject index >-convergence, see convergence, progressive
General Equality Theorem, 1177, 1178
abstract data type, 1154 abstraction, 1169, 1170 action, 1162 -internal, 1169 - - non-progressing, 1179, 1199 - - progressing, 1179, 1199 action name, 1162 alternative quantification, 1165
idle loop, 1179, 1199 induction, 1159 invariant, 1175
branching bisimulation, 1198 communication function, 1170 communication merge, 1171 composition -alternative, 1162, 1163 -parallel, 1169 -sequential, 1162, 1163 Concrete Invariant Corollary, 1175 conditional operator, 1164, 1165 cone, 1177 cones and foci, 1176 confluence -strong, 1198 -weak, 1198, 1199 - weak progressive, 1198 convergence -progressive, 1201 convergent, 1175, 1179, 1197 Convergent Linear Recursive Specification Principle, 1175
left merge, 1171 linear process equation, 1173, 1186 -clustered, 1200 linear process operator, 1173 -clustered, 1176 Linear Recursive Definition Principle, 1175 matching criteria, 1177, 1179 pre-abstraction function, 1179 renaming, 1172 solution, 1175 state mapping, 1177 state space, 1173, 1200, 1202 state space reduction, 1202 state transformation, 1173 sum elimination, 1168 sum operator, see alternative quantification summand inclusion, 1163, 1168
encapsulation, 1168, 1169
r-inertness, 1198 T>-inertness, 1200 r<, see non-progressing, internal, action r>, see progressing, internal, action TP-reduction, 1203 transition system, 1197, 1200
focus condition, 1177, 1179 focus point, 1177
weak >-confluence, see confluence, weak progressive
deadlock, 1163, 1164
CHAPTER 18
Discrete Time Process Algebra and the Semantics of SDL J.A. Bergstrai'3, C.A. Middelburg^'^*, Y.S. Usenko^* Programming Research Group, University of Amsterdam, P.O. Box 41882, 1009 DB Amsterdam, The Netherlands " Computing Science Department, Eindhoven University of Technology, P.O. Box 513, 5600 MB Eindhoven, The Netherlands ' Department of Philosophy, Utrecht University, P.O. Box 80126, 3508 TC Utrecht, The Netherlands ^ Cluster of Software Engineering, CWl P.O. Box 94079, 1090 GB Amsterdam, The Netherlands E-mails: [email protected], [email protected], [email protected]
Contents 1. Introduction 1.1. Background 1.2. Organization of this chapter 2. Process algebra 2.1. Introduction 2.2. Discrete relative time process algebra 2.3. Propositional signals and conditions 2.4. Recursion 2.5. Counting process creation 2.6. State operator 3. Overview of (^~SDL 3.1. Introduction 3.2. System definition 3.3. Process behaviour 3.4. Values 3.5. Miscellaneous issues 3.6. Examples 4. Semantics of (^~SDL 4.1. Introduction 4.2. Actions and conditions 4.3. Semantics of process definitions
1211 1211 1213 1214 1214 1214 1217 1224 1226 1227 1229 1229 1229 1231 1233 1233 1234 1237 1237 1238 1240
*The work presented in this chapter has been partly carried out while the second and third author were at UNU/IIST (United Nations University, International Institute for Software Technology) in Macau. HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved 1209
1210 4.4. Examples 4.5. Interaction with states 4.6. Semantics of system definitions 5. Closing remarks 5.1. Related work 5.2. Conclusions and future work A. Notational conventions B. Contextual information Acknowledgements References Subject index
JA. Bergstra et al. 1243 1245 1256 1259 1259 1261 1262 1263 1265 1265 1266
Abstract We present an extension of discrete time process algebra with relative timing where recursion, propositional signals and conditions, a counting process creation operator, and the state operator are combined. Except the counting process creation operator, which subsumes the original process creation operator, these features have been developed earlier as largely separate extensions of time free process algebra. The change to the discrete time case and the combination of the features turn out to be far from trivial. We also propose a semantics for a simplified version of SDL, using this extension of discrete time process algebra to describe the meaning of the language constructs. This version covers all behavioural aspects of SDL, except for communication via delaying channels - which can easily be modelled. The semantics presented here facilitates the generation of finitely branching transition systems for SDL specifications and thus it enables validation.
Discrete time process algebra and the semantics of SDL
1211
1. Introduction In this chapter, we present an extension of discrete time process algebra with relative timing where recursion, propositional signals and conditions, a counting process creation operator, and the state operator are combined. We also propose a semantics for a simplified version of SDL, called <^~SDL, using this extension of discrete time process algebra with relative timing to describe the meaning of the language constructs. The choice of a process algebra in the style of ACP [8,9] as the basis of the presented semantics is obvious. This algebraic approach to concurrency represents a large body of relevant theory. In particular, many features of (p~SDL are related to topics that have been studied extensively in the framework of ACP. Besides, the axiom system and operational semantics of an ACP-style process algebra facilitate advances in the areas of validation and verification. We take the remainder of this introductory section to introduce (^~SDL, to motivate the choices made in the selection of this dramatically simplified version of SDL, and to describe its close connection with full SDL. We also explain the need for a semantics that deals properly with the time related aspects of SDL in case one intends to validate SDL specifications, or to justify design steps made using SDL by formal verification.
1.1. Background At present, SDL [ 10,18] is widely used in telecommunications for describing structure and behaviour of generally complex systems at different levels of abstraction. It originated from an informal graphical description technique already commonly used in the telecommunications field at the time of the first computer controlled telephone switches. Our startingpoint is the version of SDL defined in [33], the ITU-T Recommendation Z.IOO published in 1994. There, a subset of SDL, called Basic SDL, is identified and used to describe the meaning of the language constructs of SDL that are not in Basic SDL. This subset is still fairly complicated. (p~SDL is a simplified version of Basic SDL.' The following simplifications have been made: • blocks and channels are removed; • all variables are revealed and they can be viewed freely; • timer setting is regarded as just a special use of signals; • timer setting is based on discrete time. Besides, (p~SDL does not deal with the specification of abstract data types. An algebraic specification of all data types used in a (/>~SDL specification is assumed as well as an initial algebra semantics for it. The pre-defined data types Boolean and Natural, with the obvious interpretation, should be included. We decided to focus in (p~SDL on the behavioural aspects of SDL. We did so for the following two reasons. Firstly, the structural aspects of SDL are mostly of a static nature and therefore not very relevant from a semantic point of view. Secondly, the part of SDL that deals with the specification of abstract data types is well understood - besides, it can ' This subset is called (p SDL, where (p stands for flat, as it does not cover the structural aspects of SDL, and ' indicates that delaying channels are left out.
1212
J.A. Bergstra et al
easily be isolated and treated as a parameter.^ For practical reasons, we also chose not to include initially procedures, syntypes with a range condition and process types with a bound on the number of instances that may exist simultaneously. Similarly, the any expression is omitted as well. Services are not supported by (p~SDL for the following reasons: the semantics of services is hard to understand, ETSI forbids for this reason their use in European telecommunication standards (see [31]), and the SDL community discusses its usefulness. In [14], we introduced a simplified version of SDL, called (^SDL, which covers all behavioural aspects of SDL, including communication via delaying channels. (p~S\yL is (^SDL without communication via delaying channels. The process algebra semantics of ^SDL proposed in [14] made clear that (^SDL specifications can always be transformed to semantically equivalent ones in ^~SDL. Apart from the data type definitions, SDL specifications can be transformed to (pSDh specifications, and hence to (p'SDL specifications, provided that no use is made of facilities that are not included initially. The transformation from SDL to (pSDL has, apart from some minor adaptations, already been given. The first part of the transformation is the mapping for the shorthand notations of SDL which is given informally in the ITU-T Recommendation Z.IOO [33] and defined in a fully precise manner in its Annex F.2 [34]. The second and final part is essentially the mapping extract-diet defined in its Annex F.3 [35]. The semantics of (^~SDL agrees with the semantics of SDL as far as reasonably possible. This means in the first place that obvious errors in [35] have not been taken over. For example, the intended effect of SDL's create and output actions may sometimes be reached with interruption according to [35] - allowing amongst other things that a process ceases to exist while a signal is sent to it instantaneously. Secondly, the way of dealing with time is considered to be unnecessarily complex and inadequate in SDL and has been adapted as explained below. In SDL, real numbers are used for times and durations. So when a timer is set, its expiration time is given by a real number. However, the time considered is the system time which proceeds actually in a discrete manner: the system receives ticks from the environment which increase the system time with a certain amount (how much real time they represent is left open). Therefore, the timer is considered to expire when the system receives the first tick that indicates that its expiration time has passed. So nothing is lost by adopting in (^"SDL a discrete time approach, using natural numbers for times and durations, where the time unit can be viewed as the time between two ticks but does not really rely upon the environment. This much simpler approach also allows us to remove the original inadequacy to relate the time used with timer setting to the time involved in waiting for signals by processes. We generally had to make our own choices with respect to the time related aspects of SDL, because they are virtually left out completely in the ITU-T Recommendation Z.IOO. Our choices were based on communications with various practitioners from the telecommunications field using SDL, in particular the communications with Leonard Pruitt [26]. ^ The following is also worth noticing: (1) ETSI discourages the use of abstract data types other than the predefined ones in European telecommunication standards (see [31]); (2) ASN.l [32] is widely used for data type specification in the telecommunications field, and there is an ITU-T Recommendation, Z. 105, for combining SDL and ASN.l (see [36]).
Discrete time process algebra and the semantics of SDL
1213
They provided convincing practical justification for the premise of our current choices: communication with the environment takes a good deal of time, whereas internal processing takes a negligible deal of time. Ease of adaptation to other viewpoints on time in SDL is guaranteed relatively well by using a discrete time process algebra, PA^^^ (see [5]) without immediate deadlock, as the basis of the presented semantics. In the telecommunications field, SDL is increasingly used for describing generally complex telecommunications systems, including switching systems, services and protocols, at different levels of abstraction - from initial specification till implementation. Initial specification of systems is done with the intention to analyse the behavioural properties of these systems and thus to validate the specification. There is also a growing need to verify whether the properties represented by one specification are preserved in another, more concrete, specification and thus to justify design steps. However, neither SDL nor the tools and techniques that are used in conjunction with SDL provide appropriate support for validation of SDL specifications and verification of design steps made using SDL. The main reason is that the semantics of SDL according to the ITU-T Recommendation Z.IOO is at some points inadequate for advanced validation and formal verification. In particular, the semantics of time related features, such as timers and delaying channels, is insufficiently precise. Moreover, the semantics is at some other points unnecessarily complex. Consequently, rules of logical reasoning, indispensable for formal verification, have not yet been developed and most existing analysis tools, e.g., GEODE [2] and SDT [37], offer at best a limited kind of model checking for validation. Prerequisites for advanced validation and formal verification is a dramatically simplified version of SDL and an adequate semantics for it. Only after that possibilities for advanced analysis can be elaborated and proof rules for formal verification devised. The language (p~SDL and the presented semantics for it are primarily intended to come up to these prerequisites. 1.2. Organization of this chapter The structure of this chapter is as follows. In Section 2, we present the extension of discrete time process algebra with relative timing that is used for the process algebra semantics of (p~SDL proposed in Section 4. An overview of <^~SDL is given in Section 3. Following the overview, in Section 4, we present the proposed semantics of (p~SDL in two steps. First, a semantics of (p~SDL process definitions, which are the main elements of (p~SDL specifications, is given. This semantics abstracts from dynamic aspects of process behaviour such as process creation and process execution in a state. A semantics of (p~SDL system definitions, i.e. complete (p~SDL specifications, is then given in terms of the semantics of <^~SDL process definitions using the counting process creation operator and the state operator. In Section 5, we give an overview of related work and we explain how the semantics presented in Section 4 can be used to transform (p~SDL specifications to transition systems that can be used for advanced validation. There are appendices about notational conventions used (Appendix A) and details concerning the contexts used to model scope in the presented semantics (Appendix B). Small examples of specification in (p~SDL and the meaning of the process definitions being found in these examples are also presented (in Section 3 and Section 4, respectively).
1214
J.A. Bergstra et al.
2. Process algebra 2.1. Introduction In this section, we present an extension of discrete time process algebra with relative timing where recursion, propositional signals and conditions, a counting process creation operator, and the state operator are combined. Its signature, axioms and a structural operational semantics are given and it is shown that strong bisimulation equivalence is a congruence for all operations. Except the counting process creation operator, which subsumes the original process creation operator, these features have been developed earlier as largely separate extensions of time free process algebra. However, both the change to the discrete time case and the combination of the features turn out to be far from trivial. Besides, some of the features are slightly adapted versions of the original ones in order to meet the needs of the semantics of (p~SDL. In Section 2.2, we present discrete relative time process algebra without immediate deadlock and delayable actions (PA^j^-ID). In Section 2.3, we add propositional signals and conditions to PAJ^^-ID. In the discrete relative time case, this addition requires some axioms to be refined. We introduce a new guarded command operator that yields a deadlock in the current time slice if the condition does not hold at the start, i.e. waiting is no option if the condition does not hold. In Section 2.4, we add recursion to the extension presented in Section 2.3. The main definitions related to recursion, such as the definitions of recursive specification, solution and guardedness, are given here for the case with relative timing in discrete time as well as propositional signals and conditions. In Section 2.5 and 2.6, we describe the counting process creation operator and the state operator, respectively, for the discrete relative time case in the presence of propositional signals and conditions. The counting process creation operator is a straighforward extension of the original process creation operator that allows to assign a unique "process identification value" to each process created. The state operator presented here allows to deal with conditions whose truth depends on the state and with state changes due to progress of time to the next time slice. The main reference to discrete time process algebra in the style of ACP is [5]. The features with which it is combined here are discussed as separate extensions of time free process algebra in [6] (propositional signals and conditions, state operator), [8] (recursion) and [11] (process creation). Our discussion of axioms is concentrated on the crucial axioms for the discrete time case and each of these features, and on the alterations and additions needed if all this is combined. For a systematic introduction to process algebra in the style of ACP, the reader is referred to [8] and [9].
2.2. Discrete relative time process algebra In this subsection, we present discrete relative time process algebra without immediate deadlock and delayable actions. The term discrete time is used here to indicate that time is divided into time slices and timing of actions is done with respect to the time slices in which they are performed - within a time slice there is only the order in which actions
Discrete time process algebra and the semantics of SDL
1215
are performed. Additionally, performance of actions and passage to the next time slice are separated here. This corresponds to the two-phase functioning scheme for modeling timed processes [25]. Note that it means that processes are supposed to be capable of performing certain actions, like in time free process algebra, as well as passing to the next time slice. A coherent collection of versions of ACP with timing where performance of actions and passage of time are separated, is presented in [7]. First we treat the basic discrete relative time process algebra BPA^j^-ID. Then we treat PA^j^-ID, the extension of BPAJj^-ID with parallel composition in which no communication between processes is involved. ACPJ^^-ID, the extension of BPA^^^-ID with parallel composition in which synchronous communication between processes is involved, will not be treated. BPA^^^-ID, PA^^^-ID and ACP^^-ID are presented in detail in [27]. We also present the extension of PA^^^-ID with encapsulation, described before for the discrete relative time case without immediate deadlock in [4]. 2.2.1. Basic process algebra. In BPA^^^-ID, we have the sort P of processes, the constants a (one for each action a) and 5, the unary operator drei (time unit delay), and the binary operators • (sequential composition) and -h (alternative composition). The constants a stand for a in the current time slice. Similarly, the constant 5 stands for a deadlock in the current time slice. The process crrei(x) is the process x delayed till the next time slice. The process x • y is the process x followed after successful termination by the process y. The process x -h j is the process that proceeds with either the process x or the process y, but not both. We also have the auxiliary unary operator Vrei (now) in BPA^^^-ID. This operator makes an elegant axiomatization of PA^^^-ID possible. The process Vre\(x) is the part of x that is not delayed till the next time slice. It is assumed that a fixed but arbitrary set A of actions has been given. SIGNATURE OF B P A ^ ^ - I D . The signature of BPAJ^-ID consists of the undelayable action constants a.^^P (for each a e A), the undelayable deadlock constant ^ : —> P, the alternative composition operator -h: P x P -> P, the sequential composition operator •: P X P ^- P, the time unit delay operator (Jrei: P -^ P, and the now operator Vrei : P -> P-
We assume that an infinite set of variables (of sort P) has been given. Given the signature of BPAJj^-ID, terms of BPAJ^^-ID, often referred to as process expressions, are constructed in the usual way. The need to use parentheses is reduced by ranking the precedence of the operators. Throughout this chapter we adhere to the following precedence rules: (i) all unary operators have the same precedence, (ii) unary operators have a higher precedence than binary operators, (iii) the operator • has the highest precedence amongst the binary operators, (iv) the operator + has the lowest precedence amongst the binary operators, and (v) all other binary operators have the same precedence. We will also use the following abbreviation. Let (/7,)/eX be an indexed set of terms of BPA^^-ID where J = {/i, . . . , / „ } . Then we write Yliei Pi for /?,, + ... + p,,,. We further use the convention that J^i^i Pi standsfor^ if J = 0. We denote variables by jc, jc', y, y', We use the convention ihaia,a\ b,b\ ... denote elements of A U {8} in the context of an equation, but elements of A in the context of an operational semantics rule. Furthermore, H denotes a subset of A. We write As for A U {5}.
1216
J.A. Bergstra et al Table 1 Axioms of BPA~j^-ID {a e A^) x+y = y+x Al (x + j ) + z = jc + (V + Z) A2 x-\-x=x A3 (x + y)-z=x-z + y-z A4 (^.>;).Z = ;c-(v-z) A5
<7relU)+^rel(v) = ^relU + >) DRTl Ore\ ix) • v = arei(jc • v) DRT2 ^^=4 DRT3 jc-f^ = ;c DRT4A Vrei(^)=g DCSl Vrel(x + y) = Vrel(-^) + ^rel(>') DCS2 Vrei(x • y) = Vrel(x) • y DCS3 yrei(tTreia))=^ DCS4
AXIOMS OF BPA^^^-ID. The axiom system of BPA^^-ID consists of the equations A l A5, DRT1-DRT4A and DCS1-DCS4 given in Table 1.
Axioms DRTl and DRT2 represent the interaction of time unit delay with alternative composition and sequential composition, respectively. Axiom DRTl, called the time factorization axiom, expresses that passage to the next time slice by itself can not determine a choice. Axiom DRT2 expresses that timing is relative to the performance of the previous action. In [27], a structural operational semantics of BPA^j^-ID is presented and proofs are given of the soundness and completeness of the axiom system of BPA^j^-ID for the set of closed BPA^j^-ID terms modulo (strong) bisimulation equivalence. This notion is precisely defined in [8]. Roughly, bisimilarity of two processes means that if one process is capable of doing a certain step, i.e. performing some action or passing to the next time slice, and next going on as a certain follow-up process then the other process is capable of doing the same step and next going on as a process bisimilar to the follow-up process. 2.2.2. Parallel composition. In PA^^^-ID, we have, in addition to sequential and alternative composition, parallel composition of processes. In PA^^^-ID, unlike in ACP^j^-ID, parallel composition does not involve communication between processes. The parallel composition operator || of PA^^^-ID is called free merge to indicate that no communication is involved. The process jc || >^ is the process that proceeds simultaneously with the processes X and y. In order to get a finite axiomatization, we also have the auxihary operator [[ (left merge) in PA^^^-ID. The processes x ^y and x || y are the same except that x ^y must start with a step of x. SIGNATURE OF P A ^ ^ - I D . The signature of PA~j^-ID is the signature of BPA^^^-ID extended with iht free merge operator ||: P x P -^ P and the left merge operator [[: P x P -^ P.
We will use the following abbreviation. Let {pi)iei be an indexed set of terms of PA^^^-ID where J = {/i,..., /„}. Then, we write ||/gj pi for p,, || ... || pi„.
Discrete time process algebra and the semantics of SDL
1217
Table 2 Additional axioms for PAT^-ID {a e A^)
^II>' = ^IL>'4->'1L^ a^x^aa-xly {x + y)lz
DRTMl DRTM2
X =
a-{x\\y) =
DRTM3 DRTM4
xlz^ylz
DRTM5 ^relU) IL (^rel(v) + crrel(^)) =-<^re\ixlz] » DRTM6
(Jre\{x) \iVxe\iy) = ^
Table 3 Axioms for encapsulation {a e A^) dH(^ = gifo^H
DRTDl
a//(g)=^ if«G//
DRTD2
dH (X • y) = dH (x) • dn (V)
DRTD3
9// ix-\-y) = dH{x)-^ dH (y) DRTD4 dnicTrelix)) = GrelidHix))
DRTD5
AXIOMS OF PAJ^^-ID. The axiom system of PA^j^-ID consists of the axioms of BPA^^-ID and the equations DRTM1-DRTM6 given in Table 2.
Axioms DRTM5 and DRTM6 represent the interaction between time unit delay and left merge. These axioms express that passage to the next time slice of parallel processes must synchronize. In [27], a structural operational semantics of PAJ^-ID is presented and proofs are given of the soundness and completeness of the axiom system of PAJ^^-ID for the set of closed PA^j^-ID terms modulo (strong) bisimulation equivalence. 2.2.3. Encapsulation. We extend the signature of PAJ^-ID w^ith the encapsulation operator 3// : P -> P. This operator turns all undelayable actions g, where ^ in // C A, into undelayable deadlock. The encapsulation operator is defined T)y the equations DRTDlDRTD5 given in Table 3. An operational semantics of encapsulation is presented in [4].
2.3. Propositional signals and conditions In [6], process algebra with propositional signals and conditions is introduced for the time free case. In this subsection, we adapt it for discrete relative time. The result is referred to by PA^^^. In later sections, we will call propositional signals "propositions" in order to avoid ambiguity with signals of (^"SDL.
1218
J.A. Bergstra et al.
In process algebra with prepositional signals and conditions, propositions are used both as signals that are emitted by processes and as conditions that are imposed on processes to proceed. Condition testing is looked upon as signal inspection. The intuition is that the signal emitted by a process, as well as each of its logical consequences, holds at the start of the process. The signal emitted by a process is called its root signal. Like in the time free case we have -L (non-existence) as additional constant and ^ (root signal emission) and :^- (guarded command) as additional operators. Like the constant 5, the constant ± stands for a process that is incapable of doing any step and incapable of terminating successfully. In addition, going on as _L after performing an action is impossible. The process 0 ^ jc is the process x where the proposition (p holds at its start. Broadly speaking, the process 0 :-> jc is the process that may proceed as the process VreK^) if the proposition 0 holds at its start, but may also proceed as the process crrei(0 '-^ y) in case X = Vrei(^) + cr^eiiy)' In Other words, with the guarded command operator :->, it is possible to wait till a proposition holds. This agrees with the original intention of the operator to make actions conditional. We also have a non-waiting version of the guarded command operator, namely the operator ;-> (strict guarded command). The process 0 ;-> jc is the process that proceeds as the process x if the proposition 0 holds at its start, and otherwise yields a deadlock in the current time slice. Both guarded commands agree with the one in the time free case for processes that are not capable of passing to the next time slice. Lifting prepositional signals and conditions to the discrete time case requires the axioms for left merge to be adapted. If these axioms are not adapted, the equation cfreiix W_y) =§. becomes derivable - unless axiom NEl (Table 5) is not adopted. Without adaptations, the root signal of ;c [[ }^ would be the root signal of the process x. With the chosen adaptations, the root signal of jc [[ j is the conjunction of the root signals of the processes x and y. Thus, different from the time free case, the process jc [[ j is neither capable of performing an action nor capable of passing to the next time slice if the root signal of y is equal to f. This difference is not relevant to the free merge operator because the root signal of x || j is the conjunction of the root signals of x and y anyhow. It is assumed that a fixed but arbitrary set B^t of atomic propositions has been given. From now on we have, in addition to the sort P of processes, the sort B of propositions over Bau with constants t, f (true, false) and operators -i, v, A, ->, <-> (negation, disjunction, conjunction, impHcation, bi-implication). In case ^at is empty, B represents the boolean algebra over the set B = {t, f}. We denote propositions by 0, i/r,.... In derivations we may always use logical equivalences of (classical) prepositional logic. So we are actually using equivalence classes of formulas, with respect to logical equivalence, instead of the formulas themselves. A valuation v of atomic formulas is a function i; : ^at -^ ®- Any valuation v can be extended to B in the usual homomorphic way, i.e.: V(K) = K for the constants K e {t, f}, i;(-.0) = -.i;(0), i;(0 o\l/) = u(0) o v{\lf) for the binary operators (9 € {v, A, ->, <->}. We will use the same name for a valuation i; and its extension to B. If a proposition 0 is satisfied by a valuation v (u(0) = t), we write i; |= 0 to indicate this.
Discrete time process algebra and the semantics of SDL
1219
SIGNATURE OF PA^^^ The signature of VP^^^ is the signature of the PA^^-ID extended with the encapsulation operator, the non-existence constant _L : -> P, the strict guarded command operator ;-^ : B x P -> P, the root signal emission operator /^ : B x P ^- P and the weak guarded command operator :->: B x P -> P. AXIOMS OF PA^^"". The axiom system of Vk^^^ consists of the axioms of BPAJ^-ID and the equations DRTMl, DRTM4 from Table 2, the equations DRTM2', DRTM3\ DRTM5\ DRTM6' from Table 4, the equations NE1-NE3 from Table 5, the equations SGC1-SGC6, MSGC from Table 6, the equations SRSE1-SRSE7, MSRSE from Table 7, the equations DCS5, DCS6, DRTM7 from Table 8, the equations DGC1-DGC8 from Table 9, the equations DRTD1-DRTD5 from Table 3, and the equations PD1-PD3 from Table 10.
The axioms A3, DRT3 and DRT4A of BPA'^^-ID (Table 1) are derivable from the axioms SGCl, SGC2, SGC4 and SGC6 (Table 6). Table lable 4 4 Adapted axioms for left merge {a e A^) glx=g-x^-3A
(vreiU))
g'Xly=g-{x\\y)
DRTM2'
+ dA (vrel(y))
DRTM3'
^relU) li vrel(v) = 3^ (Vrel(v))
DRTM5'
o^relU) IL (v^rel(y) + ^rel(::)) = Ore\{x H ::) + 3 ^ (Vrel(y)) DRTM6'
Table 5 Axioms for non-existence iaeA^) jc + ± = _L N E l ±-JC = ±
NfE2
a-L = 8
NE3
Table 6 Axioms for strict guarded command SGCl SGC2
t-^-JC = X f:^jc = 5
0 :-^ U + V) : = {(t>yyjf)\^
( 0 : ^ X) + ( 0 ; ^ y) SGC3
jc = ( 0 :-^ x) + (xlr :-> x) SGC4
cP\-^ixJf':~ • JC) = ( 0 A V^) i^- ^ 0 :-> U • y) = ( 0 : ^ Jc) • y (0 i-^ X) iLy = 0 :-> (jc IL y)
SGC5 SGC6 MSGC
1220
J.A. Bergstra et al. Table 7 Axioms for root signal emission {(i)^x)y
= (t)^{xy)
SRSEl
(0 ^ jc) + >' = 0 ^ (x + v) SRSE2 (P^(xfr ^x) = {(f>A^I/)^x SRSE3 t ^ x = jc SRSE4 i^x = ± SRSE5 (l)\^{^J/ ^x) = {(p-^xj/)^ {(f) :^ x) SRSE6 (j)^{(f)\-^x)=(t)^x SRSE7 (0/*;c) l[y = (^^(;c |[v) MSRSE
Table 8 Additional axioms for time unit delay and now operator v^relC*/* \~^x) = (f) \-^ VreiU)
DCS5
yrel(0'^^) = 0^i^re(U) DCS6 orrel(^) IL ((0 : ^ V) H- Z) = (0 :-^ KelU) L (v + z))) + ( - 0 \-^ (^relU) IL z)) DRTM7
Table 9 Axioms for weak guarded command {a e A^) ^ =^
DGCl
•g =
DGC2
- (£. A:) = (0 :-^ ^ • jc
DGC3
• (xj/l^ x) = xj/ :-^ (0 :-^ j )
DGC4
0 :-^ U + v) = (0 : ^ x) + (0 : ^ y) DGC5 0 : ^ (Trei (x) = arei{
DGC6
0 : ^ VrelU) = v^rel(0 : ^ x) (f> :-^ (if/ ^ x) = x{/ ^ ((() :-^ x)
DGC7 DGC8
Table 10 Additional axioms for encapsulation SH(4>':-^x) = (P\-^dH(x) PDl a/y(0:->x) = 0:->a/y(jc) PD2 a//(0^jc) = 0^a//(A) PD3
The axioms DRTM2', DRTM3\ DRTM5' and DRTM6' (Table 4) are the axioms DRTM2, DRTM3, DRTM5 and DRTM6 of PA~^-ID (Table 2) where a summand is added to the right hand side of the axioms, viz. 9/^(vrei(-^)) in case of DRTM2 and dA(vTe\(y)) in
Discrete time process algebra and the semantics of SDL
1221
case of the other axioms. Thus is expressed that the root signal of the left merge of two processes is always the conjunction of the root signals of both processes. The axioms NE1-NE3, SGC1-SGC6, SRSE1-SRSE7, MSGC and MSRSE (Tables 5 7) are straightforward reformulations of corresponding axioms for the time free case, i.e. axioms of PAps, given in [6]. The constants a and the constant 8 have been replaced by the constants a and the constant 5, respectively; and the operator :-^ has been replaced by the operator i^-. The axioms NEl and NE2 (Table 5) are derivable from the axiom Al of BPAJ^-ID and the axioms SRSEl, SRSE2 and SRSE5 (Table 7). Axiom NE3 expresses that going on as _L after performing an action is impossible. We do not have arei(J-) = 5, an equation expressing that going on as _L after passing to the next time slice is impossible. The reason is that arei(jc) = ^ would become derivable. In view of this mismatch between a • _L and arei(JL), in retrospect, axiom NE3 may be considered to be a wrong choice in [6]. Axiom SRSE5 expresses that a process where falsity holds at its start is non-existent. The crucial axioms are SRSE6 and SRSE7 which represent the interaction between the root signal emission operator and the strict guarded command. Axiom SRSE6 expresses that if a proposition holds at the start of a process and that process is guarded by another proposition then at the start of the whole the former proposition holds or the latter proposition does not hold. Axiom SRSE7 expresses that it is superfluous to guard a process by a proposition if the proposition holds at the start of the whole. The additional axioms DCS5, DCS6 and DRTM7 (Table 8) are needed because propositional signals and conditions are lifted to the discrete time case. The strict guarded command is non-waiting, i.e. we do not have 0 i^- crrei(jc) = arei(0 :-> x). Root signal emission is non-persistent, i.e. we do not have 0 ^ cTrQ\(x) = arei(0 ^ x). Axiom DRTM7 is necessary for the elimination of parallel composition. This axiom expresses that if processes are capable of passing to the next time slice conditionally then their parallel composition can do so if all conditions concerned hold. Note that from DRTM7 we can derive crre\(x) I ((t>':-> y) = (l> \-^ (crre\(x) [L j ) -
The axioms DGC1-DGC8 (Table 9) define the weak guarded command with which, unlike with the strict guarded command, it is possible to wait till a proposition holds. From these axioms we can derive X = Vre\(x) =^ (p:-^ X = X = Vre\{x) + arel(>^) ^
((pl^x)-hdA(Vre\M)
(f) :^ x = ((p [^ Vrel(x)) "h are\((p :-> >') + dA(Vre\ix))
which gives a full picture of the differences between the two guarded commands. SEMANTICS OF PA^^^. We shall give a structural operational semantics for PA^^^^ using rules in the style of Plotkin to define the following unary and binary relations on the closed terms of PA^^^:
a unary relation a binary relation a binary relation a unary relation
_ - ^ y/ _- ^ _ _ -^^ _ i; G [Sp (_)]
for each valuation for each valuation for each valuation for each valuation
These relations can be explained as follows:
v and a e A, v and a e A, u, v.
1222
J A. Bergstra et ai
t - ^ y/\
under valuation f, t is capable of first performing a in the current time slice and then terminating successfully; t - ^ t'\ under valuation u, t is capable of first performing a in the current time slice and then proceeding as r'; t - ^ t': under valuation D, r is capable of first passing to the next time slice and then proceeding as r'; V e [Sp{t)\. V makes the root signal of t true. The rules have the form ^ ' ' " '
^^ s, where s is optional. They are to be read as "if p\
and ...and pm then c\ and ...and c„, provided s'\ As usual, p\,..., Pm and c\, ...,Cn are called the premises and the conclusions, respectively. The conclusions are positive formulas of the form t - ^ y/, t - ^ t\ t - ^ r' or i; € [Sp(r)], where t and t' are open terms of PA^^^. The premises are positive formulas of the above forms or negative formulas of the form t - ^ . A negative formula t - % means that for all closed terms t' of PAj^'^ not t - ^ t'. The rules are actually rule schemas. The optional ^ is a side-condition restricting the valuations over which v ranges, the actions over which a ranges, the propositions over which (f) ranges, and the sets of actions over which H ranges. If m = 0 and there is no side-condition, the horizontal bar is left out. The signature of PA^^^ together with the rules that will be given constitute a term deduction system in panth format as defined in [29]. It is known from [29] that if a term deduction system in panth format is stratifiable, (strong) bisimulation equivalence is a congruence for the operators in the signature concerned. For a comprehensive introduction to rule formats guaranteeing that bisimulation equivalence is a congruence, the reader is referred to [1]. Let r be a term deduction system and PF(r) be the set of positive formulas occurring in the rules of T. Then a mapping S : PF(r) -^ a for an ordinal a is called a stratification P for T if for all rules — of T, formulas c in C, and closed substitutions a the following C conditions hold: for all positive formulas p in P, S{a{p)) ^ S{a{c))\ for all negative formulas t-^R in P, S{a{tRt')) < S(a(c)) for all closed terms t'; for all negative formulas -^Pt in P, S(aiPt)) < S(a{c)). Recall that the rules that will be given are actually rule schemas. Within the framework of term deduction systems, the instances of the rule schemas that satisfy the stated sideconditions should be taken as the rules under consideration. For the rest, we continue to use the word rule in the broader sense. A structural operational semantics of PA^^^ is described by the rules given in Tables 11, 12, 13 and 14. Note that we write / -^ instead of r -> - ^ ^ . All rules are in panth format. In order to prove the fact that strong bisimulation is a congruence, we only have to find a stratification. We define a stratification S as follows: S(t ^ ^ rO = n+(r) and S(t - ^ ^/) = Sit ^ ^ t') = S(v e [Sp(r)]) = 0,
Discrete time process algebra and the semantics of SDL Table 11 Rules for basic operators of PA^|!|^ {a ^ A) v.a
g I'.rt X
. .
(^reM v.a
,
X
> V
v.a
I
X
/
/ > V
(P\~^
^V
-^'
> X
,
>X
X
TTTT—7^N0
v.a
1
> q> : - ^ x i
—-—TTTT-T^N^ (p'^x v.a
V, u€[Sp(v)] I
X v.a
we[sp(y)]
:+y
, > X
TTTT
'^:^r—,^^'l> -——ri^^^N0 V 0 ^ -^ - ^ x'
X - ^ V,
> X v.a
0 :-> X >X v.a , ^ ^ ^
.
I
0 \-^ X
,
[rTT—^1=0 0 :-> X > yj v.a I X > V
v.o
^ ^
v.a X
^-v
,
^ \^>' X
>^
r.rr
I
> V' y + jc
v.a
x-^^x', I
,
>V
-^' + y v.a
X
v.a t
ve[Spiy)] i
,
v.a
,
*" X , y + X v,a
> X , y-7^,
_ r
>x .
.,
I' G [ S p ( y ) ]
Table 12 Rules for parallel composition (« e A) > yj. f G [ S p ( :y)l I'.Ci ,,
X V.a
^ l l y — ^ y^ y II ^
t'.q^
> X , i^€[Sp(y)],
X
X II y II
X 11 y
l'-^'
l t ' G [ S p ( - v ' ) ] , il t ' € [ S p ( y)l ^X ' II y, y l U ---> y II X',-vlL y — ^ ^ II y » ''•'^. y' JC > X
'•^'lly', JclLy-^^A-'lLy'
Table 13 Rules for i; e [Sp(_)] i^ 6 [Sp(g)]
V € [Sp(^)]
I' G [Sp(arelU))]
i;e[SpU)] l^ G [Sp(0 :-> JC)]
i;G[Sp(0:->^)]
I' € [Sp(0 i ^ -V)]
u€[sp(0^A)]
t;e[Sp(-r)]
u € [Sp(.v)], i; G [Sp(y)]
vGLSpU-y)]
i;G[SpU4-y)], uefSpU II y)]. i^G[SpU (Ly)]
1223
1224
J.A. Bergstra et al Table 14 Rules for now operator and encapsulation {a e A) X—> y/
X—>x
ve[Sp(x)]
Vre\(x) - ^ V ^relU) " ^ x' v £ [Spivre\(x))] VM
X
. , , ..« , ^ i ^ 9//(-^) — ^ V X
V.a
I
> V
>x
a//U)-^^a//U')
^
I
^ ^
. , , v.a . , ,. « ^ ^ 9//U) — ^ 3//U ) i;6[Sn(x)]
UG[SpO/yU))]
wheren+(r) stands for the number of occurrences of + inr. So 5(F) is the number of occurrences of + in the terms t occurring as the left-hand side of the formulas in F that have the form t - ^ r^ It is straightforward to prove that the mapping 5 is a stratification. We have to check all rules. This is trivial except for the only rule with a negative formula in its premises, viz. the last rule of Table 11. The number of occurrences of + in the conclusion of that rule is strictly greater than the number of occurrences of + in the negative formula in the premises. Note that the two rules for alternative composition concerning passage to the next time slice (Table 11) have complementary conditions. Together they enforce that the choice between two processes that both can pass to the next time slice is postponed till after the passage to the next time slice. This corresponds to the property reflected by the axiom DRTl of BPA~^-ID (Table 1). In order to rule out processes that are capable of performing an action and then going on as _L, there are premises in the first rule for sequential composition (Table 11) and the second rule for parallel composition (Table 12) concerning the existence of valuations that makes the root signal of certain processes true. This corresponds to the property reflected by the axiom NE3 of PA^^'' (Table 5). The rule for time unit delay (Table 11), shows that arei(0 is capable of passing to the next time slice under all valuations instead of only the valuations under which t is capable of doing things. This excludes persistency of root signal emission and waiting of the strict guarded conmiand because all rules for these operators restrict the valuations under which the resulting processes are capable of doing things.
2.4. Recursion In this subsection, we add recursion to PA^^^. Recursive specification, solution, guardedness, etc. are defined in a similar way as for BPA in [8]. Let V be a set of variables (of sort P). A recursive specification E = E{V) in PA^^^ is a set of equations E = {X = sx\X eV) where each sx is a PA^^'' term that only contains variables from V. We shall use X, X\ Y, Y\ ... for variables bound in a recursive specification. A solution of a recursive specification E(V) is a set of processes {{X\E) \
Discrete time process algebra and the semantics of SDL
1225
X € V} in some model of PA^^'^ such that the equations of £( V) hold if, for all X G V, X stands for {X\E). Mostly, we are interested in one particular variable X G V. We can now introduce the equational theory of PA^I^I^rec. SIGNATURE OF PAP^^'rec. The signature of PA^ji^'^rec consists of the signature of PA^^"" extended with a constant (Xl^) : -^ P for each X e V and each recursive specification E{V).
Let t be an open term in PA^^^ and £ = £"( V) be a recursive specification. Then we write {t\E) for t with, for all X G V, all occurrences of X in r replaced by {X\E). PA^^^rec. Axioms of V/K^^^vtc The axiom system of PA^I^j^rec consists of the axioms of PA^^^ and an equation {X\E) = {sx\E) for each X G V and each recursive specification E{V). AXIOMS OF
Let r be a term of PA^^^ containing a variable X. We call an occurrence of X in r guarded if t has a subterm of the form a-t' or are\{t') with t' a PA^^^ term containing this occurrence of X. We call a recursive specification guarded if all occurrences of all its variables in the right-hand sides of all its equations are guarded or it can be rewritten to such a recursive specification using the axioms of PA^|^^ and its equations. An interesting form of guarded recursive specification is linear recursive specification. We call a recursive specification E(y) linear if each equation in E has the form
i
ion
i
for certain actions a, and ^/, propositions 0/, i/^,, x/ ^rid f, and variables X, X,, X- G V. Note that, without loss of generality we can assume that for all / and j such that / ^ 7: ai_- Xi ^ aj ' Xj,bi^ bj, X'. ^ X'. and x/ # Xj• We can also assume that 0,, 1/^/ and x/ are notf. ~ ~ ~ PRINCIPLES OF PA^^^rec. The (restricted) recursive definition principle (RDP^"^) is the assumption that every (guarded) recursive specification has a solution. The recursive specification principle (RSP) is the assumption that every guarded recursive specification has at most one solution. Note that the axioms {X\E) = {^x l^") for a fixed E express that the constants (Xl^) make up a solution of E, i.e. RDP holds for any model of PAF^^XCC. The conditional equations E =» X = {X\E) express that this solution is the only one. So RSP can be described by means of conditional equations - as already mentioned in [28]. SEMANTICS OF PA^^^rec. A structural operational semantics of PA^jl^^rec is described by the rules for PA^^^ and the rules given in Table 15.
1226
JA. Bergstra et al Table 15 Rules for recursion {a e A) {sx\E)^^^
{sx\E)^^y
(X|£)^^V (^xl^)^^v
{X\E) - ^ y ve[Sp({sx\E))]
(Xl^)^^ V
ve[Sp{{X\E))]
The rules added for recursion are also in panth format. We define a stratification S as follows: S(t ^^t')
= co- MsoKO + n+(0 and S{t - ^ 7 ) = S{t ^ ^ t') = Siv e [Sp(r)]) = 0,
where HSOICO stands for the number of unguarded occurrences of constants (Xl^) in t and n+(0 stands for the number of occurrences of + in t. The addition of the summand CO • WsoiCO for formulas t - ^ t' solves the problem that the conclusion of the rule for recursion concerning passage to the next time slice does not contain occurrences of +. Let E = {X = sx \ X e V} ht 3. recursive specification. Then roughly, the rules for recursion come down to looking upon {X\E) as the process sx with, for all X' e V, all occurrences of X' in sx replaced by {X'\E).
2.5. Counting process creation In this subsection, we introduce the counting process creation operator E'^ that is used for the semantics of (^"SDL. This operator subsumes the original process creation operator introduced in [11]. The latter process creation operator was used in [14] for the semantics of (pSDL. But the approach used there does not guarantee that a unique process identification is assigned to each created process. It is assumed that a fixed but arbitrary set D of data has been given together with a function O : N x D ^ P, and that there exist actions cr(d) and cr(n, d) for dWdeD and n G N. The process creation operator E% allows, given the function 4>, the use of actions cr{d) to create processes ^{n,d). The counting process creation operator E'^ : P -> P is defined by the equations PRCRlPRCR8 given in Table 16. The crucial axiom is PRCR4. It expresses that counting process creation applied to a process, with the counter set to n, leaves the action ^ ( n , d) as a trace and starts a process ^{n,d) in parallel with the remaining process when it comes across an undelayable process creation action cr{d). Besides, it increases the counter by one. The counting process creation operator E'^J, is an extension of the process creation operator E^ from [11]. We can write E^, = E^ if ^{n,d) = (p(d) for all « € N and d e D. A structural operational semantics for the counting process creation operator is described by the rules given in Table 17. The stratification introduced for PA^|:|'rec still works if we add the rules for the counting process creation operator.
Discrete time process algebra and the semantics of SDL
1227
Table 16 Axioms for counting process creation (a e As) E'i(g) =gifa^
cr{d) for J € D
PRCRl
%i£Lid)) = mn,d)
• E'^^' {^{n.d))
PRCR2
E%{gx)=gE%{x)
\iai^cr(d)
PRCR3
fordeD
%i£Lid) • x) = g(/i, d) • E'i+' (<J>(AI, J) II x) PRCR4 E'iU + y) = E'^U) + E'i( y)
PRCR5
E% (Orel (x)) = CTrei (E^ (x))
PRCR6
E'i(0 :-> X) = 0 i-^ E'iU)
PRCR7
E'i((^ ^ jc) = (/> ^ E'^(x)
PRCR8
Table 17 Rules for counting process creation {a e A) ^''<^' I ^V
,
,.,
X
v.cr(d)
I r /^/ jwi > V, w€[Sp((M,^))]
•V ''-'''"''> .v'. u^6[s^(
E'iU) ^
E'i(.') " ^ "'*''^ V.G
^
f
»^
E%ix)-^^El(x')
E'iU) ^ ^ ^ i ^ E'i+' ((«.^) II V) r
/
\i
t'6[Sp(.v)]
ve[Sp(E%(x))]
2.6. tSf^r^ operator In this subsection, we introduce a state operator for ^A^^. It generalizes and extends the state operator for ACPps proposed in [6]: the truth value of propositional signals and conditions may depend upon the state and passage to the next time slice may have an effect on the state. The possibility of non-deterministic behaviour as the result of applying the operator is included as well, like for the extended state operator A (see, e.g., [8]). It is assumed that a fixed but arbitrary set S of states has been given, together with functions: act :Ax eff
S-^ Vf\n(A) lAxSxA^S
sig : 5 - ^ B val : BaiX
S^E
The state operator Xs (s e S) allows, given these functions, processes to interact with a state. The process Xs{x) is the process x executed in a state s. The function act gives, for each action a and state s, the set of actions that may be performed if a is executed in state s. The function eff gives, for each action a, state s and action A', the state that results when a is executed in state s and a' is the action that is actually performed as the result of the
1228
JA. Bergstra et al Table 18 Axioms for state operator {a e A) ^si^
= sig(s)^j:a'eaaia.s)i
SOI
^sig'X)=sig(s)^J2a'eacna.s)(gL-Kff(o.s.a')(-'^))
S02
^six-hy) = Xs(x)-\-Ks(y)
SOB
Xs (tJreiU)) = sigis) ^ (JreiiEs'eeff, (s) ^s' i^)) K,{(t> :-> x) = sig(s) ^ {val(
S04 SOS S06
execution. The function eff^ gives, for each state s, the set of states that may result when time passes to the next time slice in state s. The function sig gives, for each state s, the propositional signal that holds at the start of any process executed in state s. The function val gives, for each state s, the valuation val(-, s) of the atomic propositions in state s. The valuation va/(_, s) can be extended to all propositions in the usual homomorphic way as any other valuation. We will use the notation v«/(_, s) to refer to the extension as well. The state operator A.^ : P -^ P is defined by the equations S01-S06 given in Table 18. The axioms S01-S03 are straightforward reformulations - in the same way as for PA^^^ - of corresponding axioms given in [6] for the time free case. The additional axiom S04 expresses how passage to the next time slice has influence on the execution of a process in a state. The axioms S05 and S06 are also reformulations of corresponding axioms given in [6]. In these axioms the proposition 0 has been replaced by v«/(0, s). Thus the case is covered where the truth value of propositional signals and conditions may depend upon the state. Note that from S05 we can derive k^ (8) = 8. A structural operational semantics for the state operator is described by the rules given in Table 19. Note that the rules added for the state operator have a common side-condition given at the bottom of the table. The stratification introduced for PA^J!|^rec still works if we add the rules for the state operator.
Table 19 Rules for state operator (a e A)
a' e actio, s) V .a
• x\
w^lSpjx')]
• a' G act(a,s) A it' \= sigieff {a, s, a'))
^.v(-^)-^-^%(«..s.«')(-^') s' eejf„{s)
ve[Sp{x)]
for all i;, v' and s such that v' \= sigis) A V0 • u ^ 0 -o- u' [= \'ali(p, s)
Discrete time process algebra and the semantics of SDL
1229
3. Overview of (^~SDL 3.1. Introduction In this section, we give an overview of <^~SDL, i.e. (pSDL without delaying channels. (^SDL is a small subset of SDL, introduced in [14], which covers all behavioural aspects of SDL, including communication via delaying channels, timing and process creation. Leaving out delaying channels simplifies the presentation. Besides work on the process algebra semantics of <^SDL made clear that <^SDL specifications can always be transformed to semantically equivalent ones in (^~SDL. At the end of Section 4 is shown how to model a delaying channel by means of a <^~SDL process. In Sections 3.2, 3.3 and 3.4, the syntax of (p~SDL is described by means of production rules in the form of an extended BNF grammar (the extensions are explained in Appendix A). The meaning of the language constructs of the various forms distinguished by these rules is explained informally. Some peculiar details of the semantics, inherited from full SDL, are left out to improve the comprehensibility of the overview. These details will, however, be taken into account in Section 4, where the process algebra semantics of (^~SDL is presented. In Section 3.5, some remarks are made about the context-sensitive conditions for syntactic correctness of (p~ST>L specifications. The syntactic differences with full SDL are summarized in this section as well. In Section 3.6 some examples of (/^'SDL specifications are given. In line with full SDL, we can define a graphical representation for (/?~SDL specifications. We pay no attention to this practically important point because it is not relevant to the subject of this chapter. 3.2. System definition First of all, the (^~SDL view of a system is explained in broad outline. Basically, a system consists of processes which communicate with each other and the environment by sending and receiving signals via signal routes. A process proceeds in parallel with the other processes in the system and communicates with these processes in an asynchronous manner. This means that a process sending a signal does not wait until the receiving process consumes it, but it proceeds immediately. A process may also use local variables for storage of values. A variable is associated with a value that may change by assigning a new value to it. A variable can only be assigned new values by the process to which it is local, but it may be viewed by other processes. Processes can be distinguished by unique addresses, called pid values (process identification values), which they get with their creation. A signal can be sent from the environment to a process, from a process to the environment or from a process to a process. A signal may carry values to be passed from the sender to the receiver; on consumption of the signal, these values are assigned to local variables of the receiver. A signal route is a unidirectional communication path for sending signals from the environment to a process, from one process to another process or from a process to the environment. If a signal is sent to a process via a signal route it will be instantaneously delivered to that process.
1230
JA. Bergstra et al.
Signals of (^~SDL are not at all related to propositional signals of PA^|^^. In Section 4, communication of cp'SDh signals will be modeled by actions of PA^j!j^. Propositional signals of PA^^^ will be used to represent the visible part of the state of a system specified in (^~SDL. Recall that, in the remainder of this chapter, we will call propositional signals of PA^^^ "propositions" in order to avoid ambiguity with signals of ^~SDL. Syntax: <system definition> ::= system <system nm> ; {<definition>}'^ endsystem; <definition> ::= del
(<sort nm> {, <sort n m > ) * )
;
I signalroute <signalroute nm> from {<process nm> | env}to {<process nm> |env} with <signal nm> {, <signal n m > } * ; I process <process nm> (
A system definition consists of definitions of the types of processes present in the system, the local variables used by the processes for storage of values, the types of signals used by the processes for communication and the signal routes via which the signals are conveyed. A variable definition del v 7; defines a variable v that may be assigned values of sort T. A signal definition signal^^(ri,... ,7",,); defines a type of signals s of which the instances carry values of the sorts T i , . . . , r„. If (T^i,... ,7,,) is absent, the signals of type s do not carry any value. A signal route definition signalrouterfremXi toX2 with51,.. .,5,,; defines a signal route r that delivers without delay signals sent by processes of type X\ to processes of type X2, for signals of the types s\, ...,Sn. The process types X\ and X2 are called the sender type of r and the receiver type of r, respectively. A signal route from the environment can be defined by replacing fromXi by from env. A signal route to the environment can be defined analogously. A process definition proeessX(A:);fparv 1,.. .,v,„;start;rrJj ... ^„endproeess; defines a type of processes X of which k instances will be created during the start-up of the system. On creation of a process of type X after the start-up, the creating process passes values to it which are assigned to the local variables v i , . . . , v,„. If fparvi,... ,v,„; is absent, no values are passed on creation. The process body start;rrJi ..,dn describes the behaviour of the processes of type X in terms of states and transitions (see further Section 3.3). Each process will start by making the transition rr, called its start transition, to enter one of its states. The state definitions t / i , . . . , t/„ define all the states in which the process may come while it proceeds.
Discrete time process algebra and the semantics of SDL 3.3. Process behaviour First of all, the <^~SDL view of a process is briefly explained. To begin with, a process is either in a state or making a transition to another state. Besides, when a signal arrives at a process, it is put into the unique input queue associated with the process until it is consumed by the process. The states of a process are the points in its behaviour where a signal may be consumed. However, a state may have signals that have to be saved, i.e. withhold from being consumed in that state. The signal consumed in a state of a process is the first one in its input queue that has not to be saved for that state. If there is no signal to consume, the process waits until there is a signal to consume. So if a process is in a state, it is either waiting to consume a signal or consuming a signal. A transition from a state of a process is initiated by the consumption of a signal, unless it is a spontaneous transition. The start transition is not initiated by the consumption of a signal either. A transition is made by performing certain actions: signals may be sent, variables may be assigned new values, new processes may be created and timers may be set and reset. A transition may at some stage also take one of a number of branches, but it will eventually come to an end and bring the process to a next state or to its termination. A timer can be set which sends at its expiration time a signal to the process setting it. A timer is identified with the type and carried values of the signal it sends on expiration. Thus an active timer can be set to a new time or reset; if this is done between the sending of the signal noticing expiration and its consumption, the signal is removed from the input queue concerned. A timer is de-activated when it is reset or the signal it sends on expiration is consumed. Syntax: <statedef> ::= state <state nm> ; save <signal nm> {, <signal n m > } * ; {
(
;
(<expr> {, < e x p r > ) * )
to
(<expr> { , < e x p r > ) * )
I reset (<signal nm> (<expr> { , < e x p r > } * ) ); 1 task
);
1231
1232
J.A. Bergstra et al. <decision> ::= decision {<expr> | any}; (
{(
):
enddeclsion
A state definition state ^r; save^i»• • • JS,U ;alt\ ... altn defines a state st. The signals of the types s\,...,Sm are saved for the state. The input guard of each of the transition alternatives alt\,..., altn gives a type of signals that may be consumed in the state; the corresponding transition is the one that is initiated on consumption of a signal of that type. The alternatives with input none; instead of an input guard are the spontaneous transitions that may be made from the state. No signals are saved for the state if save51,.. .,5^', is absent. An input guard input^(vi,... ,Vn); may consume a signal of type s and, on consumption, it assigns the carried values to the variables v i , . . . , v,?. If the signals of type s carry no value, (vi,... ,v„) is left out. A transition a\ ...an nextstate^r; performs the actions a\, ...,an in sequential order and ends with entering the state st. Replacing nextstate^r by the keyword stop yields a transition ending with process termination. Replacing it by the decision dec leads instead to transfer of control to one of two or more transition branches. An output action output s(e\,... ,€„) to ^ via r i,... ,r,„; sends a signal of type s carrying the current values of the expressions €],...,€„ to the process with the current (pid) value of the expression e as its address, via one of the signal routes r i , . . . , r,„. If the signals of type s carry no value, (e\,...,€„) is left out. If to^ is absent, the signal is sent via one of the signal routes r i , . . . , r^ to an arbitrary process of its receiver type. The output action is called an output action with explicit addressing if to e is present. Otherwise, it is called an output action with implicit addressing. A set action set(^,^(^i,...,e„)); sets a timer that expires, unless it is set again or reset, at the current (time) value of the expression e with sending a signal of type s that carries the current values of the expressions e\,. ..,en. A reset action reset (5(^1,... ,^„)); de-activates the timer identified with the signal type s and the current values of the expressions €\,... ^ €n• An assignment task action taskv:=^; assigns the current value of the expression e to the local variable v. A create action createX(^],... ,e„); creates a process of type X and passes the current values of the expressions e\,.. .,€„ to the newly created process. If no values are passed on creation of processes of type X,(e\,... ,€„) is left out. A decision decision ^;(^i):rri ... (^„):rr„ enddecision transfers control to the transition branch rr, (l^i^n) for which the value of the expression ei equals the current value of the expression e. Non-existence of such a branch results in an error. A non-deterministic choice can be obtained by replacing the expression e by the keyword any and removing all the expressions Ci.
Discrete time process algebra and the semantics of SDL
1233
3.4. Values The value of expressions in (^~SDL may vary according to the last values assigned to variables, including local variables of other processes. It may also depend on timers being active, the system time, etc. Syntax: <expr> ::=
An operator apphcation op(e\,.. ..e^) evaluates to the value yielded by applying the operation op to the current values of the expressions ^ i , . . . , ^„. A conditional expression if ^i then ^2 else ^3 fi evaluates to the current value of the expression 62 if the current (Boolean) value of the expression e\ is true, and the current value of the expression ^3 otherwise. A variable access v evaluates to the current value of the local variable v of the process evaluating the expression. A view expression view(v,e) evaluates to the current value of the local variable v of the process with the current (pid) value of the expression e as its address. An active expression active (^(^1,... ,e„)) evaluates to the Boolean value true if the timer identified with the signal type s and the current values of the expressions e\, ...,en is currently active, and false otherwise. The expression now evaluates to the current system time. The expressions self, parent, offspring and sender evaluate to the pid values of the process evaluating the expression, the process by which it was created, the last process created by it, and the sender of the last signal consumed by it. Natural numbers are used as pid values. The pid value 0 is a special pid value that never refers to any existing process - in full SDL this pid value is denoted by null - and the pid value 1 is reserved for the environment. The expressions parent, offspring and sender evaluate to 0 in case there exists no parent, offspring and sender, respectively.
3.5. Miscellaneous issues 3.5.1. Context-sensitive syntactic rules. We remain loose about the context-sensitive conditions for syntactic correctness of (^~SDL specifications. For the most part, they are as usual: only defined names may be used, use of names must agree with their definitions, types of expressions must be in accordance with the type information in the definitions, etc. There is one condition that needs particular attention: signals of the same type may not be
1234
J A. Bergstra et al
used for both signal sending and timer setting/resetting. All (^"SDL specifications that are obtained by semantics preserving transformations of syntactically correct specifications in full SDL will be syntactically correct (/?~SDL specifications as well. 3.5.2. Syntactic differences with SDL. Syntactically, <^~SDL is not exactly a subset of SDL. The syntactic differences are as follows: • variable definitions occur at the system level instead of inside process definitions; • signal route definitions and process definitions occur at the system level instead of inside block definitions; • formal parameters in process definitions are variable names instead of pairs of variable names and sort names; • signal names are used as timer names. These differences are all due to the simplifications mentioned in Section 1.
3.6. Examples We give three small examples to illustrate how systems are specified in (^~SDL. The examples concern simple repeaters and routers. 3.6.1. Repeater. The first example concerns a simple repeater, i.e. a system that simply passes on what it receives. The system, called R e p e a t e r , consists of only one process, viz. r e p , which communicates signals s with the environment via the signal routes f romenv and t o env. The process has only one state. system Repeater signal s; signalroute fromenv from env to rep with s; signalroute toenv from rep to env with s; process rep(1); start; nextstate pass; state pass; input s; output s via toenv; nextstate pass; endprocess; endsystem;
3.6.2. Address driven router The second example concerns address driven routing of data. The system, called A d d r R o u t e r , consists of three processes, one instance of r t r and two instances of r e p . The latter two processes are created by the former process. The process r t r consumes signals s ( a ) , delivered via signal route f romenv, and passes them to one of the instances of r e p (via signal route r s ) depending on the value a. The instances of r e p then pass the signals received from r t r to the environment via the signal route t o e n v .
Discrete time process algebra and the semantics of SDL
1235
system AddrRouter signal s(Bool); signalroute fromenv from env to rtr with s; signalroute rs from rtr to rep with s; signalroute toenv from rep to env with s; del a Bool; del repl Nat; del rep2 Nat; proeess rtr(1); start; create rep; task repl := offspring; ereate rep; task rep2 := offspring; nextstate route; state route; input s(a); decision a; (False): output s(a) to repl via rs; nextstate route; (True): output s(a) to rep2 via rs; nextstate route; enddeeision; endproeess; proeess rep(0); start; nextstate pass; state pass; input s(a); output s(a) via toenv; nextstate pass; endproeess; endsystem;
3.6.3. Load driven router. The last example concerns load driven routing of data. The system, called L o a d R o u t e r , consists of three processes, one instance of r t r and two instances of t r e p . The latter two processes are created by the former process. The process r t r consumes signals s, delivered via signal route fromenv, and passes them to one of the instances of t r e p (via signal route r s ) depending on their load. The instances of t r e p then pass the signals received from r t r to the environment via the signal routes t o e n v . Either delivers the data consumed after a fixed time d e l a y . One repeater delivers twice as fast as the other one. Only two load factors are considered for each of the two repeaters: one indicating its idleness and one indicating the opposite. system LoadRouter signal s; signal t; signalroute fromenv from env to rtr with s; signalroute rs from rtr to trep with s; signalroute toenv from trep to env with s;
1236
J.A. Bergstra et al
del idle Bool; del delay Nat; del repl Nat; del rep2 Nat; process rtr(1); start; create trep(lO); task repl := offspring; create trep(20); task rep2 := offspring; nextstate route; state route; input s; decision view(idle,repl) <-> view(idle,rep2); (True): output s via rs; nextstate route; (False): decision view(idle,repl) (True): output s to repl via rs; nextstate route; (False): output s to rep2 via rs; nextstate route; enddeeision enddeeision endproeess; process trep(O) fpar delay; start; task idle := True; nextstate get; state get; input s; task idle := False; set(now + delay, t ) ; nextstate put; state put; save s; input t; output s via toenv; task idle := True; nextstate get; endproeess; endsystem;
Most features oi(p~S\yL are used in this example. Of the main features, only spontaneous transitions, i.e. transition alternatives with input none; instead of an input guard, are missing. In Section 4.6.3, use is made of this feature to define a process modeling a delaying channel.
Discrete time process algebra and the semantics of SDL
1237
4. Semantics of <^~SDL 4.1. Introduction In this section, we propose a process algebra semantics for (^"SDL. This semantics is presented in two steps. In Section 4.3, a semantics for (^~SDL process definitions is given. This semantics abstracts from dynamic aspects of process behaviour such as process creation and process execution in a state. It describes the meaning of <^~SDL process definitions by means of finite guarded recursive specifications in BPA^j^^. The counting process creation operator and the state operator are not needed for this semantics. Preceeding, in Section 4.2, the actions and atomic conditions used are introduced. These actions and conditions are parametrized by expressions with values that depend on the state in which the action or condition concerned is executed. In Section 4.6, a semantics of ?~SDL system definitions is given in terms of the semantics for (p'SDL process definitions using the counting process creation operator and the state operator. Preceeding, in Section 4.5, all the details of the instance of the state operator needed for this semantics are given. Included are the definitions of the state space and the functions that describe how the actions and conditions used for the semantics of (^~SDL process definitions interact with the state when this instance of the state operator is applied. The interaction with the environment is another aspect covered by the semantics of (p'SDL system definitions. For this purpose an environment process is introduced as well. The semantics of (^~SDL is described by means of a set of equations recursively defining interpretation functions for all syntactic categories. The special notation used is explained in Appendix A. We will be lazy about specifying the range of each interpretation function, since this is usually clear from the context. Many of the interpretations are functions from natural numbers to process expressions or equations. These process expressions and equations will simply be written in their display form. If an optional clause represents a sequence, its absence is always taken to stand for an empty sequence. Otherwise, it is treated as a separate case. The semantics is defined using contextual information K extracted from the ^~SDL specification concerned. This is further described in Appendix B. The special notation used for parametrized actions, conditions and propositions is explained in Appendix A, and so is the uncustomary notation as regards sets, functions and sequences. The words action and process are used in connection with both ACP-style process algebras and versions of SDL, but with slightly different meanings. In case it is not clear from the context, these words will be preceded by ACP if they should be taken in the ACP sense, and by SDL otherwise. Data types. We mentioned before that (j^^SDL does not deal with the specification of abstract data types. We assume a fixed algebraic specification covering all data types used and an initial algebra semantics, denoted by A, for it. The data types Boolean and Natural, with the obvious interpretation, must be included. We will write Sortj\^ and Opj^ for the set of all sort names and the set of all operation names, respectively, in the signature of A. We additionally assume a constant name, i.e. a nullary operation name, in Op^, referred
1238
JA. Bergstra et al
to as n, for each /i € N. We will write U for [jj^sort ^'^^ where T-^ is the interpretation of the sort name T in A. We have that B, N C 6^ because of our earlier requirement that Boolean, Natural e SortA- We assume that nil ^ U. In the sequel, we will use for each op e Opj^ an extension ioVV} {nil}, also denoted by op, such that op{t\ ,...,/,,) = nil if not all of the f/s are of the appropriate sort. Thus, we can change over from the many-sorted case to the one-sorted case for the description of the meaning of the language constructs of (^~SDL. We can do so without loss of generality, because it can (and should) be statically checked that only terms of appropriate sorts occur.
4.2. Actions and conditions In the semantics of ^~SDL process definitions, which will be presented in Section 4.3, ACP actions and conditions are used. Here, we introduce the actions and atomic conditions concerned. The actions and atomic conditions, used to describe the meaning of <^~SDL process definitions, are parametrized by various domains. These domains depend upon the specific variable names, signal names and process names introduced in the system definition concerned. These sets of names largely make up the context ascribed to the system definition by means of the function {[_]} defined in Appendix B. For convenience, we define these sets for arbitrary contexts K (the notation concerning contexts introduced in Appendix B is used): V^ SK PK
= varsiK) U {parent, offspring, sender} = sigs(K) = procs(K)
Most arguments of the parametrized actions and conditions introduced here are expressions that originate in (p~SDL expressions or objects that are somehow composed of such expressions and variable, signal and process names. The reason of this is that the value of the original <^~SDL expressions may vary according to the last values assigned to the variables referred to, the status of the timers referred to, etc. In other words, these expressions stand for values that are not known until the action or condition concerned is executed in the appropriate state. The syntax of the expressions concerned, called value expressions, is as follows:
(
where the terminal productions of
Discrete time process algebra and the semantics of SDL
1239
correspond to operator applications, conditional expressions, view expressions, active expressions, and the expression now, respectively, in (p~SDL. We define now the set SigP^ of signal patterns, the set SigE^ of signal expressions, the set SaveSetK of save sets and the set PrCrD^ of process creation data. Further on, we will look at a signal as an object that consists of the name of the signal and the sequence of values that it carries. Signal patterns and signal expressions are like signals, but variables and value expressions, respectively, are used instead of values. A save set is just a finite set of signal names. A process creation datum consists of the name of the process to be created, its formal parameters, expressions denoting its actual parameters and the pid value of its creator. SigP^ SigE^ SaveSetK PrCrD,
= = = =
{(s, (ui,..., vn)) i (5, (ri Tn)) G sigdsiK). vi....,VneVK} {{s, (£i,..., en)) I is, (7, Tn)) e sigds{K), ^ j , . . . , ^„ G ValE^} ^fin('^/c) {{XAvi,...,Vn)Ae\ en),e)\ X eP^, v\,...,vn eVK, e\ en,e e ValE^}
We write/7nm(t/), where d = (X, i;^, es, e) e PrCrD^, for X. Each process creation datum contains the formal parameters for the process type concerned. The alternative would be to make the association between process types and their formal parameters itself a parameter of the state operator, which is very unattractive. The following actions are used: input outpute outputi set reset ass cr stop inispont tt
SigP^ X SaveSetK x ValE, SigE^ X ValE^ x ValE^ SigE^ X ValE^ x (P^ U {cenv)) ValE^ X SigE^ x ValE^ SigE^ X ValE^ VK X ValE^ X ValE^ PrCrDK ValE^ ValE^
Cr^ denotes the set of all cr actions, and Act~ denotes the set of all input, outpute, outputi, set, reset, ass, stop and inispont actions. The tt action is a special action with no observable effect whatsoever. The other actions correspond to the input guards, the SDL actions, the terminator stop and the void guard input none. The last argument of each action is the pid value of the process from which the action originates, except for the outpute and outputi actions where the pid value concerned is available as the second argument. The outpute and outputi actions correspond to output actions with explicit addressing and implicit addressing, respectively, in (^~SDL. The last argument of these actions refers to the receiver. With an outpute action, the receiver is fully determined by the pid value given as the last argument. With an outputi action, the receiver is not fully determined; it is an arbitrary process of the given type. The conditions used are built from the following atomic conditions:
1240
J A. Bergstraetal waiting : SaveSet^ x VGIEK type : VQIEK X (P^ U {env}) hasinst : P^ U {env} eq : Vh/£/c x Vh/f/^^
AtCond/c denotes the set of all waiting, type, hasinst and eq conditions. A condition waitingiss, e) is used to test whether the process with the pid value denoted by e has to wait for a signal if the signals with names in ss are withhold from being consumed. A condition type(e, X) is used to test whether X is the type of the process with the pid value denoted by ^. A condition hasinst{X) is used to test whether there exists a process of type X. A condition eq{e\, ^2) is used to test whether the expressions e\ and ei denote the same value. These conditions are used to give meaning to the state definitions, output actions and decisions of (^~SDL.
4.3. Semantics ofprocess definitions We describe now the meaning of (^~SDL process definitions and their constituents. The meaning of the process definitions occurring in the examples from Section 3.6 is presented in Section 4.4. 4.3.1. Process definitions. The meaning of each process definition occurring in a system definition consists of the process name introduced and a family of processes, one for each possible pid value, which are described by means of finite guarded recursive specifications in BPAjjlj^. The meaning of a process definition is expressed in terms of the meaning of its start transition and its state definitions. [ processX(/:); fpar v i , . . . ,v,„; start; trd\ ... dn endprocess;F
=
{X, {i ^ {X\{X = Itrlf, Idi if, .... Idnlf}) I /• 6 N}) where K^ = updscopeunit{K,X) The recursive specification of the process of type X with pid value z describes how it behaves at its start (the equation X =ltrYi ) and how it behaves from each of the n states in which it may come while it proceeds (the equations Mi ]f , . . . , idnVi ). In the remainder of this section, we will be loose in the explanation of the meaning of the constituents of process definitions about the fact that there is always a family of meanings, one for each possible pid value. 4.3.2. States and transitions. The meaning of a state definition, occurring in the scope of a process definition, is a process described by an equation of the form Z = sz where Z is a variable corresponding to the state and sz is a BPAjj^^^ term that only contains variables corresponding to states introduced in the process definition concerned. The equation describes how a process of the type being defined behaves from the state. The meaning of the state definition is expressed in terms of the meaning of its transition alternatives, which are process expressions describing the
Discrete time process algebra and the semantics of SDL
1241
behaviour from the state being defined for the individual signal types of which instances may be consumed and, in addition, possibly for some spontaneous transitions. The meaning of each transition alternative is in turn expressed in terms of the meaning of its input guard, if the alternative is not a spontaneous transition, and its transition. [statest\saves\,...,s,n\alt\ ... altn 1^ := Xst = I' ilaltxYi' + ... ^laltnYi -h waiting{[sx where X = scopeunit(K), K' = updsavesetiK, {s\
5,„}, 0 !-> areKX,;))
5„;})
[input5(vi,...,v,,);rrl^ := input{{s, (v)
Vn))^ss,i)-ltr]1'
where ss = saveset(K) [inputnone;rrj^ := inispontJDltrll' The equation that corresponds to a state definition describes that a process of type X behaves from the state st as one of the given transition alternatives, and that this behaviour is possibly delayed till the first future time slice in which there is a signal to consume if there are no more signals to consume in the current time slice. Entering a state is supposed to take place by way of some internal action - thus it is precluded that a process is in more than one state. We use process names with state name subscripts, such as Xst above, as variables. Notice that, in the absence of spontaneous transitions, a delay becomes inescapable if there are no more signals to consume in the current time slice. The process expression that corresponds to a guarded transition alternative expresses that the transition tr is initiated on consumption of a signal of type s. In case of an unguarded transition alternative, the process expression expresses that the transition tr is initiated spontaneously, i.e. without a preceding signal consumption - with sender set to the value of self (see Section 4.5). The meaning of a transition is described by a process expression - a BPAjj![^ term to be precise. It is expressed in terms of the meaning of its actions and its transition terminator. la\...an nextstate^r;!)' := laiJ^ -... [rt,,!^ • Xst where X = scopeimitiK) la I... an stop;i1 '= [^llf •••••[^;;1^ • stopij) lai...andec;}'^
:= laa'} •.. lani'; IdecJ';
The process expression that corresponds to a transition terminated by nextstate^^r expresses that the transition performs the actions a\ ,an in sequential order and ends with entering state st - i.e. goes on behaving as defined for state st. In case of termination by stop, the process expression expresses that it ends with ceasing to exist; and in case of termination by a decision dec, that it goes on behaving as described by decision dec. The meaning of a decision is described by a process expression as well. It is expressed in terms of the meaning of its expressions and transitions.
1242
J.A. Bergstra et ai [decision^;(ei):rri .. .(^„):rr„ enddecision]^ := eq{Ve\Ae\\)\-^Vtrxri + • • • + eq{le\^Aen\)\-^ltrnYi I decision any; ():rr i ... ():trn enddecisionjj' := itr\ Ij^ + ... +|[rr„ Yi
The process expression that corresponds to a decision with a question expression e expresses that the decision transfers control to the transition rr, for which the value of e equals the value of Ci. In case of a decision with any instead, the process expression expresses that the decision transfers non-deterministically control to one of the transitions
4.3.3. Actions. The meaning of an SDL action is described by a process expression, of course. It is expressed in terms of the meaning of the expressions occurring in it. It also depends on the occurring names (variable names, signal names, signal route names and process names - dependent on the kind of action). Ioutput5(^l,... ,^„)to^viari,. ,r,„;lj^ := typeile}., Xi) v ... v typeile}., Xm)':^ outpute{{s, {[^l]. I^,/!,}),!, M,) + •^{typeilei., Xi) v ... v typeile}., X,^)) :-> g where for 1 ^ y ^ m: Xj = rcv(K, rj) [output^(^1, ,^„) viari,... ,r,„ ;Jl := outputijis, ([gil,-,..., lenlj)), i\ XQ) + . . .-^ oiitputiUs, ([^i 1-... •, lenlj)), b ^m)) + ->(hasinst(X\) A ... A hasinst{X,n ))\-^ g where for 1 ^ y ^ m: Xj = rcv{K, rj) [set(^,5(^l,...,^„));lf :=
sji{ie\AsAVex\,...Aen\))J_)
[reset(5(^1,...,^„));1^ := ^ ^ ( ( 5 , ([£',].,..., [^„l.>),i) [tasl
Discrete time process algebra and the semantics of SDL the signal is simply discarded and no error occurs. This is expressed by the summand ->(hasinst{X\) A ... A hasinst{X„j)) l^- g. Note that the signal may already be discarded if there is one signal route for which there exists no process of its receiver type. 4.3.4. Values. The meaning of a (p~SDL expression is given by a translation to a value expression of the same kind. There is a close correspondence between the (p~SDL expressions and their translations. Essential of the translation is that / is added where the local states of different processes need to be distinguished. Consequently, a variable access v is just treated as a view expression view(v, self). For convenience, the expressions parent, offspring and sender are also regarded as variable accesses. lop(eu...,en)ii
:= op([^il,, • • •, I^;J,)
l i f ^ l then^2elsee3fil.
:= co/i^d^iJ., [ o l - , 1^3]-)
[^1/ •= value(v,i_) [view(v,^)l. := value(v,lej.) I active (5(ei,...,^„))]|. := active {{s, {[ei'i.
Ie,;]-)),0
[now]. := now I self]. := i [parent]- := VA/M^(parent, 0 [offspring]^ [sender]-
:= v^/w^(offspring,0
:= vfl/w^(sender,0
4.4. Examples We present the meaning of the process definitions occurring in the examples from Section 3.6. To be more precise, we give for each process definition a constant of the form {X\E) that stands for the process of the type concerned with pid value /. It is clear that there are many similarities with the original process definitions in (p~SDL. There is an equation for each state, the right hand side of each equation has a summand for each transition alternative of the corresponding state, etc. In addition, there is always a summand in which the time unit delay operator appears; this summand allows a delay to a future time slice to occur if there is no input to be read from the input queue of the process concerned. The main difference between the (p~SDL process definitions and the description of their meaning in BPA^^^rec is that the latter can be subjected to equational reasoning using the axioms of BPAP;,^rec.
1243
1244
J.A. Bergstra et al.
4.4.1. Repeater. The r e p process with pid value / is (repl {rep = r e p p a s s , ^eppass = I' {input{{s, {)), 0, £) • {outputiiis, 0 ) , /_, env) 4- ->hasinst{eny) i-^ g) • r e p p a s s + waiting(id,i_) ;-> crrei(reppass))
4.4.2. Address driven router The r t r process with pid value / is (rtrl { r t r = cr((rep, (), 0 , 0 ) • a5^(repl, va/Me(offspring, Q, /) • cr((rep, (), 0 , 0 ) • fl5.y(rep2, va/Mg(offspring, i)J) • r t r r o u t e ^ rt ^route — ^ ' (input((s, (a.)), 0, 0 ' (eqivalueia, i). F a l s e ) .•-> (typeivalueirepl, [), r e p ) i-> outputeiis, {value(a, [))),[, valueireipl, ij) + ->type{value{rei>l, i_), r e p ) j - ^ ff) • r t r r o u t e + eqivalueia, 0 , True) j - ^ itypeivalueirep2, iJ, r e p ) *;-> outputeiis, (valueia, iJ)). L va/we(rep2, 0) + -•rype(ua/Me(rep2, 0 , ^ep) ;-> | ) • r t r r o u t e ) + waitingii/),i_);-> o-rei(rtrroute)) ) ) The r e p process with pid value / is {repl {rep = r e p p a s s , 3^eppass = I' (inputjis, (a)), 0 , 0 • {outputijis, (a)), /_, env) + -^hasinstiem) \-^ g) • r e p p a s s + waitingi^, i) :-> o-rei(reppass))
4.4.3. Load driven router The r t r process with pid value / is (rtrl { r t r = CT((trep, ( d e l a y ) , (10), 0 ) • a5^( r e p l , va/Me( offspring, O^O • c r ( ( t r e p , ( d e l a y ) , (20), 0 ) • ^55(rep2, vfl/Me(offspring,0'0 - r t r r o u t e , r t r r o u t e = f - {inputHs, ()),0,O •
Discrete time process algebra and the semantics of SDL
1245
(eq{value{i6lQ, v^/weCrepl,/)) ^e> value{idlQ, value{rep2,i)), True) i-> (outputijis, 0 ) , /, t r e p ) -h -^hasinstitrep) [-^ D • r t r r o u t e + eq{value{idile, value{repl.i)) <-> value{idle, v«/M^(rep2,/)), F a l s e ) i-> (eq(value{idle, v«/w^(repl. /_)), True) i-^ (typeivalueirepl, i), r e p ) i^- outputeUs, {)),/, v'(7/w^(repl,/)) + -^ry/^^Cfa/M^Crepl, i), r e p ) i-> g) • r t r r o u t e + eq{value(idle, value{re-pl, i)). F a l s e ) i^itypeivalueirep2,[), r e p ) .'-> outputeHs, ()),/, va/w^(rep2, 0) + -'typeivalueireip2, ij, r e p ) j ^ ^) • r t r r o u t e ) ) + waitingd^, /) !-> arei(rtrroute)) } ) The t r e p process with pid value / is (trepi { t r e p = ^ ^ ( i d l e , True) • t r e p g e t ^ t r e p g e t = I • (input{{s, ()), 0, /) • assjidle, F a l s e ) • selinow + d e l a y , t ) • t r e p p u t + waiting{id,i) !-> arei(trepget)). trepput = I-(inputjit, ()), {s},/) • (outputi((s, ()),/, env) + -^hasinst{eny) :'-> g) • fl55(idle, True) • t r e p g e t + waiting{{s}JJ\-> arei(trepput))
4.5. Interaction with states In the semantic of (^~SDL process definitions, ACP actions are used to give meaning to input guards, SDL actions, the terminator stop and the void guard input none. Thus, the facilities for storage, communication, timing and process creation offered by these language constructs are not fully covered; the ACP actions are meant to interact with a system state. In the semantics of <^~SDL system definitions, which will be presented in Section 4.6, the state operator mentioned in Section 2 is used to describe this. First, we will describe the state space, the actions that may appear as the result of executing the above-mentioned actions in a state, and the result of executing processes, built up from these actions, in a state from the state space. 4.5.1. State space, actions and propositional signals. The state space, used to describe the meaning of system definitions, depends upon the specific variable names, signal names and process names introduced in the system definition concerned. That is, the sets V/,, S^ and P^ are used here as well. First, we define the set Sig^ of signals and the set ExtSig^ of extended signals. A signal consist of the name of the signal and the sequence of values that it carries. An extended signal contains, in addition to a signal, the pid values of its sender and receiver.
1246
J A. Bergstra et al Sig„ = {(s, (wi,..., u„)) I (5, ( r i , . . . , Tn)) e sigds{K),ux^ ...,UneU} ExtSig^ = Sig^ xNi xNi
We write snm{sig) and vals{sig), where sig = (s, i;^) € 5/g^, for s and i;^, respectively. We write sig(xsig), snd(xsig) and rcv{xsig), where xsig = (sig, /, /') G ExtSig^, for ^/g, / and /^ respectively. Note that 0 is excluded as pid value of the sender or receiver of a signal because it is a special pid value that never refers to any existing process. The local state of a process includes a storage which associates local variables with the values assigned to them, an input queue where delivered signals are kept until they are consumed, and a component keeping track of the expiration times of active timers. We define the set Stg,^ of storages, the set InpQ^ of input queues and the set Timers^ of timers as follows: Stg, = Uvcv,(V-> U) InpQ^ = ExtSig^* ) ( r ^ (NU{nil))) TimersK
We will follow the convention that the domain of a function from Stg^ does not contain variables with which no value is associated because a value has never been assigned to them. We will also follow the convention that the domain of a function from Timers^ contains precisely the active timers. While an expired timer is still active, its former expiration time will be replaced by nil. The basic operations on Stg^ and Timers^ are general operations on functions: function application, overriding (0) and domain subtraction (^). Overriding and domain subtraction are defined in Appendix A. In so far as the facilities for communication are concerned, the basic operations on InpQ^. are the functions getnxt : InpQ^ x SaveSet^ -> ExtSig^ U {nil}, rmvfirst : InpQ^ x 5/g^ -> InpQ,^, merge : Pfin (ExtSig^) ^ 'Pfin UnpQ^)
defined below. The value of getnxt(<7, ss) is the first (extended) signal in cr with a name different from the ones in ss. The value of rmvfirst{a, sig) is the input queue a from which the first occurrence of the signal sig has been removed. Both functions are used to describe the consumption of signals by SDL processes. The function getnxt is recursively defined by getnxt ({),ss) = n\\ getnxt({sig, i, i') & a, ss) = (sig, i, i') if snm(sig) ^ ss getnxt((sig, i, i') & a, ss) = getnxt(a, ss) if snm(sig) € ss
and the function rmvfirst is recursively defined by rmvfirst({),sig) = {) rmvfirst ((sig, i,i') &a, sig) = a rmvfirst((sig, i, i^) & a, sig') = (sig, i, i') & rmvfirst(a, sig)
if sig ^ sig
For each process, signals noticing timer expiration have to be merged when time progresses to the next time slice. The function merge is used to describe this precisely. For a given set
Discrete time process algebra and the semantics of SDL
1247
of extended signals it gives the set of all possible sequences of them. It is inductively defined by () G merge(0) (sig, i, /O ^ E A a G mergeiH) => {sig, /, i') &a e mergeilisig. /, /')} U L)
We define now the set C^ of local states. The local state of a process contains, in addition to the above-mentioned components, the name of the process. Thus, the type of the process concerned will not get lost. This is important, because a signal may be sent to an arbitrary process of a process type. CK = Stg^ X InpQ^ X Timersic x P^
We write stg{L), inpq{L), timers(L) Sindptype(L), where L = (p, a, 0, X) e C^Jor p, cr, 0 and X, respectively. The global state of a system contains, besides a local state for each existing process, a component keeping track of the system time. To keep track of the system time, natural numbers suffice. We define the state space Q^ of global states as follows: GK = NxU/e7^Hn(N2)(^-^^^) We write now{G) and Ists(G), where G = (M, E) € ^/^, for n and E, respectively. We write exists{i, G), where / G N and G G Q^, for / G dom{lsts{G)). Note that 1 is excluded from being used as pid value of an existing process of the system because it is a special pid value that is reserved for the environment. Every state from QK produces a proposition which is considered to hold in the state concerned. In this way, the state of a process is made partly visible. These propositions are built from the following atomic propositions: value \VK y^U x^2 active : 5/g^ x N2 AtProp^ denotes the set of all value and active propositions. We write Prop,^ for the set of all propositions that can be built from AtProp^. An atomic proposition of the form value{v, M, /) is intended to indicate that u is the value of the local variable v of the process with pid value /. An atomic proposition of the form active{sig, i) is intended to indicate that the timer of the process with pid value / identified with signal sig is active. By using only atomic propositions of these forms, the state of a process can not be made fully visible via the proposition produced. The proposition produced by each state, given by the function sig defined in Section 4.5.4, makes only visible the value of all local variables and the set of active timers for all existing processes. Below, we introduce the additional actions that are used for the semantics of (p~SDL system definitions. Like most of the actions used for the semantics of (p~SDL process definitions, these actions are parametrized. The following additional actions are used: ci^ input' output' se/ reset'
N X PrCrD^ ExtSig^ ExtSig^ N X Sig^ X r Sig, X N2
1248
J.A. Bergstra et al.
CVK denotes the set of all cr actions; and Act',^ denotes the set of all inpuf, outpuf, sef and reset' actions. The cr actions appears as the result of applying the process creation operator E^ to cr actions. The input', output', set' and reset' actions appear as the result of applying the state operator AG to input, outpute/outputi, set and reset actions, respectively (see Section 4.5.4). 4.5.2. State transformers and observers. In the process algebra semantics of (^~SDL process definitions, presented in Section 4.3, ACP actions are used to describe the meaning of input guards, SDL actions, the terminator stop and the void guard input none. These ACP actions are meant to interact with a state from Q^. Later on, we will define the result of executing a process, built up from these actions, in a state from QK . That is, we will define the relevant state operator. This will partly boil down to describing how the actions, and the progress of time (modeled by the time unit delay operator arei), transform states. For the sake of comprehensibility, we will first define matching state transforming operations. In addition, we will define some state observing operations. Two of the state observing operations are used directly to define the action and effect function of the state operator and three others are used to define the valuation function of the state operator. The remaining two are used to define the signal function of the state operator as well as an auxiliary evaluation function needed for the value expressions that occur as arguments, and as components of arguments, of the above-mentioned actions and conditions (see Section 4.2). State transformers. In general, the state transformers change one or two components of the local state of one process. The notable exception is csmsig, which is defined first. It may change all components except, of course, the process type. This is a consequence of the fact that the facilities for storage, communication and timing are rather intertwined on the consumption of signals in (^~SDL. For each state transformer it holds that everything remains unchanged if an attempt is made to transform the local state of a non-existing process. This will not be explicitly mentioned in the explanations given below. The function csmsig : ExtSig^ ^VK"^ XGK -^ GK ^^ used to describe how the ACP actions corresponding to the input guards of (p~SDL transform states. csmsigiisig, i, i'), {v\,..., u„), G) = (nowiG), lsts{G) e [i' H^ (p, a, 6, X)}) if e.xistsd'. G) G otherwise where p a 0 X
— stg{lsts{G)[') 0 {v\ \-^ vals{sig)\, — f// i-^ vals{sig)n, sender \-^ /}, = nnvfirst(inpqi!stsiG)j'), sig), = {sig} ^ timers{lsts{G)i'). = ptype{lsts{G)i')
csmsig((sig, /, i'), (f i , . . . , i;„), G) deals with the consumption of signal sig by the process with pid value i'.li transforms the local state of the process with pid value /', the process by which the signal is consumed, as follows: • the values carried by sig are assigned to the local variables u i , . . . , f,, of the consuming process and the sender's pid value (/) is assigned to sender; • the first occurrence of sig in the input queue of the consuming process is removed; • if sig is a timer signal, it is removed from the active timers.
Discrete time process algebra and the semantics of SDL
1249
Everything else is left unchanged. The function sndsig : ExtSig^ x GK -^ GK is used to describe how the ACP actions corresponding to the output actions of (p~SDL transform states. sndsig({sigJ,i'),G) = {now{G), lsts{G) e {i' H^ (/?, a, 6, X)}) if exists{i\ G) G otherwise where p = stg(lsts{G)i'), a = inpq{lsts{G)i') ^ {{sig, /, /')>, 0 = timers(Ists(G)i'), X = ptype{lsts{G)r) sndsig((sig, /, i'), G) deals with passing signal sig from the process with pid value / to the process with pid value /'. It transforms the local state of the process with pid value i\ the process to which the signal is passed, as follows: • sig is put into the input queue of the process to which the signal is passed (unless /' = 1, indicating that the signal is passed to the environment). Everything else is left unchanged. The function settimer : N x Sig^ y^^i ^ GK -^ GK is used to describe how the ACP actions corresponding to the set actions of (/?~SDL transform states. settimer{t, sig, i,G) = (now(G), Ists(G) e {/1-> (/o, a, 0, X}}) if e.xistsU, G) G otherwise where p a
= stg{lstsiG)i), = rmvfirst(inpq{lsts{G)i),sig) rmvfirst{inpq(lsts(G)i), sig) " {{sig. /, /)> 0 = timers(Ists(G)i) 0 {sig h^ t] timers(lsts(G)i) 0 [sig h^ nil) X = ptypeilstsiG)i)
if t ^ now{G) otherwise , if t ^ now{G) otherwise ,
settimer(t, sig, /, G) deals with setting a timer, identified with signal sig, to time t. If t has not yet passed, it transforms the local state of the process with pid value /, the process to be notified of the timer's expiration, as follows: • the occurrence of sig in the input queue originating from an earlier setting, if any, is removed; • sig is included among the active timers with expiration time t; thus overriding an earlier setting, if any. Otherwise, it transforms the local state of the process with pid value / as follows: • sig is put into the input queue after removal of its occurrence originating from an earlier setting, if any; • sig is included among the active timers without expiration time. Everything else is left unchanged. The function resettimer : Sig^ X^^I^GK ^ GK is used to describe how the ACP actions corresponding to the reset actions of (^~SDL transform states. resettimer (sig, i,G) = (now(G), IstsiG) 0 {/1-> ip, a, 6. X)]} if e.xistsU, G) G otherwise
1250
J.A. Bergstra et al. where p a 0 X
= stg{lsts{G)i), = rmvfirst{inpq(lsts(G)i), sig), = {sig} <^ timers{lsts{G)i), = ptype{lsts{G)i)
resettimer{sig, /, G) deals with resetting a timer, identified with signal sig. It transforms the local state of the process with pid value /, the process that would otherwise have been notified of the timer's expiration, as follows: • the occurrence of sig in the input queue originating from an earlier setting, if any, is removed; • if sig is an active timer, it is removed from the active timers. Everything else is left unchanged. Notice that settimer{t, sig, /, G) and settimer{t, sig, /, resettimer(sig, /, G)) have the same effect. In other words, settimer resets implicitly. In this way, at most one signal from the same timer will ever occur in an input queue. Furthermore, the context-sensitive conditions for syntactic correctness of (/?~SDL specifications imply that timer signals and other signals are kept apart: not a single signal can originate from both timer setting and customary signal sending. Thus, resetting, either explicitly or implicitly, will solely remove signals from input queues that originate from timer setting. The function assignvar : V^ x L^ x N2 x ^^^ ^- ^^ is used to describe how the ACP actions corresponding to the assignment task actions of <^~SDL transform states. assignvar(v, u,i,G) = (nowiG), IstsiG) e {/ H> (p, or, 0, X)}) if e.xists{i, G) G otherwise where p a 0 X
= stg{lsts{G)i)^[v\-^ u), = inpq{lsts{G)i), = timersilsts(G)i), = ptype{lsts{G)j)
assignvar(v, u, i, G) deals with assigning value u to variable v. It transforms the local state of the process with pid value /, the process to which the variable is local, as follows: • M is assigned to the local variable f, i.e. i; is included among the variables in the storage with value w; thus overriding an earlier assignment, if any. Everything else is left unchanged. The function createproc : N2 x PrCrD'^ x GK -^ GK is used to describe how the ACP actions corresponding to the create actions of (p~SDL transform states. The elements of PrCrD'^ are like process creation data, i.e. elements of PrCrD^, but values are used instead of value expressions: PrCrD'^ = {(X, ( u i , . . . , i;„), (wi,..., M„), i) \ X ePK. V\, .. .,Vn e VK, U\, ...,Un eU, i e N2}. createprocii', (X^ (u),..., f„>, (w| w,;>, /), G) = {now{G),lsts{G)®[i i-> (p,or, ^, X),/'i-> {p ,o\e' ,X'))) \i exists{i,G) G otherwise
Discrete time process algebra and the semantics of SDL where p a 6 X p' o'
1251
= stg{lsts(G)j) ^ {ofispr'mg)-^ i'}, = inpq(Ists{G)i). = timers{lsts(G)i), = ptype(IstsiG)i)^ — \x)\\-^ u\,
i;,j h-> w„, parent h^ /, offspring h^ 0, sender h-> 0},
={),
createproc(i\ (X\ {v\,..., i;„), ( w i , . . . , w„), / ) , G) deals with creating a process of type X\ It transforms the local state of the process with pid value /, the parent of the created process, as follows: • the pid value of the created process (/') is assigned to offspring. Besides, it creates a new local state for the created process which is initiated as follows: • the values M i , . . . , M„ are assigned to the local variables u i , . . . , u,, of the created process and the parent's pid value (/) is assigned to parent; • X' is made the process type. Everything else is left unchanged. The function stopproc :^2^QK ^^ GK is used to describe how the ACP actions corresponding to stop in (^~SDL transform states. stopproc(i,G) = {now{G),{i} <^lsts{G)) stopproc{i, G) deals with terminating the process with pid value i. It disposes of the local state of the process with pid value /. Everything else is left unchanged. The function inispont :^2^GK ^^ GK is used to describe how the ACP actions used to initiate spontaneous transitions transform states. inispont(i, G) = (now{G)Jsts(G)®{i\-^ G
{p,a,0,X)})
if existsU, G) otherwise
where p = stg(lstsiG)i) ^ {sender h^ i}, a = inpq(lsts(G)i), 0 = timers{lsts(G)i), X = ptype(lsts(G)i) inispont(i, G) deals with initiating spontaneous transitions. It transforms the local state of the process with pid value /, the process for which a spontaneous transition is initiated, by assigning / to sender. Everything else is left unchanged. The function unitdelay : GK -^ V^X\{GK) is used to describe how progress of time transforms states. In general, these transformations are non-deterministic - how signals from expiring timers enter input queues is not uniquely determined. Therefore, this function yields for each state a set of possible states. G' € unitdelayiG) ^ now(G') = now{G) -\- 1 A V/ e dom(lsts{G)) . stgilsts(G')i) = stgiIsts(G)i) A (3a e InpQ •
1252
J.A. Bergstra et al. inpq{lsts{G')i) = inpq{lsts{G)i) ^ a A a 6 merge({(sig, /, /) | timers{lsts{G)i){sig) ^ now{G)]))A timers(lsts{G')i) = timers{lsts(G)i) 0 {sig\-^ nil | timers{lsts{G)i)(sig) ^ nowiG)} A ptype(lsts(G')i) =ptype(Ists{G)i)
unitdelay(G) transforms the global state as follows: • the system time is incremented by one unit; • for the local state of each process: - its storage is left unchanged; - the signals that correspond to expiring timers are put into the input queue in a nondeterministic way; - for each of the expiring timers, the expiration time is removed; - its process type is left unchanged. State observers. In general, the state observers examine one component of the local state of some process. The only exceptions are hasJnstance and instances, which may even examine the process type component of all processes. If an attempt is made to observe the local state of a non-existing process, each non-boolean-valued state observer yields nil and each boolean-valued state observer yields f. This will not be explicitly mentioned in the explanations given below. The function contents : V/^ x N2 x 5/^ -^ L^ U {nil} is used to describe the value of expressions of the form value(v, e), which correspond to the variable accesses and view expressions of <^~SDL. contents(v, i, G) = p(v) if exists{i, G) Av e dom(p) nil otherwise where/O = stg(lsts(G)i) contents(v, i, G) yields the current value of the variable v that is local to the process with pid value /. The function isMCtive : Sig^ x N2 x ^^ -^ B is used to describe the value of expressions of the form active(sig, e), which correspond to the active expressions of <^~SDL. isMctive(sig,i,G) = t if e.xistsii,G) A sig edom{0) f otherwise where 0 = timers(Ists(G),) isMCtive(sig, i, G) yields true iff sig is an active timer signal of the process with pid value /. The function is.waiting : SaveSet^ x N2 x ^^ ^ B is used to describe the value of conditions of the form waitingi{s\,..., ^„}, ^), which are used to give meaning to the state definitions of (p~SDL. is-waiting (ss, i,G) — t if existsU, G) A getnxt{a. ss) = nil f otherwise where a = inpq{Ists{G)i)
Discrete time process algebra and the semantics of SDL
1253
is.waitingiss, /, G) yields true iff there is no signal in the input queue of the process with pid value / that has a name different from the ones in ss. The function type :N\ x Q^ ^^ P^U {env} U {nil} is used to describe the value of conditions of the form type(e, X), which are used to give meaning to the output actions with explicit addressing of <^~SDL. type(i,G)
= X if exists{i,G) env if / = 1 nil otherwise
where X = ptype{lsts{G)i) type{i, G) yields the type of the process with pid value /. Different from the other state observers, it yields a result if / = 1 as well, viz. env. The function hasJnstance : {P^ U {env}) x ^^ ^ B is used to describe the value of conditions of the form hasinst(X), which are used to give meaning to the output actions with implicit addressing of (p~SDL. hasJnstance(X, G) = t if 3/ € Nj • (/ = 1 v existsU, G)) A type{i, G) = X f otherwise hasJnstance(X, G) yields true iff there exists a process of type X. The function nxtsig : SaveSet^ x N2 x ^;, ^ ExtSig^ U {nil} is used to describe the result of executing input actions, which are used to give meaning to the input guards of (^~SDL. nxtsig(ss,i,G) where a =
= getnxt{a,ss) nil
iiexists{i,G) otherwise
inpq(lsts{G)i)
nxtsigiss, i, G) yields the first signal in the input queue of the process with pid value / that has a name different from the ones in ss. The function instances : {P^ U {env}) x Q^ -^ PfinCN:) U {{1}} is used to describe the result of executing outputi actions, which correspond to the output actions with implicit addressing of (p~SDL. instancesiX, G) =
{/ G dom{lsts{G)) \ typed, G) = X] if X # env {1} otherwise
instances(X, G) yields the set of pid values of all existing processes of type X ii X ^ env and the singleton set {1} otherwise. 4.5.3. Evaluation of value expressions. The function evalc is used to evaluate value expressions in a state G. The state observers contents and is.active defined in Section 4.5.2 are used to define the evaluation function. evalG{opie\,...,en)) opievalc (e\),..., nil
= evalc (en)) if evalQ (^ 1) 7^ nil A • • • A evalc (en) ¥" ^^^ otherwise
1254
JA. Bergstra et ai evalQ{cond{e\,e2,e2,))
evalQ(value{v,e))
= evalQiei) MevalQ{e\) =\ evalQicT,) \ievalQ{e\) =\ nil otherwise
= contents{v,evalQ{e),G) nil
evalQ(active{s{e\,. ..,en),e)) isMctive(sig, evalc{e),G) nil
\i evalcie) otherwise
e^2
= if evalc(^i) ^ nil A • • • A evalc (en) 7^ nil A evalcie) € N? otherwise
where sig = (5, {evalG{e\),...,
evalcien)))
evalQ(now) = now(G)
In all of these cases, if the value of at least one of the subexpressions occurring in an expression is undefined in the state concerned, the expression will be undefined, i.e. yield nil. We extend evalc to sequences of value expressions and signal expressions as follows: evalG({e\,...,en)) = (evalciei),... ,evalQ{e„)) if evalciei) 7^ nilA • • A evalcien) 7^ nil nil otherwise evalG((s,es))
= (s,evalQ(es)) nil
if evalQ(es) ^nW otherwise
4.5.4. Definition of the state operator. In this subsection, we define the functions act, eff, eff^, sig and val in completion of the definition of the state operator used to describe the meaning of <^~SDL system definitions. Recall that for this state operator S = QK. Action and effect fiinctions. In the current application of PAjjlj', A — Cr^ U Act^ U Act'^ U {u}, where Act^ — Act~ U Cr^. The actions in Acr^ are actions that may change the state in which they are executed. The actions in Act'^ are actions that are performed as the result of the execution of actions in Act^ in a state. The actions in Cr^ and Cr^ are the process creation actions and the actions that are left as a trace of the process creations that occur, respectively - note that we use the data set D = PrCrD^ for process creation. The action and effect functions are trivial for actions that are not in Act^. In order to keep the definitions comprehensible, we will use the following abbreviations. Let ^ be a value expression, let es be a sequence of value expressions, and let se be a signal expression. Then we write e' for evalcie), es' for evalc (es) and se' for evalc (se). act(input(is, {v\,... ,Vn)),ss,e),G) = {input'{{sig, i, j)) \ snm{sig) = 5, nxtsig{ss, e', G) = {sig, /, j). e € N2} eff{input{{s, ( v i , . . . , v„)), ss, e), G, a) = csmsig{nxtsig{ss, e', G), {v|,..., v,?), G) if a e act {input {{s, ( v j , . . . , v,,)), ss, e), G) G otherwise
Discrete time process algebra and the semantics of SDL
1255
act {outpute(se, e\,e2),G) = {output'{ise\ e\, 4 ) ) | se' ^ nil, e\ € N2, e^ G Ni} eff{outpute(se,e\,e2),G,a) = sndsigiise', e'^ ,e2),G)\ia e act{outpute{se, G otherwise
e\,e2),G)
act{outputi{se, e,X),G) = [output'((se', e', /)) | se' 7^ nil, e' e N2, / e instancesiX. G)} eff(outputi{se, e, X), G, a) = sndsig((se',e',i),G)ifa e act(outputi{se, e,X),G) Aa = output'{{se ,e', /)) G otherwise act(set(e\, se, ej), G) = {set'{e'^, se , e'^) \ e'^ 6 N, se' ^ nil, e'^ € N2I eff{set{e\, se, ^2), G, a) = settimer{e'^, se', e'^.G) if a G act{set{e\, se, ei), G) G otherwise act(reset{se, e), G) = {reset'{se', e') \ se' ^ nil, e' e N2I eff{reset{se, e),G,a)
= resettimer{se', e',G)ifae act{reset{se, e),G) G otherwise
act(ass{v, e\, ej), G) = {tt\ e'^ # nil, e'-^ e N2} eff{ass{v, e\, ei), G, a) = assignvar{\\ e'^, e'^. G)\ia e act{ass{\\ e\, ei), G) G otherwise act{cr{i, {X, vs, es, e)), G) = {n\i e N2, es' i^ nil, e G N2} effi^{i,{X,vs,es,e)),G,a) = createproc{i, (X, vs, es , e), G) if fl G act{n'{i, {X, vs, es, e)), G) G otherwise act{stop{e),G) = {u\e'
e^i)
eff{stop{e), G, a) = stopproc{e', G) Ha e act{stop{e), G) G otherwise act{inispont{e),G)
= [tt\e'
e^i)
ejf(inispont{e), G, a) = inispont{e', G) if a G act{inispont{e), G) G otherwise For all actions a G Cr^ U Act'^ U {/r}: act(a, G) = a eff{a,G,a') = G
The effect of applying the state operator to a process of the form arei(x) is described by mean of the function eff^. eff^{G) = unitdelay{G)
1256
J.A. Bergstra et al.
Signal function. First, we define the function atoms : G^ -^ Vf\n(AtProp^.) giving for each state the set of atomic propositions that hold in that state. It is inductively defined by contents(v, /, G) = u =^ value(v, w, /) e atoms{G) isMctiveisig, i, G) =\ =^ active{sig, i) 6 atoms{G) We now define the function sig : Q^ -> Prop^, giving the propositions produced by the states, as follows: sig{G)
=
AcpeatomsiG)^
So sig(G) is the conjunction of all atomic propositions that hold in state G. Valuation function. In the current application of PA^^^, B^i = AtCond^ UAtProp^. The function val is defined in the following way: val(eq(e 1,62), G) = t if e'^ =e^ /\e^ :^v\\\/\e^ ^ nil f otherwise val (waiting (ss, e), G) = t if is ^waitingiss, e\ G) =\Ae' eN2 f otherwise val{type{e,X),G)= t iitype{e\G) =X Ae eN] f otherwise val(hasinst{X), G) = has-instance {X, G) val{valueiv, u, /), G) = t if value{v, w, /) e atoms(G) f otherwise val(active(sig, /), G) = t if active(sig, i) € atoms{G) f otherwise Note that the sets AtCond^ and AtProp^ are disjoint. The elements of AtCond^ are used as conditions with a truth value that depends upon the state. The elements of AtPwp^ are not used as conditions and their valuation in a state is not needed for the semantics of (p~SDL.
4.6. Semantics of system definitions In this subsection, we present a semantics for (p~SDL system definitions. It relies heavily upon the specifics of the state operator defined in Section 4.5. According to the semantics presented here, the meaning of a (p~SDL system definition is a process described by a process expression - a term of PA^j^J^ extended with the counting process creation operator and the state operator to be precise. It is given in terms of the semantics of cp'SDL process definitions presented in Section 4.3 and the contextual information extracted by means of the function {[_]} defined in Appendix B.
Discrete time process algebra and the semantics
of SDL
1257
4.6.1. System definition. The semantics of a (^"SDL system definition depends on a parameter Env representing the environment of the system. This environment Env has to be described by a PA^^^ term. [system5;D,...A,endsystem;l(£w) := A.Go(E'i'^'(P) I ^/7v) where P (D Go
= \\i^^^ ,,^^} (D(/ + 1, (pt{i + ! ) , ( > , {),0)), = {(/,J)i->vI/(/)|3D€{Di,...,A,). IDY = ipnm(d),^)}, = (0, {/ + 1 h^ Loii + 1) I / € {1 no}}),
Lo(i) = ({parent 1-^ 0, offspring \-^ 0, sender i-^ 0}, (), {}.pt(i)), K
= {[system 5;D| ... D„ endsystem;]}
and /?r:{l + l,...,AiQ4-l}-^ procs(K) is such that VX eprocs{K) • card(pr~' (X)) = /m7(fc, X). The function pt is used to assign pid values for the processes created during system startup. It maps a set of pid values to the types of the processes with these pid values. The process expression that corresponds to a system definition expresses that, for each of the process types defined, the given initial number of processes are created and these processes are executed in parallel, starting in the state Go, while they receive signals via signal routes from the environment Env. Go is the state in which the system time is zero and there is a local state for each of the processes that is created during system start-up. Recall that the pid value 1 is reserved for the environment. The mapping ^ from pid values and process creation data to process expressions is derived from the meaning of the process definitions occurring in the system definition. This mapping is used by the counting process creation operator, which is needed for process creation after system start-up. 4.6.2. Environments. The semantics of <^~SDL system definitions describes the meaning of a system definition for an arbitrary process Env that represents the behaviour of the environment. Here we explain how the environment's behaviour is described by a PA^^^^ process. Some general assumptions have to be made about the behaviour of the environment of any system described using (p~SUL. Further assumptions may be made about the behaviour of the environment of a specific system described using (^~SDL, including ones that facilitate analysis of the system concerned. The general assumptions made about environments are: • the environment can only send signals that are defined in the system definition concerned; • the environment can only send signals to processes to which it is connected by signal routes; • the environment can send only a finite number of signals during a time slice. Besides, the viewpoint is taken that the processes that constitute a system are not observable to its environment. This leads to the use of output actions with implicit addressing in representing the environment's behaviour. The set EnvSig^ of possible environment signals is determined by the specific types of signals and signal routes introduced in the system definition concerned. It can be obtained
1258
J.A. Bergstra et al.
from the environment signal description yielded by applying the function envsigd (defined in Appendix B) to the context ascribed to the system definition. For an arbitrary context K, the set of environment signals is obtained as follows: EnvSig,
= U((.,(r,
T„)),X)eenvsigdiK)M'^
(^ , • • • ^ tn)). 1, X) Ui € 7,"^, . . . , /„ G T,^}
It is clear that in general the set EnvSig^ is infinite because signals can carry values from infinite domains. Besides, the environment can send an arbitrary signal from EnvSig^. To represent this we need the alternative composition of an infinite number of alternatives. This can be done using the operator YldD ^^ M C R L [22]. However, the combination of this operator with the extension of discrete time process algebra we are using has not been investigated thoroughly. Besides, the potential unbounded non-determinism introduced by this operator does not allow to use conventional validation techniques. A process that satisfies the three above-mentioned assumptions can be defined in the following way: Env,^ = 2_.Env,j EnvQ = are\(EnvK) EnVfj^l = Envn + ^J
outputi(osig) - Env,j
osig-.EmSig^-
In order to use an environment process as a parameter of the presented semantics of (p~SDL, it has to be given as a process in PA^|!|'. Below we define such an environment process. We call it a standard environment process for the semantics of (p~SDL. It is determined by two restrictions: • the set of signals which the environment can send to the system is restricted to a finite subset ES c EnvSig^; • the maximal number of signals which can be sent in one time slice is bounded by a natural number A^^. A standard environment is defined as follows: ne{0
EHVQ
=
A',}
afe\(Env^)
Ef^^fj^l = Env'fj-\-
y_, outputiiosig)
• Em'lj
osigeES
One may also define another environment process for a specific system. In any case the process representing the system's environment must satisfy the above-mentioned assumptions. 4.6.3. Delaying channels. The process algebra semantics of (p~SDL makes clear how to model a delaying channel by means of a <^~SDL process. Below a (p~SDL process definition of such a process, called ch, is given. It is assumed that the process can only receive signals of type e s . The process consumes signals e s ( r e v , v l , . . . , vn) and passes them on after an arbitrary delay, possibly zero, with r e v replaced by snd. Each signal consumed carries
Discrete time process algebra and the semantics of SDL
1259
the pid value of the ultimate receiver, and this pid value is replaced by the one of the original sender when the signal is passed on. This is needed because the original sender and ultimate receiver have now an intermediate receiver and intermediate sender, respectively. The d e c i s i o n construct is used to find out whether the original sender used implicit or explicit addressing. Note that we write N u l l for 0, i.e. the special pid value that never refers to any existing process. process ch(l); start; nextstate receive; state receive; input es(rev,vl,...,vn); task snd := sender; nextstate deliver; state deliver; save es; input none; decision rev = Null; (True): output es(snd,vl,...,vn) via sr_out; nextstate receive; (False): output es(snd,vl,...,vn) to rev via sr_out; nextstate receive; enddecision; endprocess;
In state d e l i v e r , there will never be signals to consume because all signals are withhold from being consumed by means of s a v e e s . This means that the behaviour from this state may be delayed till any future time slice. The total lack of signals to consume does not preclude the process to proceed, because the only transition alternative is a spontaneous transition, i.e. it is not initiated by the consumption of a signal.
5. Closing remarks In this section, we sum up what has been achieved. We also describe in broad outline what is anticipated to be achieved more, thus hinting at topics for future research. But, to begin with, we present an overview of related work.
5.1. Related work In [17], a foundation for the semantics of SDL, based on streams and stream processing functions, has been proposed. This proposal indicates that the SDL view of a system gives an interesting type of asynchronous dataflow networks, but the treatment of time in the proposal is however too sketchy to be used as a starting point for a semantics of the time
1260
J.A. Bergstra et aL
related features of SDL. Besides, process creation is not covered. In [15], we present a process algebra model of asynchronous dataflow networks as a semantic foundation for SDL. The model is close to the concepts around which SDL has been set up. However, we are not able to cover process creation too. An operational semantics for a subset of SDL, which covers timing, has been given in [21]. Many relevant details are worked out, but it is not quite clear whether time is treated satisfactory. This is largely due to the intricacy of the operational semantics. At the outset, we have also tried shortly to give an operational semantics for (p~SDL, but we found that it is very difficult. Our experience is that the main motivations for the rules describing an operational semantics are unavoidably intuitive. This may already lead to an undesirable semantics in relatively simple cases. For example, working on PA^^^^, we have seriously considered to have the premise w e[Sp(x)] in the rule for time unit delay (see Table 11). However, this plausible option would render all delayed processes bisimilar to deadlock in the current time slice, i.e. crre\{x) = 5 would hold. It is Hkely that, if we had taken parallel composition with communication, we would have been able to use special processes, put in parallel with the other ones, instead of the counting process creation operator and the state operator. The approach to use special processes is followed in [35]. There, it is largely responsible for the exceptional intricacy of the resulting semantics, which, by the way, has kept various obvious errors unnoticed for a long time. Amongst other things for this reason, we have chosen to use the counting process creation operator and the state operator instead. Besides, the approach to use special processes brings along a lot of internal communication that is irrelevant from a semantic point of view. Of course, in case an ACP-style process algebra is used as the basis of the presented semantics, there is the option to use an abstraction operator to abstract from the internal communication (for abstraction in process algebra, see, e.g., [9]). However, it seems far from easy to elaborate the addition of abstraction to PA^^^ or its adaptation to parallel composition with communication. For a subset of SDL, called /xSDL, both an operational semantics and a process algebra semantics has been given in [20]. The operational semantics of /xSDL is related to the one presented in [21], but time is not treated. The basis of the corresponding process algebra semantics is a time free process algebra, essentially //CRL [22] extended with the state operator. Like in [35], special processes are used for channels and input queues although there is no need for that with the state operator at one's disposal. Interesting is that first the intended meaning of the language constructs is laid down in an operational semantics so that it can be reasonably checked later whether the process algebra semantics reflects the intentions. However, the SDL facilities for storage, timing and process creation are not available at all in /xSDL; and the facilities for communication are only partially available. In [19], BSDL is proposed as a basis for the semantics of SDL. BSDL is developed from scratch, using Object-Z, but it does not seem to fit in very well with SDL. In [24], it is proposed to use Duration Calculus [30] to describe the meaning of the language constructs of SDL. Thus an interesting semantic link is made between SDL and Duration Calculus, but it seems a little bit odd to view the main semantic objects used, viz. traces, as phases of system behaviour, called state variables in Duration Calculus, of which the duration is the principal attribute.
Discrete time process algebra and the semantics of SDL
1261
5.2. Conclusions and future work We have presented an extension of discrete time process algebra with relative timing and we have proposed a semantics for the core of SDL, using this extension to describe the meaning of the language constructs. The operational semantics and axiom system of this ACP-style process algebra facilitates advances in the areas of validation of SDL specifications and verification of design steps made using SDL, respectively. At present, we focus on validation. We do so because practically useful advanced tools and techniques are within reach now while there is a tremendous need for them. For vahdation purposes, we have to transform (^~SDL specifications to transition systems in accordance with the process algebra semantics. Generating transition systems from finite linear recursive specifications in BPA^^|^ (see Section 2.4) is straightforward. In Section 4, the meaning of a (^~SDL process definition is described by a finite guarded recursive specification in BPA^^'^ that can definitely be brought into linear form. The meaning of a (^~SDL system definition is given in terms of the meaning of the occurring process definitions using the parallel composition operator, the counting process creation operator and the state operator. An obvious direction is to devise, for each of these operators on processes, a corresponding syntactic operator on finite linear recursive specifications that, under certain conditions, yields a linear recursive specification of the process that results from applying the operator on processes to the process(es) defined by the recursive specification(s) to be operated on. Of course, we look for non-restrictive conditions, but finiteness of the state space, a finite upper bound on the total number of process creations and a finite upper bound on the number of signals per time slice originating from the environment are inescapable. It goes without saying that we have to show the correctness of these syntactic operators. For that purpose, we have available the axioms presented in Section 2 and RSP (see Section 2.4). In [12], timed frames, which are closely related to the kind of transition systems presented by the operational semantics of, for example, BPA^^^-ID and PA^j.j-ID, are studied in a general algebraic setting and results concerning the connection between timed frames and discrete time processes with relative timing are given. In [ 16], a model for BPA^j^-IDlin (BPA^j.j-ID with finite linear recursive specifications) is presented that gives an interpretation of its constants and operators on timed frames; and it is shown that the bisimulation model induced by the original structured operational semantics is isomorphic to the timed frame model. It is plausible that these results can be extended to BPAjjl^^lin - timed frames support propositional signals. This would mean that we can transform (^~SDL specifications to timed frames. In that case, we can basically check whether a system described in (^~SDL satisfies a property expressed in TFL [13], an expressive first-order logic proposed for timed frames. We are considering to look for a fragment of TFL that is suitable to serve as a logic for (^~SDL and to adapt an existing model checker to ?~SDL and this logic and thus to automate the checking. In particular, the model checker MEC [3] seems suited for this purpose - at least for small-scale systems. A fragment of Duration Calculus may be considered as well, since in [23] validity for Duration Calculus formulas in timed frames is defined. The extension of discrete time process algebra with relative timing, used to describe the meaning of the language constructs of (^~SDL, is fairly large and rather intricate. Theo-
1262
J,A. Bergstra et al.
retically interesting general properties, such as elimination, conservativity, completeness, etc. have yet to be established. We think that we are near the limit of what can be made provably free from defect. Still, owing to the nontrivial state space taken for the state operator, the presented semantics for (p'SDL uses an excursion outside the realm of process algebra that is not negligible. We wish to have abstraction added to the process algebra used in order to provide a more abstract semantics for (^~SDL, but right now we consider the consequences of this addition too difficult to grasp. All this suggests the option to develop a special process algebra that is closer to the concepts around which SDL has been set up. Of course, there is also the alternative to simplify SDL by removing SDL features that introduce semantic complexities but do not serve any practical purpose. The presented semantics of (^~SDL may assist in identifying such cases.
A. Notational conventions Meta-language for syntax. The syntax of (/?"SDL is described by means of production rules in the form of an extended BNF grammar. The curly brackets "{" and '*}" are used for grouping. The asterisk "*" and the plus sign *'^" are used for zero or more repetitions and one or more repetitions, respectively, of curly bracketed groups. The square brackets "[" and " ] " are also used for grouping, but indicate that the group is optional. An underlined part included in a nonterminal symbol does not belong to the context-free syntax; it describes a context-sensitive condition. Meta-language for semantics. The semantics of (^~SDL is described by means of a set of equations recursively defining interpretation functions for all syntactic categories. For each syntactic category, the corresponding interpretation function gives a meaning to each language construct c belonging to the category. We use the notation [c] or [cY for applications of all interpretation functions. The exact interpretation function is always clear from the context. If contextual information K is needed for the interpretation, it is provided by an additional argument and the notation [cY is used. Special action, condition and proposition notation. We write ^ : Di x • • • x D„ to indicate that a is an action parametrized by Di x • • • x D„. This means that there is an action, referred to as a((ii,..., ^,,), for each ( J i , . . . , J„) G Di x • • x D„. For atomic conditions and propositions, we use analogous notations. Special set, function and sequence notation. We write P(A) for the set of all subsets of A, and we write 7^fin(A) for the set of all finite subsets of A. We use abbreviations Ni and N2 for the sets N \ {0} and N \ {0, 1}, respectively. We write f \ A -^ B io indicate that / is a total function from A to ^, that is / c A X B A Vx € A . 3 i j G B • (jc,>0 € / . We write dom(f), where / : A -> 5, for A. We also write A -^ ^ for the set of all functions from A to ^ . For an (ordered) pair (x, j ) , where x and y are intended for argument and value of some function, we use the notation jc H> y to emphasize this intention. The binary operators ^ (domain subtraction) and 0 (overriding) on functions are defined by
Discrete time process algebra and the semantics of SDL A^ f
= {x\-^ y\x e dom(f) Ax ^ A A fix) = >}
f®8
=
1263
{dom(g)^f)Ug
For a function f : A^ B presenting a family B indexed by A, we use the notation /, (for i e A) insteadof/(/). Functions are also used to present sequences; as usual we write (xi,... ,x„) for the sequence presented by the function {1 i-^ jci,..., A? H> x,,}. The unary operators hd and tl stand for selection of head and tail, respectively, of sequences. The binary operator ^ stands for concatenation of sequences. We write x &t for {x) ^ t.
B. Contextual information The meaning of a language construct of (p~SDL generally depends on the definitions in the scope in which it occurs. Contexts are primarily intended for modeling the scope. The context that is ascribed to a complete (p~SDL specification is also used to define the state space used to describe its meaning. The context of a language construct contains all names introduced by the definitions of variables, signal types, signal routes and process types occurring in the specification on hand and additionally: • if the language construct occurs in the scope of a process definition, the name introduced by that process definition, called the scope unit; • if the language construct occurs in the scope of a state definition, the set of names occurring in the save part of that state definition, called the save set. The names introduced by the definitions are in addition connected with their static attributes. For example, a name of a variable is connected with the name of the sort of the values that may be assigned to it; and a name of a process type is connected with the names of the variables that are its formal parameters and the number of processes of this type that have to be created during the start-up of the system. Context — V^^{VarD) x Vf^niSigD) x Vt\^iRouteD) x V^niProcD) x (Proc/JU {nil)) x V^^iSigld) where VarD SigD RouteD ProcD
= = = =
Varld x Sortid Sigid X Sortid"" Routeld x (Proc/^U {env}) x (Prac/JU {env}) x Vw^iSigld) Procid x Varld'' x N
For language constructs that do not occur in a process definition, the absence of a scope unit will be represented by nil and, for language constructs that do not occur in a state definition, the absence of a save set will be represented by 0. We write vards(K), sigds{K), routeds{K), procds(K), scopeunit(K) and saveset(K), where K = (V, S, /?, P, X, ss) e Context, for V, 5, /?, P, X and ss, respectively. We write vars(K) for {v \3T • (i;, T) e vardsiK)}. The abbreviations 5/^^(/c) andprocs(K) are used analogously. We make use of the following functions on Context:
1264
J.A. Bergstraetai rev : Context x Routeld -^ P roe Id U {env}, Jpars : Context x Proeld -> Vhr/J*, m/r : Context x Proeld -^ N, updscopeunit : Context x Proeld -^ Context, updsaveset : Context x V^^iSigld) -^ Context, envsigd : Context -^ Vf\j^(SigD x Proeld)
The first three functions are partial functions, but they will only be applied in cases where the result is defined. The function rev is used to extract the receiver type of a given signal route from the context. This function is inductively defined by (r,X\,X2, ^^) € routeds{K) => rcv{K, r) = X2 The functions^«r5 and init are used to extract the formal parameters and the initial number of processes, respectively, of a given process type from the context. These functions are inductively defined by (X, vs, k) eproeds(K) => fpars{K, X) = vs, {X, vs, k) e proeds(K) => init(K, X) = k The functions updscopeunit and updsaveset are used to update the scope unit and the save set, respectively, of the context. These functions are inductively defined by K = (V,S,R,P,X,ss) K = (V,S,R,P,X,ss)
=> updscopeunit{K,X') = {V,S,R,P,X\ss), => updsaveset{K,ss') = {V,S,R,P,X,ss')
The function envsigd is used to determine the possible environment signals, i.e. signals that the system can receive via signal routes from the environment. It is inductively defined by s ess /\(s,{T\,...,Tn)) ((s, {Ti,...
e sigdsiK) A (r. env, Xi^ss) e routeds{K) =^
,Tn)), X2) e
envsigdiK)
The context ascribed to a complete (p~SDL specification is a minimal context in the sense that the contextual information available in it is common to all contexts on which language constructs occurring in it depend. The additional information that may be available applies to the scope unit for language constructs occurring in a process definition and the save set for language constructs occurring in a state definition. The context ascribed to a complete specification is obtained by taking the union of the corresponding components of the partial contexts contributed by all definitions occurring in it, except for the scope unit and the save set which are permanently the same - nil and 0, respectively. {[system S;D \...Dn
endsystem; ]} :=
{vardsilD^^) U . . . U vardsiiDnl), sigdsilDxl) U . , . U sigdsiiDuli), routedsilDxl) U ... U roiitedsilDnl), proedsilDx"^) U . . . UprocdsilDul), nil,0)
ffdclvr;]}
:= ({(v, 7)}, 0, 0, 0, nil, 0)
Discrete time process algebra and the semantics of SDL {[signal 5(ri,...,r,z);]} := (0, {(5, (7,
1265
r,;,»}, 0, 0, nil. 0)
{[signalrouterfromXi toX2 with 5 1 , . . . ,5,,;]) := (0,0,{(r,Xi,X2,{5i,...,5„})},0,nil,0) {[processX(/:);fparvi, ..,v,;,;start;// Ji ... J,, endprocess;]} := (0,0,0,{(Z,(vi,...,v,„>,^)},nil,0)
Acknowledgements For one month all three authors were at UNU/IIST (United Nations University, International Institute for Software Technology) in Macau. During that period, some of the more important corrections and technical changes of the material presented here were made. We thank Dines Bj0mer, the former director of UNU/IIST, for bringing us together in Macau. The third author thanks Radu §oricut and Bogdan Warinschi for their helpful comments and discussions.
References [1] L. Aceto, W.J. Fokkink and C. Verhoef, Structural operational semantics. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 197-292. [2] B. Algayres, Y. Lejeune, F. Hugonnet and F. Hantz, The AVALON project: A validation enviroment for SDUMSC descriptions, SDL '93: Using Objects, O. Faergemand and A. Sarma, eds, North-Holland (1993), 221-235. [3] A. Arnold, MEC, a system for constructing and analysing transition systems. Automatic Verification Methods for Finite State Systems, Lecture Notes in Comput. Sci. 407, J. Sifakis, ed.. Springer-Verlag (1990), 117-132. [4] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra (extended abstract), CONCUR'92, Lecture Notes in Comput. Sci. 630, W.R. Cleaveland, ed.. Springer-Verlag (1992), 401-420. Full version: Report P9208b, Programming Research Group, University of Amsterdam. [5] J.C.M. Baeten and J.A. Bergstra, Discrete time process algebra. Formal Aspects of Computing 8 (1996), 188-208. [6] J.C.M. Baeten and J.A. Bergstra, Process algebra with propositional signals, Theoret. Comput. Sci. 177 (1997), 381^05. [7] J.C.M. Baeten and C.A. Middelburg, Process algebra with timing: Real time and discrete time. Handbook of Process Algebra, J.A. Bergstra, A. Ponse and S.A. Smolka, eds, Elsevier, Amsterdam (2001), 627-684. [81 J.C.M. Baeten and C. Verhoef, Concrete process algebra. Handbook of Logic in Computer Science, Vol. IV, S. Abramsky, D. Gabbay and T.S.E. Maibaum, eds, Oxford University Press (1995), 149-268. [9] J.C.M. Baeten and W.P Weijland, Process Algebra, Cambridge Tracts Theoret. Comput. Sci. 18, Cambridge University Press (1990). [10] F. Belina, D. Hogrefe and A. Sarma, SDL with Applications from Protocol Specification, Prentice-Hall (1991). [11] J.A. Bergstra, A process creation mechanism in process algebra. Applications of Process Algebra, J.C.M. Baeten, ed., Cambridge Tracts Theoret. Comput. Sci. 17, Cambridge University Press (1990), 81-88. [12] J.A. Bergstra, W.J. Fokkink and C.A. Middelburg, Algebra of timed frames, Intemat. J. Comput. Math. 61 (1996), 227-255. [13] J.A. Bergstra, W.J. Fokkink and C.A. Middelburg, A logic for signal inserted timed frames. Logic Group Preprint Series 155, Utrecht University, Department of Philosophy (1996).
1266
J.A. Bergstra et ai
[14] J. A. Bergstra and C.A. Middelburg, Process algebra semantics ofipSDL Logic Group Preprint Series 129, Utrecht University, Department of Philosophy (March 1995). [15] J.A. Bergstra, C.A. Middelburg and R. §oricu|. Discrete time network algebra for a semantic foundation of SDL, Research Report 98, United Nations University, International Institute for Software Technology (1997). [16] J. A. Bergstra, C.A. Middelburg and B. Warinschi, Timed frame models for discrete time process algebras. Research Report 100, United Nations University, International Institute for Software Technology (1997). [17] M. Broy, Towards a formal foundation of the specification and description language SDL, Formal Aspects of Computing 3 (1991), 21-57. [18] J. Ellsberger, D. Hogrefe and A. Sarma, SDL, Formal Object-Oriented Language for Communicating Systems, Prentice-Hall (1997). [19] J. Fischer, S. Lau and A. Prinz, A short note about BSDL, SDL Newsletter 18 (1995), 15-21. [20] A. Gammelgaard and J.E. Kristensen, A correctness proof of a translation from SDL to CRL, SDL '93: Using Objects, O. Fasrgemand and A. Sarma, eds, Elsevier (North-Holland) (1993), 205-219. Full version: Report TFL RR 1992-4, Tele Danmark Research. [21] J.C. Godskesen, An operational semantics model for Basic SDL (extended abstract), SDL '91: Evolving Methods, O. Faergemand and R. Reed, eds, Elsevier (North-Holland), (1991), 15-22. Full version: Report TFL RR 1991-2, Tele Danmark Research. [22] J.F. Groote and A. Ponse, The syntax and semantics of p CRL, Algebra of Communicating Processes 1994, Workshop in Computing Series, A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Springer-Verlag (1995), 26-62. [23] C.A. Middelburg, Truth of duration calculus formulae in timed frames. Fund. Inform. 36 (1998), 235-263. [24] S. M0rk, J.C. Godskesen, M.R. Hansen and R. Sharp, A timed semantics for SDL, FORTE IX: Theory, Application and Tools, R. Gotzhein and J. Bredereke, eds. Chapman & Hall (1997), 295-309. [25] X. NicoUin and J. Sifakis, The algebra of timed processes ATP: Theory and application. Inform. Comput. 114(1994), 131-178. [26] L. Pruitt, 1994. Personal Communications. [27] M.A. Reniers and J.J. Vereijken, Completeness in discrete-time process algebra. Computing Science Report 96-15, Eindhoven University of Technology, Department of Mathematics and Computing Science (1996). [28] F.W. Vaandrager, Algebraic Techniques for Concurrency and their Applications, Ph.D. thesis. Centre for Mathematics and Computer Science, Amsterdam (1989). [29] C. Verhoef, A congruence theorem for structured operational semantics with predicates and negative premises, Nordic J. Comput. 2 (1995), 274-302. [30] Zhou Chaochen, C.A.R. Hoare and A.P Ravn, A calculus of durations. Inform. Process. Lett. 40 (1991), 269-276. [31] Methods for Testing and Specification (MTS); use of SDL in European telecommunications standards rules for testability and facilitating validation, ETSI Document ETS 300 414 (1995). [32] Specification of Abstract Syntax Notation One (ASN. I), ITU-T Recommendation X.208 (1988). [33] Specification and Description Language (SDL), ITU-T Recommendation Z. 100 (1994). [34] Specification and Description Language (SDL) - SDL formal definition: Static semantics, ITU-T Recommendation Z.IOO F2 (1994). Annex F.2 to Recommendation Z.IOO. [35] Specification and Description Language (SDL) - SDL formal definition: Dynamic semantics, ITU-T Recommendation Z.IOO F3 (1994). Annex F3 to Recommendation Z.IOO. [36] SDL combined with ASN. 1 (SDUASN.l) ITU-T Recommendation Z. 105 (1995). [37] SDTuser's guide, TeleLOGIC AB, Sweden (1992).
Subject index abstraction, 1260 ACP, 1214 action -ACP, 1215
--undelayable, 1215 -SDL, 1231 — assignment task, 1232 --create, 1232
Discrete time process algebra and the semantics of SDL --output, 1232 --reset, 1232 - - s e t , 1232 action function, 1254 active expression, 1233 alternative composition, 1215 assignment task action, 1232 asynchronous communication, 1229 atomic condition, 1239 atomic proposition, 1218, 1247, 1256 axiom system -ofBPA~j^-ID, 1216 -ofPA^j^-ID, 1216 -ofPAP^^ 1219 -ofPAP^'^rec, 1225 bisimulation, 1216 BPA~^-ID, 1215 channel, 1258 concatenation, 1263 conditional expression, 1233 context, 1263 counting process creation, 1226 create action, 1232 data types, 1237 deadlock, 1215 decision, 1232 definition -process, 1230 -signal, 1230 -signal route, 1230 -state, 1232 -system, 1230 -variable, 1230 delaying channel, 1258 discrete time, 1214 domain subtraction, 1262 duration calculus, 1260
-strict, 1219 -weak, 1219 head, 1263 implicit addressing, 1232 input guard, 1232 input queue, 1231, 1246 left merge, 1216 local state, 1247 local variable, 1229 /iCRL, 1258, 1260 merge -free, 1216 -left, 1216 non-existence, 1219 non-persistent, 1221 non-waiting, 1221 now -ACP, 1215 -SDL, 1233 offspring, 1233 operator application, 1233 output action, 1232 overriding, 1262 PA-^-ID, 1216
free merge, 1216
PA^^t'- 1217 PAP|;'rec, 1225 panth format, 1222 parent, 1233 pid value, 1229 principles -ofPAP|;'rec, 1225 process -ACP, 1215 -SDL, 1229 process algebra -discrete relative time, 1214-1217 - with propositional signals, 1217-1224 process behaviour, 1231-1232 process creation, 1226 process creation datum, 1239 proposition, 1218 -atomic, 1218, 1247, 1256 propositional condition, 1217 propositional signal, 1217
global state, 1247 guarded command
receiver type, 1230 recursion, 1224-1226
effect function, 1254 encapsulation, 1217 environment, 1257 -standard, 1258 environment signal, 1258, 1264 explicit addressing, 1232 extended BNF grammar, 1262
1267
1268
JA. Bergstra et al.
recursive definition principle, 1225 recursive specification, 1224 -guarded, 1225 -linear, 1225 -solution of, 1224 recursive specification principle, 1225 relative timing, 1216 repeater, 1234, 1244 reset action, 1232 root signal emission, 1219 router - address driven, 1234, 1244 -load driven, 1235, 1244
spontaneous transition, 1232 start transition, 1230 state -ACP, 1227 -SDL, 1231 state observer, 1252 state operator, 1227-1228, 1254 state transformer, 1248 storage, 1246 stratification, 1222 stream processing function, 1259 syntactic operator, 1261 system definition, 1229-1230
save set, 1239, 1263 scope unit, 1263 SDL, 1211 self, 1233 semantics -ofPAP^^1221 -ofPAP^'^rec, 1225 - o f SDL --process definition, 1240-1243 - - system definition, 1256-1259 sender, 1233 sender type, 1230 sequence, 1263 sequential composition, 1215 set action, 1232 signal -ACP - - propositional, 1217 -SDL, 1229, 1245 --extended, 1245 signal expression, 1239 signal function, 1256 signal pattern, 1239 signal route, 1229 signature -ofBPA^^-ID, 1215 -ofPA^^-ID, 1216 -ofPAP^', 1219 -ofPAP'^'rec, 1225
tail, 1263 term deduction system, 1222 TFL,1261 time factorization, 1216 time slice, 1214 time unit delay, 1215 timed frame, 1261 timed frame logic, see TFL timer, 1231, 1246 total function, 1262 transition, 1231, 1232 -spontaneous, 1232 -start, 1230 transition alternative, 1232 two-phase scheme, 1215 undelayable action, 1215 undelayable deadlock, 1215 valuation, 1218 valuation function, 1256 value expression, 1238 -evaluation of, 1253 values, 1233 variable access, 1233 view expression, 1233 (p~SDU 1211, 1229 (^SDL, 1229 Z.IOO, 1211
CHAPTER 19
A Process Algebra for Interworkings S. Mauw, M.A. Reniers Faculty of Mathematics and Computing Science, Eindhoven University of Technology, P.O. Box 513, NL-5600 MB Eindhoven, The Netherlands CWI, P.O. Box 94079, NL-1090 GB Amsterdam, The Netherlands Emails: [email protected], [email protected]
Contents 1. Introduction
1271
1.1. History and motivation 1.2. Interworkings and similar languages 1.3. Purpose and structure of this chapter 2. Interworkings
1271 1272 1273 1274
2.1. Interworking diagrams 2.2. Sequencing
1274 1275
2.3. Alternatives 2.4. Merge 3. Semantics of Interworkings 4. Sequential and alternative composition
1276 1277 1280 1288
5. The interworking sequencing
1292
6. The £-interworking merge 7. Process algebra for Interworkings 8. Conclusions 9. Bibliographical notes References Subject index
1300 1312 1321 1323 1325 1327
HANDBOOK OF PROCESS ALGEBRA Edited by Jan A. Bergstra, Alban Ponse and Scott A. Smolka © 2001 Elsevier Science B.V. All rights reserved
1269
1270
S. Mauw, MA. Renters
Abstract The Interworking language (IW) is a graphical formalism for displaying the communication behaviour of system components. In this chapter, we develop a formal semantics for the Interworking language. This semantics must support the analysis of (collections of) Interworking diagrams and allow to express the relation between diagrams. We will explain how techniques from process algebra can be successfully applied to this problem. Thereto, we introduce process operators for expressing the relationship between Interworking diagrams. We define a number of process algebras with increasing complexity. For each of these we prove completeness with respect to an operational semantics.
A process algebra for
Interworkings
1271
1. Introduction 1.1. History and motivation The Interworking language (IW) is a graphical formalism for displaying the communication behaviour of system components. It was developed in order to support the informal diagrams used at Philips Kommunikations Industrie (Numberg) which were used for requirements specification and design. Before discussing the rationale behind the IW language, we first show a simple Interworking diagram' in Figure 1. The name of the Interworking is displayed in the upper left comer of the diagram. This Interworking describes the interaction behaviour of three entities, which are called s, medium and r. Each entity is represented by a vertical line, which, when read from top to bottom, describes the successive interactions in which this entity takes part. A message exchange is represented by an arrow. The diagram shows that the three entities exchange four messages. First, s sends a req message to medium. Next, the same message is being sent from medium to r. Then, r sends a message reply back to medium, which sends the same message to s. This example shows the basic use of Interworkings. It describes one scenario of interaction between communicating entities. In general, when using IW for requirements specification, a collection of Interworkings is needed, containing a description of the most interesting scenarios. Often there is one main scenario, complemented with a number of scenarios describing exceptional behaviour. Using Interworkings in this way, the scenarios express alternative behaviours. There are, however, more reasons for having to deal with large collections of Interworkings for the description of a distributed system. First, the specified scenario can be too long to physically or logically fit in one diagram. Such a large scenario is then decomposed into a number of sub scenarios which are "sequentially" linked to each other. A second reason is that the horizontal size of the system, or more precisely the number of distinct entities, may be too large to fit in a single diagram. This gives rise to a collection of sub scenarios which denote the behaviour of different parts of the system. Each part then describes the behaviour of just a number of (logically related) entities. Of course, there must be a means to express that entities from distinct parts exchange messages with each other. The scenarios of these parts are linked to each other in a parallel way.
Example s medium. req req J reply reply
Fig. 1. An example Interworking diagram. ' The Interworking diagrams in this chapter are drawn with the MSC Macro package which can be obtained at httpiZ/www.win.tue.nlTsjouke/mscpackage.html.
1272
S. Mauw, MA. Renters
Due to the above mentioned reasons, in practice a system description using Interworkings often consists of a large collection of diagrams. Practical experience showed that it was very hard to maintain such large collections by hand. First of all, manually drawing and updating diagrams is an expensive activity. Secondly, the relation between the diagrams in a collection is only implicit. Some diagrams describe alternatives, some describe successive behaviour, and some describe parallel behaviour. The third problem, assuming the relation between the diagrams to be known, is that if one diagram changes also several related diagrams must be updated. A consistent update of a large collection of Interworkings could not be achieved manually. A final problem was that there existed different interpretations of the meaning of even simple Interworkings. These observations lead to the conclusion that when using Interworkings in the traditional and informal way it was not possible to take full advantage of the language. Therefore, the Interworking language needs a complete and explicit definition. Not only the development of an explicit language is motivated in this way, but also the need for a formal semantics of Interworkings. This semantics must support the analysis of (collections of) Interworking diagrams and allow to express the relation between diagrams. Moreover, since tool support is needed, the semantics must allow for easy derivation of (prototype) tools. In this chapter, we will explain how techniques from process algebra can be successfully applied to this problem. Thereto, we introduce process operators for expressing the relationship between Interworking diagrams. As explained above, there are three possible relations between Interworkings: alternative composition, sequential composition, and parallel composition. The most interesting is the interworking sequencing operator for composing Interworkings sequentially. Later in this chapter it will be explained why the standard process algebra operator for sequencing is not appropriate for Interworkings. The operator for parallel composition of Interworkings, is derived from the standard interleaving operator with synchronization. For the alternative composition operator there are different choices. For a discussion on this choice we refer to Section 2.3.
1.2. Interworkings and similar languages The Interworking language is not a unique and isolated language. It is very natural and intuitive to express the behaviour of a distributed system in such a graphical way. In fact, informal IW-like drawings are encountered very often in system design. Therefore, the Interworking language is a member of a large class of similar graphical notations, most of which are only informally defined, such as Signal Sequence Charts, Use Cases, Information Flow Diagrams, Message Flow and Arrow Diagrams. In object oriented design, a similar notation, called Sequence Diagrams, is used. They play an important role in the description of Use Cases in UML [31]. Interworkings are also related to Message Sequence Charts (MSC), see [12], which are standardized by the International Telecommunication Union (ITU). The main difference is that Interworkings describe synchronous communication, whereas Message Sequence Charts describe asynchronous communication. The semantics of MSC as described in [23,28] is also very similar to the semantics oflW.
A process algebra for Interworkings
1273
Traditionally, the main application area for IW and similar languages is the field of telecommunication systems. This is mainly due to the distributed nature of these systems. However, more and more applications outside the telecommunication world can be found, e.g., the description of work flows in business organizations [1]. The main reason why IW-Uke diagrams are so popular is the fact that they can be understood easily. This is due to their intuitive and graphical appearance. The diagrams can be used in different stages of the design of a software system. The main application is during requirements engineering, where they are used to capture initial requirements about the interactions in a system. Furthermore, they play a role in documentation, simulation and testing. The results of this chapter cannot completely be transferred to similar languages. This is mainly because IW describes synchronous communication, whereas most similar languages consider asynchronous communication. Nevertheless, the approach taken in this chapter is generic. It is at the basis of the semantics definition of Message Sequence Charts, as standardized by the ITU in Annex B to Recommendation Z.120 [13].
1.3. Purpose and structure of this chapter This chapter serves several purposes. First, it shows the process algebraic approach in defining the semantics of a scenario language. This typically entails the use of a number of operators which describe the ways in which scenarios or fragments of scenarios are combined. The meaning of such a diagram is then described by a process algebraic expression, which can be analyzed using standard techniques. Secondly, this chapter shows the development of non-standard operators in process algebra, needed for some domain specific application. These newly introduced operators will probably have little application outside the realm of scenarios. On the other hand, the interworking sequencing operator already received attention in a more general context, and was named weak sequential composition (see [29]). Thirdly, we show in detail which (proof) obligations occur when introducing new operators. We both give an operational and an algebraic definition, and prove their correspondence. This chapter is subdivided as follows. First, we will introduce the Interworking language and the operators for combining Interworkings (Section 2). Next, we formally define the operators involved. We will not simply give one process algebra containing all operators, but we will formalize the operators in a modular way. This yields a collection of process algebras, for which we obtain some additional proof obligations, such as conservativity. The first process algebra (defined in Section 3) only contains the operator for sequential composition. This operator suffices to give a formal semantics of Interworking diagrams. In Section 4 we define the theory of the basic process algebra operators (+ and •) which we enrich with partial deadlocks. Next, in Section 5, these process algebras are combined. The following two sections deal with the introduction of the interworking merge operator. In Section 6 we first define a parameterized version of this operator, the £-interworking merge. The general interworking merge operator is defined in Section 7, which yields the final process algebra for Interworkings.
1274
S. Mauw, MA. Renters
Every operator is both defined algebraically and by means of an operational semantics. The relation between these descriptions is given in several soundness and completeness theorems. The treatment of Interworkings in the current chapter is mainly on a theoretic level. We will not introduce graphical and Hnear syntax of the language, and we will not present a mapping from Interworking diagrams to process algebra expressions (for a thorough treatment see [24]). Our main goal is to define the theory needed to formally understand Interworkings. Neither will we explain methodological aspects of the use of Interworkings or supporting tools. For a description of a prototype tool set based on these semantical definitions, we refer to [26].
2. Interworkings An Interworking specification consists of a collection of Interworking diagrams. The relation between these diagrams is defined by means of operators. An Interworking diagram specifies (part of) a single scenario and the operators can be used to compose simple scenarios into more complex scenarios. We consider operators for sequential composition, alternative composition and parallel composition of Interworkings. In this section we will only give an informal explanation of syntax and semantics of Interworkings. Simple examples show the relevant properties, which are formalized in the sections to come. We will not give a formal definition of the graphical syntax of Interworkings, since for our purposes an informal and intuitive mapping from Interworkings to the semantical domain suffices. There exists a textual representation of Interworkings too, but we will not discuss this. Consult [24] for more information on this topic.
2.1. Interworking diagrams An example of an Interworking diagram is shown in Figure 2. Such a diagram consists of a number of vertical lines and horizontal arrows, surrounded by a frame. The name of the Interworking diagram {Co-operation) is in the upper left comer of the frame. The vertical lines denote the entities of which (part of) the behaviour is being described. Above the lines are the names of these entities. Here we have four entities, called a, b, c, and d. The arrows denote the exchange of messages between the entities. Interworkings describe synchronous communication, which means that an arrow represents one single event. The order in which the communications take place is also expressed in the diagram. On every entity axis, time runs from top to bottom and the events connected to an entity axis are causally ordered in this way. However, there is no global time axis and the only way to synchronize the behaviour of the entities is by means of a message exchange. So, message k causally precedes message m. And because m precedes o, we have that k also precedes o. Messages k and / are not causally related; they may occur in any order. In our semantical treatment we assume an interleaved model of operation, which means that k and / cannot occur simultaneously.
A process algebra for
1275
Interworkings
Co-operation a b e d
k
/
—> m <— —> 0 n <— —>
Fig. 2. An example Interworking diagram.
Plaeement 2 a b e d
Plaeement 1 a b e d
/
k
—>
k —>
/ —>
—>
Fig. 3. Two semantically equivalent Interworkings.
Part 1 a b
Part 2 a b
c
m
k
—>
e
—>
o
n <— <—
Sequencing a b c
k
—> n <—
—> m <—
Fig. 4. Sequential composition of two Interworkings.
The fact that the time Hnes of all entities are independent, implies that the vertical placement of two messages which are not causally related has no semantical meaning. Therefore, the Interworkings from Figure 3 have identical semantics. A special case in our semantics is the empty Interworking. This is an Interworking which describes no behaviour at all and contains no entities. In the next sections the empty Interworking is denoted by e.
2.2. Sequencing Sequential composition is the easiest way to compose two Interworkings. Intuitively, sequential composition can be considered as the concatenation of two Interworkings, thereby connecting the corresponding entity axes. Figure 4 shows the sequential composition of two Interworkings. The circle denotes the sequencing operator.
1276
S. Mauw, MA. Renters
Nosync a b c
d
\H H Fig. 5. No synchronization through sequential composition.
Left a b k —>
o
Right b c I >
Result a b a k —> —>
Fig. 6. Sequential composition with different entity sets.
One must take into account that there is no (impHcit) synchronization between the entities at the point where the two Interworkings are concatenated. For this reason, the operator for sequential composition of Interworkings is called the weak sequential composition operator (or interworking sequencing). Although we will also introduce an operator for strong sequential composition of Interworkings in our semantical treatment, this operator is not part of the Interworkings language. Figure 5 shows that the weak sequential composition of two unrelated messages gives an Interworking where these two messages still are unordered. In the previous examples, the two composed Interworkings contained the same set of entities. This is not a requirement for sequential composition. The Interworking resulting from a sequential composition simply contains all entities from its constituents, as shown in Figure 6. Given the above interpretation of Interworking diagrams and sequential composition, the following observation is apparent. Every Interworking diagram is equivalent to the sequential composition of all its events. Look, e.g., at Interworking Co-operation (Figure 2) which is the sequential composition of five simple Interworking diagrams, each containing one arrow. The order in which these Interworkings are composed should of course correspond to the causal ordering of the original Interworking. So, if AT, L, M, N, and O are Interworking diagrams containing the messages k, I, m, n, and o, respectively, then LoKoMoNoO would be an example of such an expression. An alternative for this expression isKoLoMoOoN.
2.3. Alternatives In theoretical approaches to MSC-related languages different operators for alternative composition are used. These are the delayed choice operator (::p, see [3]) and the nondeterministic choice operator (-h, see [6]). In the standardized semantics of MSC [28] the
A process algebra for
altl a b c k —> I —>
Interworkings
nil
alt2 a b c k —> m ^— n
+
Fig. 7. Alternative composition of two Interworking diagrams.
Merge 1 a b c k —> / —>
1 1
Merge2 d e \rn n —^
—
Merge a b o d e k m —> <— I n —> —>
Fig. 8. Merge of Interworking diagrams without shared entities.
delayed choice operator is used. The essential difference between these two operators is that non-deterministic choice determines the moment of choice between the alternatives at the place where it occurs, whereas the delayed choice postpones the moment of choice to the place where the alternatives start to differ. The latter leads to a trace semantics (if non-deterministic choice is not present as well). As a consequence also all other operators in which a choice is manifest (such as parallel composition) must be changed to adopt the delayed interpretation of choices [28]. In our opinion the use of the delayed choice is only interesting if non-deterministic choice is present too. If the delayed choice is the only alternative composition operator of interest, then a better solution is to adopt a trace theoretical approach towards the semantics. In the process algebra approach of this handbook it seems more appropriate to study the non-deterministic choice operator. Hence, the operator which expresses the fact that two Interworkings describe alternative scenarios is denoted by -h. Figure 7 contains an example of the choice between two alternative Interworking diagrams. This expression describes the non-deterministic choice between the two given scenarios. Both scenarios start with message k, but the first continues with message / and the second with messages m and n. Notice that the class of Interworking diagrams is not closed under application of the -I—operator. The behaviour defined in Figure 7 cannot be expressed without application of the-h. 2.4. Merge Whereas the sequencing operator is used for vertical composition of Interworkings, the merge operator is used for horizontal composition. In the case that the two operands have no entities in common, the merge of two Interworking diagrams is simply their juxtaposition, as illustrated in Figure 8.
1278
S. Mauw, M.A. Renters
I Wall a b
c
d
k
e
P I m n
0
r
Fig. 9. Merge of Interworking diagrams with two shared entities.
In the case that the two operands do share some entities, the situation is a bit more compUcated. Suppose, for example, that the two Interworking diagrams have two entities in conmion, as in Figure 9. Then the messages exchanged between the shared entities must be identical for both operands. The resulting Interworking contains only one occurrence of every shared entity. Also the messages exchanged between the shared entities, which must occur in the same order in both operands, appear only once in the resulting Interworking. In Figure 9 the two operands share the entities c and d with shared messages m and n. In the case that the two operands do not describe identical behaviour with respect to the shared entities, as in Figure 10, a deadlock occurs. The resulting Interworking contains the parallel behaviour of the operands, up to the point where the behaviours on the shared entities start to diverge. At this point the deadlock occurs, denoted by two horizontal bars. Such a deadlock only covers entities which are blocked. This means that we do not have the global deadlock as used elsewhere, but a partial deadlock. We refer to this partial deadlock as deadlock. An entity shows no behaviour after it has entered a deadlock situation. All behaviour which is causally dependent on a communication which causes the deadlock, is also blocked. In Figure 10 this means that, since messages x and n do not match, a deadlock occurs on entities c and d. Moreover, since message r is causally dependent upon message n, the deadlock extends to entity e. In the following sections, such a deadlock will be denoted by 8E, where E is the set of deadlocked entities. If a deadlock occurs as a consequence of merging two Interworkings, we say that the two operands are mergeinconsistent. This explanation of the merge operator generalizes easily to the case where the operands have more than two entities in common. However, the case where they share only one entity yields a different situation. It is clear that this shared entity should occur only once in the resulting Interworking, but what happens with the events that this entity takes part in? This situation occurs in Figure 11. There is no reason to introduce a causal ordering between the messages / and m, and therefore the result cannot be a single Interworking diagram. The result of the merge in Figure 11 contains two alternative Interworking diagrams, which together describe all possible orderings of / and m. Care has to be taken to correctly handle entities which are included in an Interworking diagram but which do not take part in any communication, so-called empty entities. In the case that such an entity occurs in the set of shared entities, it cannot be discarded. Figure 12
A process algebra for
12 c
a b e d
d
1279
Interworkings
Inconsistent a b o d e k LP 1 <— —>
e
J> 1
—>
m
m
—>
Q
n r
—q>
0
<—
Fig. 10. Merge of two inconsistent Interworking diagrams.
Ml a
k —^
M2 b
c
/
1
c
1
—>
—>
d
e
m n —>
M4
M3 a b k
o
d
e
a
+
I m
b
o
d
e
m k —> I — > n —> —>
Fig. II. Consistent merge.
XI a
XS
X2 b
k —>
0
b
i:
d
a
b
k
>
m
—>
0
d
m —>
Fig. 12. Inconsistent Interworking diagrams with empty entity.
shows an example. Entity b occurs in both operands, but in the second operand there is no behaviour associated to b. Because in the first operand a message / is sent to b, a deadlock occurs. The situation would be quite different if we would omit entity b from the second operand. Then the two operands would be merge-consistent. This is shown in Figure 13.
1280
S. Mauw, MA. Renters X5 X2' c d
+
a
b
e
d
k
m —>
I —>
—>
Fig. 13. Empty entity removed.
3. Semantics of Interworkings In this section we will present a simple process algebra that can be used for reasoning about the equality of Interworking diagrams. Based on the textual syntax of Interworking diagrams a process term is generated as follows. With every message in the Interworking diagram an atomic action is associated. A deadlock that covers the entities from a set E is denoted by 8E. The atomic actions are combined by means of interworking sequencing. The process algebra is called IWD(o). We assume the existence of sets EID and MID of names of entities and messages, respectively. Actually, these can be considered as parameters of the process algebra. A message is characterized by the name of the sender, the name of the receiver, and the message name. These messages form the set of atomic actions. DEFINITION
1 (Atomic actions). The set A of atomic actions is given by
A = {c(iJ,m)\iJ
eEID, m eMID}.
DEFINITION 2 (Signature oflWD(o)). The signature FIWD of the process algebra IWD(o) consists of the atomic actions a e A, the deadlock constants SE (E ^ EID), the empty process s, and the binary operation interworking sequencing 01^. The set of all (open) terms over the signature I^IWD is denoted as O(ZIWD)- The set of all closed terms over the signature EJWD is denoted as C(EIWD)' We will use similar notations for other signatures. We provide the process algebra with an operational semantics by associating a term deduction system to it. We will first summarize the terminology related to term deduction systems. For a formal definition of term deduction systems and related notions we refer to [5]. A term deduction system is a structure (Z, D) where 17 is a signature and D a set of deduction rules. The set of deduction rules is parameterized by a set of relation symbols and a set of predicate symbols. If P is such a predicate symbol, R such a relation symbol, and s,t e 0(E), then the expressions Ps and sRt are called formulas. A deduction rule is of the form ^ where // is a set of formulas, called hypotheses, and C is a formula, called the conclusion. In the term deduction systems used in this chapter we use relations _ —^ _ c 0(E) x A X 0(U) and the predicate _ | c 0(U). The formula x - ^ x' expresses that the pro-
A process algebra for Interworkings
1281
cess X can perform an action a and thereby evolves into the process x'. The formula x | expresses that process x has an option to terminate immediately and successfully. In the remainder of this chapter we use the following shorthands: x —^ represents the predicate that jc —^ x' for some x\x - ^ x' represents the proposition that x - ^ x' is not derivable from the deduction system, x -^ represents -^{x - ^ ) , and x -r^ represents X -^ for all a G A. Similarly we use JC ^ to represent -^(JC J,). A proof of a formula 0 is a well-founded upwardly branching tree of which the nodes are labeled by formulas such that the root is labeled by the formula 0 and if x is the label of a node and {x/ I / € /} is the set of labels belonging to the nodes directly above it, then {Xi
\iel}
is an instantiation of a deduction rule. The term deduction system for the process algebra IWD{o) consists of the signature UiWD and the deduction rules given in Table 1. Before we can give the operational description of the interworking sequencing operator we first define the active entities associated with a process term representing an Interworking diagram. The active entities of an Interworking diagram are those entities which are involved in a communication or in a deadlock. DEFINITION 3 (Active entities). For /, j e EID, m e MID, E c E/D, and JC, y G CiLiwo) we define the mapping AE : C{I!IWD) -^ fiEID) inductively as follows: AE{c(iJ,m)) = {/,7}, AE(£) = 0, AE{8E)
=
E,
AE(x oivv y) = AE(x) UAEiy). The operational semantics of the process algebra IWD{o) is given by the deduction rules in Table 1 and the equations defining the active entities in Definition 3. These equations can easily be written as deduction rules. The empty process does not execute any actions, but it terminates successfully and immediately. The fact that it does not execute any action is visible by the impossibility of deriving that it can execute an action. The process a can execute the action a and in doing so evolves into the empty process e. The process 8E cannot execute any actions nor can it terminate successfully. The interworking sequencing of two processes terminates if and only if both processes can terminate. The process JC oiw y executes an action a if JC can execute action a or if y can execute a and this action is not related to an active entity of JC (AE(a) nAE{x) — 0). This expresses the intuition that the first operand may always perform its actions, while the second operand may only perform actions which are not blocked because they are causally dependent on actions from the first operand. The Interworking from Figure 14 can semantically be represented by the process term cip,q,m)
Oiw {c{r, s, o) o,^. c{q, r, n)).
1282
S. Mauw, MA.
Renters
Table 1 Deduction rules for interworking sequencing (a e A)
XI
_v I
eI A£(a)nA£(jc) = 0
y
xo;^y-
Fig. 14. Example of an Interworking diagram.
Then the following is a derivation of the fact that first the communication of message o can take place: .
AE(cir, s, o)) n AE(c(p, ^, m)) = 0 c(p,q,m)
.
c{f\s.o)
c{r, s, o) /
\
/
\ cir.s.o)
>8 .
X
c{r, s, o) ojw c(q,r, n) ^ s o\^c{q,r,n) oiw (c{r, s, o) oj^ c{q,r, n)) '^''''''\ c{p,q,m) oiw (e ojw c{q,r, n))
Two processes x and y are considered equivalent if they can mimic each others behaviour in terms of the predicates and relations that are used in the term deduction system. In this case these are the execution of actions, the termination of a process, and the active entities of a process. As a consequence of introducing partial deadlock constants, we must be able to distinguish deadlocks over different sets of entities. This is the reason that we require that two processes are equivalent only if they have the same active entities. This type of equivalence is usually called strong bisimilarity, but we call it IWD-bisimilarity. D E F I N I T I O N 4 (IWD-bisimilarity). Let r be a signature. A symmetric relation R c C ( r ) X C ( r ) is called an IWD-bisimulation iff for all /?, q such that pRq we have
(1)
AE(p)=AE(q);
(2) if p I , t h e n ^ l\ (3) if p - ^ p' for some a e A and p\ then there exists a q' such that q - ^ q' and p'Rq'. Two processes jc and y are called IWD-bisimilar, notation x ±t\wd y^ ^^ ihert exists an IWD-bisimulation R such that xRy. The notation R : JC ±>iwd y expresses that R is an IWD-bisimulation that relates x and v.
A process algebra for Interworkings THEOREM
1283
1 (Equivalence). IWD-bisimilarity is an equivalence relation.
We must prove that IWD-bisimilarity is reflexive, symmetric, and transitive. (1) :l±:iwd is reflexive. Let R = {{p, p) | p e CiZiwD))- Clearly, R is an IWDbisimulation. (2) l>iwd is symmetric. Suppose that p <±\wd ^- This means that there exists an IWDbisimulation R such that pRq. Since any IWD-bisimulation is symmetrical we also have qRp. Hence q ±>iwd P(3) i±iwd is transitive. Suppose p <±i^^ q and q i^jwd ''• Thus there exist IWDbisimulations R\ and /?2 such that pR\q and qR2r. Let R = (R\ o /?2)^- For a relation p on X, the notation p^ denotes the symmetric closure of p. It is not hard to show that R is an IWD-bisimulation and pRr. Hence p ±>iwd '*• '-'
PROOF.
THEOREM
2 (Congruence). IWD-bisimilarity is a congruence for interworking sequenc-
ing. PROOF. The term deduction system for IWD{o) is in path format. From [4], we then have that IWD-bisimilarity is a congruence for interworking sequencing. The path format is a syntactical restriction on the form of the deduction rules and can be easily checked. D
In Table 2 we present the axioms of the process algebra IWD{o). The first three axioms express straightforward properties. The axioms o\^\ and oiw3 describe the propagation of partial deadlocks through the Interworking diagram. The first of these is illustrated in Figure 15 for £• = {/?, ^} and a = c{q,r,m). For deriving equalities between process terms we can use all instantiations of the axioms and the usual laws of equational logic. These are reflexivity, symmetry, transitivity, and Leibniz's rule. As a simple example, we present the derivation that the empty process is a right unit for interworking sequencing. The fact that it is a left unit is put forward as an axiom. LEMMA 1 (Properties). For x e 0(Z/WD)
VT^ hcive x ojw ^ = x.
= 0, we have AE(x) O AE{£) = 0. Then, using the axioms Comm. oiw and Idem, oi^, we have JC oiw £ = ^ ojw Jc = JC. D PROOF. AS AE(S)
Thus far we have presented an operational semantics and a process algebra on the signature UiwD' Ideally, there is a strong connection between these. In this case we will first show that every pair of derivably equal closed /WD(o)-terms is IWD-bisimilar. This relation between an equational theory and its model is usually referred to as soundness of the equational theory with respect to the operational semantics. It can also be stated from the point of view of the operational semantics: the set of closed /WD(o)-terms modulo IWDbisimilarity is a model of the equational theory. Later we will also present a relation in the other direction: every pair of IWD-bisimilar closed /WD(o)-terms is also derivably equal. This result is referred to as completeness.
1284
S. Mauw, M.A. Renters Table 2 Axioms of/WD(o) {aeA,E,Fe
EID)
Idem, o j ^
£ Oj^.
C o m m . Oj^
X ojw V = V oj^.
Ass. oj^
(JC Oi^ v) Oj^. z=X
Ojwl oiw3
<5£Oiw«=<5£u/l£(«)
X=X
^ £ Ojw ^F
if AE(x)nAEiy)
A:
=0
Oi^. ( y Oivv- Z)
if^£'(«)n£^0
=^EUF
o Fig. 15. Propagation of partial deadlocks.
3 (Soundness). /WD(o) is a sound axiomatization of IWD-bisimilarity on closed IWD(o)-terms. THEOREM
PROOF. Due to the congruence of IWD-bisimilarity with respect to all operators from the signature of /M)(o), it suffices to prove soundness of all closed instantiations of the axioms in isolation. We give an IWD-bisimulation for each of the axioms. These are the following • for axiom Idem. 01^: R = {(e o^^ p, p) \ p e C(EIWD)}^'. • for axiom Comm. oiw: R = [{p o\^ q, q o\^ p) \ p,q e C{EIWD)^ ^E(p) nAE(q) = 0}"^; • for axiom Ass. oj^: R = {{p o-^^ (q ojw r), (p ojw q) oi^r)\ p,q,r e CiUiwo)]^'^ • for axiom ojwl: R = {(SE O\W a, 8E\jAE{a)) I AE(a) (1 E ^id] ; • For axiom oi^3: R = {(SE OJW 5/r, SEUF) \E,E
The proof of completeness consists of a number of steps. First we define the notion of basic term and prove that every closed term is derivably equal to some basic term. The introduction of basic terms makes it easier to perform inductive reasoning on the structure of a closed term. 5 (Basic terms). The set of basic terms is the smallest set such that (1) £ is a basic term; (2) for E c EID, 5£ is a basic term; (3) for a e A and x a basic term, a o\^^ x is a basic term. The set of all basic terms over the signature I^IWD is denoted B{ZIWD)DEFINITION
THEOREM
equal.
4 (Elimination). For every closed term there is a basic term which is derivably
A process algebra for Intem'orkings
1285
By induction on the structure of closed term x. X = e. This is a basic term. X = 8E for some E c EID. This is a basic term. X =a for some a e A. Then, using Lemma l,a=a o^^ e which is a basic term. X =x\ oiw X2 for some xi, JC2 G CCiJ/wD). By induction we have the existence of basic terms b\ and b2 such that x\ =b\ and xi^bi. By induction on the structure of basic term Z?!. (a) b\ = 6. Then x = jc oiw j = Z?i oj^ b2=e o\^ bi = bi which is a basic term. (b) b\= 8E for some £ c EID. By induction on the structure of basic term b2(i) b2 = e. Then x =x\ oiw JC2 == <5£ oiw s = 8E. which is a basic term. (ii) b2 = 8pr for some F c EID. Then JC = jci ojw X2 = ^i oj^ Z?2 = 8E O\W 8E = 8EUF^ which is a basic term. (iii) Z?2 — ^2 ojw b'-j for some «2 ^ ^ ^nd /^^ € B(i7/vvD)- By induction we have the existence of a basic term c such that 8E OJW ^2 — ^- ^^^^ ^y induction we have the existence of a basic term c' such that 8EuAEia2) ^iw ^2 ~ ^ • lfAE(a2) n E ^0, then x = jci oiw X2 = b\ oiw ^2 = 8E OJW (^2 oiw bj) = (5£ Oiw «2) Oiw ^2 "= ^£:uAf (^/^) Oiw b'^ = c', which is a basic term. If A^Ca) fl
PROOF.
(1) (2) (3) (4)
E = 0, thenx = X\ 01^X2 = b\ o\^b2 = 5£Oiw(^2 0iw^7) =
(8E^m^2)^'\w
bj = (a2 Oiw 8E) Oiw ^2 =" ^2 Oiw (^£ Oiw ^i) = ^2 oiw (^^ which is a basic term. (c) b\ = a\ Oiw ^j for some a\ e A and /?', € BiZ/wo)- By induction we have the existence of a basic term c such that ^', oiw ^2 = c. Then x = xi oiw X2 = b\ Oiw /?2 = («i Oiw ^^i) Oiw bi = ^1 Oiw (^1 Oiw ^2) = ^1 Oiw c, which is a basic term. D The next step towards the proof of completeness is the following lemma. It provides a link between axiomatic reasoning and reasoning in the (operational) model. The proof of this lemma requires the notion of norm of a closed term. It counts the number of actions and sequencing operators occurring in the term. 6 (Norm). For E c EID, a e A, and x, y e CiEiwo) we define the mapping |_| : CiEjwo) -^ N inductively as follows:
DEHNITION
\e\ = 0, \8E\
= 0,
\a\ = 1, Ixoiwjl = |x| + |y| + l. 2. For all x,x' e C{EJWD) ^^d a e A we have ifx-^ x', then\x'\ < |x|; ifx ]r, then x = e; ifx - ^ x\ then x = a oiw x'; ifx J/, X - ^ , then x = 8AE{X)'
LEMMA
(1) (2) (3) (4)
1286
S. Mauw, MA. Renters
PROOF.
(1) By induction on the structure of closed term x. Suppose x - ^ x\ (a) X =£. This case cannot occur. (b) X = 8E for some E c EID. This case cannot occur. (c) X =b for some b e A. Then necessarily b = a and x' = e. Observe that |jc'| = | £ | = 0 < 1 = |Z7| = |JC|.
(d) X = x\ oiw X2 for some JCi, JC2 6 X\ OiwX2 - ^
C(ZIWD)'
We can distinguish two cases for
x\
(i) x\ - ^ jcj for some x[ e C(LIWD) such that x' =x[ oiw X2. By induction we have that |JCJ | < |JCI |. Thus we obtain l-^'l = 1-^1 Oiw^2| = | x J | + |X2| + l < |Xi| + |-V2| + 1 = \X\ OiwX2| = | x | .
(ii) AE(a) nAE(x\) = 0 and X2 - ^ x^ for some X2 € C{ZIWD) such that x' = x\ Oiw JC2. By induction we have that \x'^\ <\x2\. Thus we obtain |^'| = 1-^1 Oiw-^2! = kll +1-^21 + 1 < kll + k2| + l = kl OiwX2| = k | . (2) By induction on the structure of closed term x. Suppose x | . (a) X = 6. Trivial. (b) X = 8E for some E c EID. This case cannot occur. (c) X =a for some a e A. This case cannot occur. (d) X =x\ Oiw X2 for some x\,X2€ C(EJWD)- AS JC ^|., we have x\ i and X2 4. By induction we then have x\ =£ and ^2 = £. Then x = xi ©iw X2 = ^ oiw ^ = ^. (3) By induction on the structure of closed term JC. Suppose x - ^ x'. (a) X = e. This case cannot occur. (b) X = 8E for some E c EID. This case cannot occur. (c) X = b for some b e A. Then necessarily Z? = « and x' = e. Then, X = /? = « = fl Oiw £ = « Oiw Jc^
(d) JC = jci Oiw X2 for some jci, JC2 € C(Z/WD)- For jci oiw X2 - ^ Jc' two cases can be distinguished: (i) jci -A- x[ for some jcj G C(IJIWD) such that x' = x[ oiw X2. By induction we then have jci = ^ oiw JCJ . Then, X = x i oiwX2 = {a oiwxj) oiwX2 = a Oiw {x\ Oiw JC2) =a o\^ x'. (ii) X2 - ^ X2 and A^C^) O A^Ui) = 0 for some JC^ G C(r/wD) such that x' = xi Oiw ^2- ^y induction we have X2 = a o\^ Xy Then, X = XI Oiw X2 = X\ Oiw {a Oiw Xj) = (X\ Oiw <^) Oiw X2 = (a 0\y^ X\) Oiw X2=a
Oiw (xi Oiw -^2) ~ ^ °iw X^
A process algebra for Interworkings
1287
(4) By induction on \x \ and case analysis on the structure of x. Suppose x ^ and x -^^. (a) X ^e. This case cannot occur. (b) X = 8E for some E c EID. Trivial as AE(x) = AE(8E) = £" and X = 5^ = (c) X =b for some b e A. This case cannot occur as b -A- contradicts the assumption that jc ^ ^ . (d) x^xi Oiw -^2 for some xj, JV2 G C(I^JWD)- If xi >[, then we find x\ — s. As x J^, we also find JC2 / . As jci ojw JC2 ^ ^ , we find xi ^ ^ , and X2 - ^ vAEC^) Pi AEixi) ^ 0 for all a e A. As xi = e, we find Af'C^) H A£(xi) = A£(^) H AE(s) = £. Therefore, we must have X2 - ^ . By induction (note that |x2| < |x|) we thus have X2 = 5AE(AO)- Then X =X\
Ojv/ X2 = ^ Ojw SAE{.\2)
— ^AE(.\2) — ^AE{.\] )UAE{X2) =
^AE(.x)'
If xi ^, then we have by induction xi = SAE(XO ^^ ^^ ^^^^ ^^^^ -^i ~ ^ - ^^^^^' suppose that X2 | . Then X2 = £ and we obtain x = xi oiw X2 = 8AE{.\I) oiw ^ = ^AEixO = ^AEixO^AEix.) = ^AE(x)' Sccoud, supposc X2 ^- Again we can distinguish two cases: (i) X2 - ^ for all a G A. As |X2| < |x|, we can apply the induction hypothesis and obtain X2 = SAE{X2)' Thus, X =X\
Ojw X2 = SAE{XI ) Oiw ^AE{X2) = ^AE(x\ )UAEix2) =
^AEix)-
(ii) X2 —^ x^ for some a e A. Then we have X2 = ^ ojw X2. As xi oiw X2 - ^ ^ , we must have AEC^) C)AE{x\) ^ 0. Then, X = Xi Oiw X2 = ^AEixO =
Oiw ( « Ojv,' X2) = i^AEixO
Ojw o) Ojw X2
<5/\£(.v, )UAE{a) Oiw ^ 2 -
Note that IX2I < |x2|. Observe that l^AEixO^AEia)
o\^ X2\ = =
| x 2 | + 1 < |X2| + 1 < | x i 1 + |X2| + 1 k l OiwX2|.
Hence we can apply the induction hypothesis to obtain ^/^£(.vi)U/\£"(c;) Oiw-^2 = =
^A£(.vi )UA£(i/)U/^£(.v;) =
^AEixO^AEix2)
^AEix)'
5 (Completeness). IWD{o) is a complete axiomatization of IWD-bisimilarity on closed IWD{o)-terms. THEOREM
PROOF. Suppose that x itiwd y- Then we must prove that x = }. By the elimination theorem we have the existence of a basic term x' such that x = x'. As the axioms are sound.
1288
5. Mauw, MA. Renters
we also have x <±\^^ x'. Hence it suffices to prove jc' = >. We do this by induction on the structure of basic term x'. (1) x' = e. Then x' \^. Since x' ±>ivvd y^ ^^ ^^^^ ^^^^ >' ^' ^y Lemma 2.2 we then have y — e. Hence x' = s = y. (2) x' = 8E for some E c EID. Then x' ^ and x' - ^ for allflfe A. As x' i t j ^ ^ j , also y ^ and y ^ ^ . We also have AE(y) = AEix') = AE(8E) = E. By Lemma 2.2 we have y = SE- SO X^ = 8E = y. (3) x' = « ojw x'^ for some (2 € A and x" e B{EIWD)- Then x' - ^ ^ ojw x'^ Since ^' l±iwd y we also have y - % y' for some y' such that ^OJWJC'' i^iwd y'-Then, using transitivity of IWD-bisimilarity and the soundness of Idem, oi^, also x" ±>ivvd JBy induction we then have x" = y\ By Lemma 2.2 we have y = a ojw y^ Then x' = a ojw x" = a oiw y' = y. D 4. Sequential and alternative composition In the previous section we have defined a sound and complete axiomatization of Interworking diagrams. For this purpose we needed to introduce the interworking sequencing operator only. If we want to extend this theory with other operators, we first have to introduce the Basic Process Algebra operators + and •. This section is devoted to the development of the process algebra BPA{8E) without interworking sequencing. In the next section, the interworking sequencing is added to this algebra. The + is called alternative composition and • is called sequential composition. The process x -\- y can execute either process JC or process y, but not both. The process x • y starts executing process x, and upon termination thereof starts the execution of process y. Operationally these operators are described by the deduction rules given in Table 3. In this table we assume that a e A and E c EID. The theory presented in this section is very similar to standard Basic Process Algebra with deadlock and empty process BPAse (see, e.g., [5]). 7 (Active entities). For /, j e EID, m e MID, E c EID, x,y e C(I:BPA{8E))^ and O G {+, •}, we define the mapping AE : CiLBPAiSf)) -> ^(EID) inductively as follows: DEHNITION
AE{c(iJ,m)) = {ij}, AE(e) = 0, AE(8E)
=
E,
AE(x O y) = AE(x) U A^Cy). The alternative composition of two terms can terminate if either one of these terms can terminate. It can perform every action that its operands can perform, but by doing so a choice is made. A sequential composition can terminate if both operands can terminate. It can perform all actions from its first operand and if the first operand can terminate, it can perform the actions from the second operand. Again, we first need to prove that IWD-bisimilarity is a congruence for all operators in the process algebra.
A process algebra for Interworkings
1289
Table 3 Deduction rules for alternative and sequential composition {a e A) XI X+ y i
y \, X+ V i
Xi
y i
X •y i X l
X -\-y — > x'
V -
X -^ y -
Table 4 Axioms of alternative and sequential composition {E c EID)
Al A2 A3 A4 A5 A6 A7 A8 A9
^ + V = V + A{x + y) + z = x + {y + z) X -\- X = X
U + v) • z = A • z + V • c {xy)z = x {y- z) X -\- 8^
= X
if E
8E •A = <5£U^£(.V) £ • X
=X
X • £
=X
THEOREM 6 (Congruence). IWD-bisimilarity is a congruence for alternative composition and sequential composition. PROOF. The term deduction system for BPA(8E) is in path format. From [4], we then have that IWD-bisimilarity is a congruence for all operators. D
These operators are axiomatized by the axioms from Table 4. In these axioms the variables X, y and z denote arbitrary process terms. In order to reduce the number of parentheses in processes we have the following priorities on operators: unary operators bind stronger that binary operators; • binds stronger than all other binary operators and -h binds weaker than all other binary operators. Axioms A1-A5 express straightforward properties, such as commutativity, associativity, and idempotency of alternative composition, distributivity of alternative composition over sequential composition, and associativity of sequential composition. Axioms A6 and A7 characterize the deadlock constant. A6 states that if an entity has the choice between performing an action and deadlocking, it will never deadlock. Axiom A7 expresses that after a deadlock no more actions can occur. The scope of the deadlock is thereby extended to include all entities on which blocked actions occur. Axioms AS and A9 express the standard behaviour of the empty process. The proof of soundness is straightforward. 7 (Soundness). BPA(8E)-terms.
THEOREM
closed
BPA(8E)
is a sound axiomatization of IWD-bisimilarity on
1290
S. Mauw, MA. Renters
PROOF. In this and other soundness proofs we use / to denote the diagonal relation. If "^ = t if /?" represents either one of A1-A4, A6-A8, then the relation R = {{sj), (t,s) I ^} U / is an IWD-bisimulation for that axiom. For the axioms A5 and A9 the IWD-bisimulations are given by /? = {((p - y) - z. p - (y - z)) \ p e C(I:BPA(8E)))^ ^ ^ ^^^ R = [(P'£,p)\pe C(EBPAi8E))}^^ respectively. D
The proof of completeness consists of a number of steps. First we define basic terms and prove the elimination property. Next, we formulate a lemma which relates semantical properties to equational properties, and, finally, we prove completeness. 8 (Basic terms). The set of basic terms is the smallest set that satisfies: (1) ^ is a basic term; (2) for E c EID, SE is a basic term; (3) for a e A and x a basic term, a - x is a. basic term; (4) if X and y are basic terms, then jc -i- j is a basic term. The set of all basic terms of the process algebra BPA(8E) is denoted by B(UBPA(8E))DEFINITION
The following lemma expresses that we can always combine multiple deadlock alternatives into one deadlock alternative. LEMMA
3. For E, F c. FID we have 8E -\- ^F =
PROOF.
Consider the following derivation: 5£ + 5/r
=
^EUF-
(8E + 8F) + 8EUF = ^EUF + (^E + ^F) = (^EUF
= ^EUF + ^F =^EUF'
+ ^E) +
^F
^
As alternative composition is idempotent, commutative and associative, and 8^ is a zero element for it, we can define a generalized alternative composition operator. For finite index set /, the notation X!/6/ ^i represents the alternative composition of the process terms Xj. If / = 0, then J2iei ^i = ^^- If / = {n, .., //;} for « ^ 1, then ^Xi
= X / , -\-Xi, -\
hX/„.
iel
Then we can easily establish that every basic term is of the form iel
jeJ
keK
for some finite index sets I, J, K, at e A, Ej Q FID and basic terms x/ of a similar form. For convenience in proofs to follow we combine the deadlock alternatives into one alternative by using Lemma 3: y ^ ^ / ' Xi + (Sf 4- y^^ e, iel
keK
A process algebra for Interworkings
1291
where E = UyeJ ^J- ^^^ summand Ylkex ^ ^^ ^^^y ^^^^ ^^ indicate presence (K ^ 0) or absence (A' = 0) of a termination option. THEOREM
8 (Elimination). For every closed term there is a derivably equal basic term.
We prove this theorem by induction on the structure of closed term x. x = e. Trivial as £ is a basic term. x = ^E for some E c EID. Trivial as 8E is a basic term. X =a for some a e A. Then x =a =a - e, which is a basic term. X = x\ • X2 for some x\,X2 € C{EBPA(SE))- ^Y induction we have the existence of basic terms b\ and b2 such that x\ =b\ and xi—bi- By induction on the structure of basic term b\ we will prove that there exists a basic term c such that b\ -bi^ c. (a) b\ = 6. Then b\ b2 = e - bj— ^2(b) b\ = 8E for some E c EID. Then b\ • Z72 = ^£ • ^2 = SEuAE{h2)' (c) b\=a- b\ for some a e A and b\ e B(LBPA{SE:))- By induction we have the existence of basic term c' such that b\ - ^2 = c\. Then b\ - b2 = (a - b\) • b2 = a • {b\ ' b2) =a ' c\. (d) b\ = b\ + b'[ for some h\,b'[ G B{ZBPA(8FJ)' By induction we have the existence of basic terms c' and c" such that b\ • Z?2 = c' and b'^ - b2 = C2. Then Z7, . Z?2 = {b\ + Z?;0 • ^2 = b\ • Z72 + b'( 'b2 = c-^ c". Observe that in each case we have the existence of basic term c such that b\ 'b2'=c. Hence x =X[ •X2 = b\ 'b2 = c, which is a basic term. (5) X =x\ + JC2 for some x\,X2 ^ C(EBPA(8F))' By induction we have the existence of basic terms b\ and b2 such that x\ = b\ and X2 = ^2- Then x = x\ -\r X2 = b\ -\~ b2, which is a basic term. D
PROOF.
(1) (2) (3) (4)
4. Forallx.x' eCi^BPAiSE)) and a e A we have (1) i/x 4., ?/?^n jc = £ - h x ; (2) ifx —^ jc', r/ze/i jc = (^ • jc' + X.
LEMMA
PROOF.
(1) We will prove this by induction on the structure of x. Suppose x I. (a) X = e. Then trivially x = e = e-\-s = e-^x. (b) X =8E for some E c EID. Then we have a contradiction as 5^ J^. (c) X =a for some « G A. Then we also have a contradiction as a / . (d) jt = jci -\- X2 for some xi, X2 G Cil^BPAiSfr))- Then we have xi | or X2 | . By induction we then have x\ = e -^ x\ or X2 = ^ -(- JC2. In both cases we find X =X\ -\- X2=£ -\-X\ -\-X2 = £ -\-X. (e) X = x\ ' X2 for some x\,X2 G CiEBPA(Si^))- Then we have xi i and X2 | . By induction we then have x\ =£ -\-x\ and X2 = ^ + ^2. Therefore, x =x\ X2 = (e -\-X\) ' X2=£ • X2+X\ ' X2=^X2-\~X\ • X2 = S + X2 + X\ - X2 = £ -\r £ ' X2-^ X\ • X2 = £ -\- (£ -\-X\) ' X2 = £ -\-X\ • X2 = £ ~\-X. (2) We will prove this by induction on the structure of jc. Suppose x - % x\ (a) X =£. Then we have a contradiction as £ - ^ . (b) X=8E for some E c EID. Then we also have a contradiction as 8E -^ •
1292
S. Mauw, MA. Renters
(c) X = b for some b € A. Then necessarily b ^ a and x' = e. Hence x = b = b-\-b — a-\-b = a'e-\-b = ax'-\-x. (d) X = x i + X 2 for some xi,X2 eCCiTf^PAt^f)). Then we have xi - ^ x ' o r x 2 - ^ x'. By induction we then have x\ =a - x' -\- x\ or xi = a • x -]- xi- Then x = x\ -\- X2~a ' x' + x\ -\- X2=a ' x' -\- X. (e) lfx = x\ ' X2 for some xi, X2 € C(i7fiPA(5£))- We can distinguish two cases. First, XI - % x\ for some x\ e C(I:BPA{8E)) such that x' = xj • X2. By induction we then have xi =z a • x\ -f xi. Therefore, x = xi • X2 = (« • xj + xi) • X2 = (a -XJ) •X2 + X i • JC2 = a • (xj •X2) + X = a - x ' + X .
Second, xi ^ and X2 - ^ x'. By induction we have X2 = « • x' + X2. From the first part of this lemma we have xi —8-{-x\. Therefore, x =:xi ^2 = (^ + ^1) • X2 = 6:-X2H-Xi •X2 = X 2 + X i •X2 = fl-x' + X 2 + X i •X2 = « ' X ' + ^ •X2+Xi •X2 = fl - x ' + (^ + X i ) •X2 = ^ - x ' + Xi •X2 = « - x ' + X. Q THEOREM 9 (Completeness). BPA(8E) on closed BPA(8E)-terms.
is a complete axiomatization of IWD-bisimilarity
Suppose that x <±^^^^ y. By the elimination theorem and the soundness of the axioms we can assume, without loss of generality, that x is a basic term. By congruence and the soundness of axiom A3 it suffices to prove that if x -h j j^i^jwd y thenx-f y = y. This can be seen as follows. From x <±]^^ y we obtain x 4- y <±iwd y + y using congruence of ±>iwd ^it^ respect to +, and reflexivity of <±•^y^,^^ . Using the soundness of axiom A3 we have y-\-y <±\^^ y. By transitivity of i±iwd we obtain x + y ±t\w(\ y- Then x + y = y. Similarly we can obtain y -h jc = x. Therefore, x = y -\-x =x -\-y = y. We prove this by induction on the structure of basic term x. (1) X = e. Then x | . So x + y ^. Therefore, y | . Then, by Lemma 4.1, we have y = £ + y. So we find x + y = £ + y = y. (2) X = 8E. Then AE(x + y) =AE(SE -i-y) = E UAEiy). As x -h y ±t\v^^ J. we must also have AE(y) = AE(x -f y) = £ U AE{y). Thus we obtain E c AE(y). Then x-^y = 8E + y = y + 8E=y. (3) x=a- x'. Then x - ^ £ • x'. So x + y - ^ £ • x'. Therefore, y - ^ y' for some y' such that e • x' ±>:^^^ y'. By the soundness of axiom A8 we find x' ±>iwd >'• By induction we then have x' = y'. By Lemma 4.4 we have y = a • y' -\- y. Then x-\-y — a'x'-{-y = a'y'-\-y = y. (4) X = XI -f X2. Using xi + X2 + y <±,^^ y implies xi -h y i>iwd >' ^^^ -^2 + y ±tiwd >'• By induction we then have jc 1 + y = y and jc2 + y = y • Then x + y = (x 1 + X2) + y = PROOF.
•^1 + (X2 -h y ) = xi -f y = y .
O
5. The interworking sequencing In Section 3 we have introduced the interworking sequencing and in Section 4 we have defined alternative and sequential composition operators. When combining these operators into one single theory, we need to express the relation between the interworking sequencing
A process algebra for Interworkings
1293
Table 5 Deduction rules for auxiliary operators for interworking sequencing {a e A) X i y \, X LDJ^ y i x-^
x'
X \, y I X RDiw.v i AE{a) n AE{x) = 0
X Loiw)' —^ x' ojw V
y - % y'
X Roiw, V -
on the one hand and alternative and sequential composition on the other hand. By introducing the auxiliary operators Loj^ and Rojw, we can express the interworking sequencing in terms of the alternative and sequential composition operators. The process algebra obtained in this way is called IWD{o, •, +). It is a conservative extension of both the process algebra IWD{o) from Section 3 and the process algebra BPA{8E) from Section 4. Furthermore, all axioms formulated for interworking sequencing in the theory IWD{o) can now be derived for closed terms. The intuition of the auxiliary operators is as follows. The process x Lojw y behaves like the process x oi^ y with the restriction that the first action to be executed must originate from process x. The process x Roiwj also behaves like the process x o-^^ y but this time with the restriction that the first action to be executed must be from process y. In this case, the first action from y can only be executed if it is not blocked by any of the actions from x. These definitions resemble the use of the left-merge operator in PA to define the merge operator. That we need two auxiliary operators instead of one is caused by the fact that interworking sequencing is not commutative. DEFINITION 9 {Activeentities). For /, j e EID, m e MID, E c BID, x,y e C(i:/wD(o.,+)), andO € {oiw, Loiw, Roiw, -h, •}, we define the mapping A£':C(ir/wD(o,.+)) -^ F(EID) inductively as follows: AE{c{iJ,m)) = {ij}, AE(e) = 0, AE(8E)
=
E,
AE(x Gy) = AE{x) UAEiy). The operational semantics of the interworking sequencing is given already in Table 1. The operational semantics of the auxiliary operators is given in Table 5. The rules follow from the intuitive explanation above. The termination behaviour of the interworking sequencing is incorporated in both auxiliary operators. This is not necessary but facilitates the axiomatization of these operators and the proof of the auxiliary proposition in the proof of Proposition 1. THEOREM
10 (Congruence). IWD-bisimilarity is a congruence for Lo\yj^ and Ro\y^.
1294
S. Mauw, MA.
Renters
Table 6 Axioms for interworking sequencing and auxiliary operators (« € A, £ c EID) S
^ ojv^ V = jc LoivvVH-x RDJW V
LI L2 L3 L4 L5
£ LDJW^
L6 L7 Rl-4 R5 R6a R6b R7
=£
^ l ^ i w ^ £ =^E sl^\v,ax=8AE(a:x) £ LDJWU + y) = £ Loiw^ + ^ LDiw> ^ £ Loiw^ =^EUAE{x) a x lp^^,y = a • (x Ojvv y) (x + _v) lo\y^z = X LDJW:: + y LDJW:
JV RDJW^ = £
^\v.x
X RDJW^E = ^ £ U A £ ( . V )
X Roiwa V = a • U ojw y) X RDiw« • y = ^/^E(.v)U/^£(rtv) X RoiwCy + z) = jv Roiwy + X RDJW
ifA£'(a)nA£(jc) = 0 ifA£(«)nA£(;c)7^0
PROOF. The term deduction system is in path format and hence IWD-bisimilarity is a congruence for all operators. D
The axioms defining the interworking sequencing in terms of alternative and sequential composition are given in Table 6. The first axiom, S, states that the first action from X oiw y can either come from x (via the term x Lo\wy) or from y (via the term x Roiw>'). Axioms L1-L7 define the operator Loiw using the structure of basic terms. As stated before, jc Loiwy behaves Uke the process x ojv^ y with the restriction that the first action to be executed comes from jc. This is expressed clearly in axiom L6. The relation between Lojw and ojw also explains the distributive law L7 and the absorption law L5. Axioms L1-L4 define the termination behaviour of Loi^: JC Loiv^y can only terminate if both operands can terminate. A deadlock occurs if the left operand is s and the right operand cannot terminate (axioms L2, L3). The definition of Roi^ is similar. The intuition behind the operator Roi^ is that the right operand may only execute actions which are not blocked by the left operand. Therefore, we make a distinction using the condition AE{a) O AE{x) = 0 (see axioms R6a and R6b). 11 (Soundness). The axioms given in Table 6 are sound with respect to IWDbisimilarity on closed IWD(o, •, -\-)-terms. THEOREM
PROOF. If ''s = t if b'' represents either one of S, LI-L5, L7, Rl-4, R5, R6b, or R7, then the relation R = {{s, r), (t, 5) | ^} U / is an IWD-bisimulation for that axiom. For the axioms L6 and R6a the IWD-bisimulations are given by
R = [{a-xLoi^y^a-ix
o\^y)),{s
I^GC(r/wD(o,.,+))}^u/
-x o,^y,£ '(x o[y^y)),{e 'X o\^q,x oiy^q)
A process algebra for Interworkings
1295
and R = {{x Ro[y,a ' y,a ' (x o\y^ y)), {x o[^ e - y, e ' (x o[^ y))Ap ^\v^ £ • q. P ^iv. g) \p,qe respectively.
C{EiwDio,.,+)).AE(a) nAE(x) = 0}^ U / D
We will consider basic terms as in Definition 8 of Section 4. To prove the elimination property we will need the following lemma. LEMMA 5. For arbitrary basic terms b\ and b2 we have the existence of basic terms c\, C2 and C3 such that b\ Loiw^2 = c\, b\ Ro^^bi = ci and b\ o\^ bi = ^"3.
These statements are proven simultaneously with induction on the structure of basic terms b\ and Z72. The details of the proofs are omitted. D PROOF.
12 (Elimination). For every closed IWD(o, •, -\-)'term x there is a derivably equal basic term s. THEOREM
PROOF. This theorem is proven by induction on the structure of closed IWD{o, -, -f-)-term X. The only interesting cases are the following: x = x' Loj^x", x = x' Rojwx'^ and x = x' oiw x'' for closed IWD(o, •, +)-terms x' and x". In all cases we find the existence of basic terms b\ and b2 such that x\ = b\ and jc? = ^2- Using the previous lemma we find the desired result. D
Next, we prove that the process algebra IWD{o, •, +) is a conservative extension of the process algebra BPA(8E). This means that every equality between closed terms from the signature of BPA(SE) is also derivable from the process algebra IWD(o, •, +), and also that in the process algebra IWD(o, •, +) only those equalities are derivable. The proof of this theorem uses the approach of [34]. THEOREM 13 (Conservativity). The process algebra IWD(o, •, +) is a conservative extension of the process algebra BPA(8E)'
The conservativity follows from the following observations: (1) IWD-bisimilarity is definable in terms of predicate and relation symbols only, (2) BPA(8E) is a complete axiomatization of IWD-bisimilarity on closed BPA(8E)terms, (3) IWD(o, •, +) is a sound axiomatization of IWD-bisimilarity on closed IWD(o, •, -h)terms (see Theorem 11), (4) The term deduction system for BPA{8E) is pure, well-founded and in path format, and (5) The term deduction system for IWD{o, •, -h) is in path format. D
PROOF.
THEOREM 14 (Completeness). The process algebra IWD(o, •, -h) is a complete axiomatization of IWD-bisimilarity on closed IWD(o, •, -\-)-terms.
1296
S. Mauw, MA. Renters
By the General Completeness Theorem of [33], the completeness of the process algebra /WD(o, •, +) follows immediately from the properties mentioned in the proof of Theorem 13 and the fact that IWD{o, •, +) has the elimination property for BPA{SE) (see Theorem 8). D PROOF.
In Section 3 we have given a direct axiomatization of interworking sequencing, while in this section we have expressed interworking sequencing in terms of alternative and sequential composition. We will prove that the axioms used in the direct axiomatization are still valid in the current setting for closed terms. As a consequence of the fact that IWD-bisimilarity is a congruence for all operators in the signature and the fact that for every closed term there exists a derivably equal basic term, we can prove equalities for closed terms with induction. PROPOSITION
AE{x)f\AE{y)
1 (Commutativity of oiw). For closed IWD(o, •, -\-)-terms x and y such that = 0we have
xoiy,y =
yo;^x.
PROOF. Suppose that AE(x) nAE(y) = 0. We prove the statements x Loi^y = y RomX and xoi^y = y ojw x simultaneously with induction on the structure of basic terms x and y. First we present the proof of x Lo[y^y = y ROJ^JC. (1) X =6. Trivial by axiom Rl-4. (2) X = 8E for some E c EID. Then x Lojwj = ^E LoiwJ = 8EUAE(\) = y Roiw^f = y RoivvX.
(3) x= ax' for some a e Aandjc' e B{ZiwD{o.-.-^))-^^^E{a'x')nAEiy) = 0 implies AE{x') nAE(y) = 0, we have by induction that x' o\^ y = y ojw x\ Then X Loiwj = a 'x' LoiwJ =a • (x' ojw y) = a - (y o\wx') = y Rojw^ • x' = y Roiw^. Note that we have also used that AE{a -x') nAE(y) = 0 implies AE{a) nAE(y) = 0. (4) x=x' + x" for some jc', x" e B(I:JWD(O...-\-))- AS AE{X' + x") nAE(y) = 0 implies AE{x') nAE{y) = 0 and AE{x'') n AE(y) = 0, we have by induction x' Lojwy = y Roiwx' and x^' Lojv^y = y Roiwjc''. Then X Loiwj = (x' + x'') Lojwy = x' Lp\v,y + x" Lo\^^y = y Rojwx' + y Rojwx'' = y Roiw(x' -h x'') = y RojwX. Then we have x oiw y = x Loiwj + x Rojwy = y Roiw-^ + y Lojw-^ = y oiw •^PROPOSITION
2 (Unit element). For closed IWD(o, -, -\-)-terms x we have
s ojwX =x ojw e = X. PROOF.
First, we prove e o\^, x = x with induction on the structure of basic term x.
D
A process algebra for Interworkings
1297
(1) X = £. Then ^ oi^ x = ^ oiw ^ = ^ Loiw^ + ^ Rojw^ = s -h s = s =x. (2) X = 8E for some E c EID. Then s o\^ x = e o[^, 8E = e LPI^SE + s RO\W8E = SE + ^EUAE(£) =8E =X. (3) X =a 'x' for some a eA and x' G S(i7/wD(o. .+))• By induction we have a oj^, x' = x'.Then^ojwX = so^y^^a-x' = £ Loiw^-Jc'-f ^ Roiw^-x' = <5/\£(^/..v')+«-(^oiwx') = (4) X =x\ -\- X2 for some xi, X2 G S(i7/wD(o. .+))• By induction we have e o\w x\ = xi and^ oiwX2 =X2. Then ^ oj^x = ^ ojw (xi +X2) = £ Loiw(xi +X2) -\-s Roiw(xi + X2) = ^LDJWXI -l-^LoiwX2-)-^RoiwX| +£ RoiwX2 = ^Ojw-^l -|-^OiwX2 = X l -}-X2 = X .
Then, using the commutativity of oi^ and the fact that AE(x) HAEis) = 0 we easily find X oiw £ = ^ ojw X = X. PROPOSITION
D
3 (Associativity of ojw). Eor closed IWD(o, •, -\~)-terms x, y, and z, we
have (x oiw y) oiw z = X oiw (y oiw z). PROOF. Without loss of generality we can assume that x, y, and z are basic terms. To prove this theorem the following propositions are proven simultaneously with induction on the general form of the basic terms x, y, and z.
(x Loiwj) LoiwZ = X LDiw(y ojw z),
(1)
(x Roiwy) LoiwZ = X Roiw(y Loiwz),
(2)
(x Oiw y) RoiwZ = X Roiw(y Rojwz),
0)
(x Oiw y) Ojw z = X Oiw (y Oiw z).
(4)
This way of proving associativity of interworking sequencing is similar to the way in which associativity of parallel composition is proven in ACP. Similar equations in the setting of ACP are usually called the Axioms of Standard Concurrency [6]. Let
= £<•:• • Xi
-h 8E
iel
= £*'
•yi^8E
let
+ keKE« + E-
z = ^CO'ZO-^8G-\-Y1
neN
^'
for some finite index sets I, K,L,N,0,Q,
ai, /?/, c,, G A, £, F, G c EID and basic terms
Xi,yi,Zo'
The following identities are used in the proofs of these four equations. Their proofs are omitted. (a Loiwy) LoiwZ = £ Loiw(y oiw z),
(a)
1298
S. Mauw, MA. Renters
(x oiw y) Roiw^ = ^ Roiw(y Roiw^).
(c)
PROOF OF (1).
= {ass. X, distribution laws} y^M'
' ^i Loiwy) LoiwZ + (SE Loiwj) LoiwZ + X l ^ ^ Loiwy) LoiwZ
= {L6, L5} Y^Ui ' {(xi oiw y) oiw z) -h <5£uA£(v)UA£:(-) + ^(^ /€/
Loiwy) LDJWZ
keK
= {Induction hypothesis (4), AE(y)UAE(z)=AE(yoiy^z), ^ai
(a)}
• (x/ oiw (y oiw z)) + 5£u/\£(voi^;) + X ] ^ LoiwCy oiw z)
= {L6, L5} ^ai
• Xi Oiw ( j Oiw z) + 8E LDiw(>' Oiw <:) + X^ ^ LoiwCy oiw z)
= {distribution laws, ass. jc} xLDiw(yoiwZ).
PROOF OF (2). Let L' = {leL\
AE(bi) nAE(x) == 0} and L" = L\
L'.
{x Roiwj) LoiwZ = {ass. >', distribution laws} y ^ ( x Roiw^/ • y/) LoiwZ + {X Roiw^F) LDJWZ + X - / ^ ^ Roiw^) LoiwZ = {R6a, R 6 b , L 6 , R 5 , L5} y^M
' ((-^ °iw y/) Oiw -^) + ] ^ 8AE{x)\JAE{hiyi)iJAE(:) + ^FUA£(.v)U/\£(:)
/GL'
/GL"
+ ^ ( x Roiw^) LoiwZ neN
= {Induction hypothesis (4), (b)} ^Z?/
• (x Oiw (>V Oiw Z)) + ^
let' +
<5^£:(.v)U/^£(/7/y/)U/\£(:) +
8FDAE{X)\JAE{Z)
leL" ^-^Roiw(^LDiwZ)
= {R6a, R6b, L6, R5, L5} y^x let
Roiw(^/ • yi Loiwz) +JC Roiw(5f- Loiwz) + ^ ^ Roiw(^ Loiwz) neN
A process algebra for Interworkings
1299
= {distribution laws, ass. y} X RoiwCy RoiwZ).
PROOF OF (3). Let O' = {oeO\
AE{co) r\AE{x o,^ y) = 0} and O''= O \ O'.
{x ojw y) RoiwZ = {ass. z, distribution laws} y^M
°iw y) RoiwC^ • Zo H- {X Oiw y) Roiw^G + X ^ ( ^ Oiw >') R^iw^
= {R6a, R 6 b , R 5 } / I <:^o • ((-^ Oiw y) Oiw Zo) + l2, ^AE{xo,^y)\JAE{Co-Zo) + ^GUAE(xoi^.>) oeO' o&O" + ^ ( ^ O i w j ) Ro qeQ
= {induction hypothesis (4), AE{xo,^y)=AE{x)UAE{y). ^
Co • ( x Oiw ( y Oiw Zo)) +
oeO'
2 J
(c)}
^ / ^ f (-v)U/\£(y)U^£(cvrC.,)
oeO"
+ 5GUA£U)UA£(y) + ^
-^ Roiw(y Rojw^)
qeQ
= {R6a, R6b, R5} ^ x Roiw(y RoiwCo • Zo)^-x Roiw(j Roiw^^G) + ] ^ ^ Roiw(y Roiw^) = {distribution laws, ass. z} X Roiw(y Roiwz)PROOF OF (4).
(x Oiw y) Oiw z = {S} (X Oiw >^) L D I W Z H- (-^ Oiw }^) RoiwZ
= {S} {x Loiwy + X Roiwj) LoiwZ + U Oiw y) RoiwZ = {L7} (x Loiwj) LoiwZ + (-^ Roiw>') LoiwZ + {x Oiw j ) RoiwZ = {Induction hypotheses (1), (2), (3)} X Loiw(>' Oiw z)-\-x Roiw(y Lojwz) 4- X Roiw(j RoiwZ) = {R7} X Loiw(y Oiw z) + x Roiw(y LoiwZ + y Roiwz)
1300
S. Mauw, MA. Renters = {S} X LoiwCy oiw z)^x =
RoiwCy oiw z)
{S} ^Oiw(yoiwZ).
•
Finally, we give two more identities. They correspond to the axioms ojw 1 and oj^S from Table 2. PROPOSITION
4. For E,F
such thatAE{a) n £ ^^ 0 w have
8E Oiw a = SEUAE(a), 8E Oiw<5/r
PROOF.
=8E\JF'
For the first identity consider 8E Oiw a = 8E Loiw^ + 8E Roiw« = 8EUAE{a) + ^E RoiwtZ • 8 = ^EUAEia) + ^£UAE(a) = ^EUAE{a)^
and for the second consider 8E Oiw ^F = ^E Loiw^F + ^ £ Roiw<5/r = 5£UF "f ^£UF = 8EUF'
D
Observe that we have now shown that all identities on closed /M)(o)-terms that are derivably equal in the process algebra IWD(o), are also derivably equal in the process algebra/WD(o,.,+).
6. The £-interworking merge Now that we have defined the process algebras BPA(8E) and IWD(o, •, +) which include operators for alternative and sequential composition, we aim at extending them with the merge operator. For technical reasons, we do this in two steps: First we will define the f-interworking merge in this section and in the next section we will extend the obtained process algebra to its final shape. The E-interworking merge of x and y, denoted by JC ||J^, y, is the parallel execution of the processes x and y with the restriction that the processes must synchronize on all atomic actions which are defined on entities from the set E. This set E is static, which means that it remains unchanged during calculations on a term which contains the E-interworking merge operator. The resulting process algebra is called /WD(o, -f, •, ||^). The deduction rules defining the operational semantics of the f-interworking merge are given in Table 7. The E-interworking merge of two processes can terminate if and only if both operands can terminate. The second and third rule in Table 7 say that if an operand can perform an action, the merge can perform the same action, provided that the action is not supposed to synchronize (i.e., the sender and receiver are not both in E). The fourth rule expresses the behaviour of a merge in case a synchronized action is possible.
A process algebra for Interworkings
1301
Table 7 Deduction rules for £-interworking merge {a ^ A, E C. EJD)
xj.
>^^
x-^x'
AE{a)^E
x-^x'
y-^y'
y - ^ y' AEja) g E
AEia)£E
• ^ y ^ ^ ' ^ y '
Table 8 Deduction rules for auxiliary operators of £-interworking merge (a e A, E c EID) Xi
yi
^Lfw>i —> x'
x-^x'
AE(a) g E
xl^^y^x'W^^.y y - ^ v' AE{a) C E
DEFINITION 10 (Active entities). For /,7 G E / D , m G M/D, E c E/D, JC,>' e C(i:/wD(o,+,.,||^)). and O e {oi^, Loj^, Roj,,, + , . , ||f^, l^^, |f^, | £ c EID], we define the mapping A£':C(i7/vy£^(o_^.j|£)) ^ F(EID) inductively as follows: AE{c(iJ,m))
= {ij},
AE(e) = 0, AE{8E)
= E,
AE{x Oy) = AE{x) \JAE{y). For the axiomatization of the £-interworking merge we need two auxiliary operators, similar to the axiomatization of the communication merge of ACP. These additional operators are |Lj^ (f-interworking left-merge) and Ij^, (E-interworking synchronization merge). The process x\f^y behaves like the process x ||j^,y with the restriction that the first action must come from process x and that action cannot synchronize with an action from y. The process x\f^y behaves as the process x \\^^ y with the restriction that the first action must be a synchronization. This is formalized by the deduction rules in Table 8. The term deduction system T{IWD{o, +, •, || ^)) consists of the deduction rules of Tables 1, 3, 5, 7 and 8. Table 9 presents the axioms defining the f'-interworking merge and its auxiliary operators. Axiom M states that either one of the two operands executes a non-synchronized action {x)^f^y -\- jILj^Jc), or that a synchronized action takes place (x \^^y)- The definition of the [L-^ operator (LM1-LM7) is very similar to the definition of the Loi^ operator
1302
S. Mauw, MA. Renters Table 9 Axioms of f-interworking merge {a,be A, E, F e EID)
M
= ^L.iy + yLii^ + ^liiy
LMl LM2 LM3 LM4 LM5 LM6a LM6b
if AE{a) % E « • ^ILjw y =
^AE(a:x)UAE(\)
if AE(a) c E
LM7 CMl
^liw-^=^A£(.v)
CM2 CM3 CM4
^\\W^F=8FUAE{X)
CM5a CM5b
if a = « • -^ liw ^ • y = ^A£(«A )UAE(/?-.v)
bAAE(a)^E
ifa^bwAE(a)^E
CM6 CMl
if .
in Section 5 (Table 6, axioms L1-L7). The only difference is that axiom L6 is unconditional, whereas axiom LM6b has to take care of eliminating actions which are supposed to synchronize. Axioms CM1-CM7 define the |-^ operator. This operator enables all actions that can be performed by both operands and which must synchronize. In all other cases it yields a deadlock, where the scope of the deadlock can be derived from the operands. It turns out that IWD-bisimilarity is a congruence for the operators in the signature of IWD(o, -I-, •, 11^). Furthermore, IWD(o, +, •, ||^) is a sound and complete axiomatization of IWD-bisimilarity on closed IWD(o, -f, •, ||^ )-terms. The proofs are based on the metatheory presented in [5,34]. THEOREM 15 (Congruence). IWD-bisimilarity is a congruence for E-interworking merge and the auxiliary operators.
The term deduction system is in path format and hence IWD-bisimilarity is a congruence for all operators. D PROOF.
16 (Soundness). The process algebra IWD{o, -f, •, ||^) is a sound axiomatization of IWD-bisimilarity on closed IWD(o, +, •, \\^)-terms.
THEOREM
A process algebra for Interworkings
1303
PROOF. For the axioms LM1-LM5, LM6b, CM 1-CM4, and CM5b the IWD-bisimulations that witness the soundness are trivial. If "'s = / if Z?" represents such an axiom, then the IWD-bisimulation is R — {{s, r), (r, s) \ b]. For the axioms M, LM7, CM6, and CM7 the IWD-bisimulation is given by /? = {(^,r), {t,s) I ^}U / if the axiom is given as "5 =t if Z?". For the axioms LM6a and CM5a the IWD-bisimulations are
R-^[{a-xlf,y,a-
{x W^y)), {s • x ||f,y,s-{x W^y)), {s • x \\^q,x
I AE(a) lE.q^
\\f^q)
C(r,n,o(o.+..,||f))}^ U /
and
\la =
b,AE{a)
respectively.
D
LEMMA 6. For arbitrary basic terms b\ and b^ w^ have the existence of basic terms ci, C2, and C3 such that b\ if^ h2 = c\, b\ \^^ b2 = C2 and b\ \\f^ bi == C3. PROOF. These statements are proven simultaneously with induction on the total number of symbols of the basic terms b\ and bi. (1) By case distinction on the structure of basic term b\. (a) b\=£.^y case distinction on the structure of basic term bi(i) b2 ^ e. Then bi l^^ ^2 = ^ILiw ^ = ^• (ii) b2 = SF. for some F2 c EID. Then bil^^b2=s ILj^ SFJ = ^^2 • (iii) b2 =a2'b'2 for some ^2 € A and ^^2 € B{EmD{o.-^,-.\\^))- Then
(iv) Z72 = ^2 + ^2 ^^^ ^^^^ ^2'^2 ^ ^(^/H^D(o.+,.,||^))- Sy induction we have the existence of basic terms c\ and c'[ such that e |Lj^ b'^ = c\ and ^iLfw^2=<-Then bx ILfw ^2 = ^ILfw (^2 + K) = ^ILfw ^2 + ^Lfw ^2 = q + ^l (b) ^1 = 5/r, for some F\ c £/D. Then b\ |Lj^ ^72 = ^F, ILiw ^2 = 5FIU/1£{/72)(c) b\ = a i Z^j for some ^1 € Aand^', G B(r/v^^(o,+,.,||^))-^y i^^^^^i^^^^^^^^ the existence of basic term c\ such that Z^j \\f^ b2 = c\. Then, if AE {a) g £", ^iLfw^2 = «i • ^ ; L i i ^ 2 = ^ i • {b\
\\lb2)=ax-c\.
\iAE{ax) c £, then Z?i IL^^ ^ 2 = ^ 1 - b\ if^ Z?2 = 5/^F(a,-^;)u/i£(^2)-
1304
S. Mauw, MA. Renters (d) b\ = b\ + b'{ for some b\,b'[ e BiZj^^p^^^ . \\E^). By induction we have the existence of basic terms c\ and c'l such that b\ |Lj^ b2 = c\ and ^I'lLj^ ^2 = c'[. Then
(2) By case distinction on the structure of basic term b \. (a) b\ = £ . T h e n ^ i |j'^Z?2 = £ Ijl ^2 = 5A£(/,2). (b) b\ = (5/r, for some Fi c EID. Then b\ \^^ bi = ^F\ IJ^ ^2 = ^FxUAEibi)(c) ^1 = fli • b\ for some «i G A and b\ G B(r/^yp(o^ . ||£)). By case distinction on the structure of basic term bi(i) ^2 = ^-ThenZ?i \f^b2 = b\ \^^e = bAE{hx)' (ii) b2 = 8F2 for some Fi c. EID. Then b\ \^^b2 = b\ Ij^^/r, =5A£(/7I)UF2(iii) b2 = a2- b'2 for some a2 e A and ^2 ^ ^(^/WD(o.+,-,||^))- ^Y induction we have the existence of basic term ^3 such that b\ \\f^ b'j = C3. Then, if a\ =a2 AAE{a\) C £, Z7, \ib2=ax
^b\ 1^^.02'b'2 = a, . (Z^; llf^^^) = a , .C3.
Iftzi # a 2 vAE(fli) g£:,then ^1 li'^^2 = « 1 - ^ i li^«2 -^2
=^AE{aih\)UAE{arb2)'
(iv) Z72 = ^2 + ^2 ^^^ ^^^^ ^2'^2 ^ ^(^/WD(o.+. .11^))- By induction we have the existence of basic terms c^ and Cj such that ^1 Ij^ ^7 — ^2 ^"^ ^ilfw^2=4Then ^ l l i w ^ 2 = ^ l l f ^ ( ^ 2 + ^ D = ^ l l i w ^ 2 + ^lliw^2=^2 + 4^ (d) Z?i = b\ + Z7j' for some b\,b'l e BiZj^^p^^^.^^E)). By induction we have the existence of basic terms c^ and C2 such that b\ Ij^ ^2 = <^2 ^^^ ^'/ li^ ^2 = ^2. Then bltb2^
(b\ + b'l) If, b2 = b\ \i b2 + b'[ If, b2=C,+ C'[.
(3) By the previous two items we have the existence of basic terms c\, c[, and C2 such that bx ILii b2 = c\, b2li bx = c'[. and Z^i |f^ ^2 = Q. Then, ^lllfw^2 = ^ l [ L f , ^ 2 + ^ 2 [ L f w ^ l + ^ l l i i ^ 2 = c ; + c ; - f C 2 .
D
THEOREM 17 (Elimination). For every closed /WD(o, +, •, ||^)-r^rm x there is a derivably equal basic term s.
A process algebra for Interworkings
1305
PROOF. This theorem is proven by induction on the structure of closed /WD(o, +, •, ||^)term x. All cases except for x = x\^^x'\ jc = JC' I J ^ ^ ' ' , and x = x' Wf^x'' have already been treated in the proof of Theorem 12. In the remaining three cases we find the existence of basic terms bi and b2 such that x\ =b\ and X2 = ^2- Using the previous lemma we find the desired result. D THEOREM 18 (Conservativity). The process algebra IWD{o, -h, •, ||^) is a conservative extension of the process algebra IWD(o, •, +). PROOF. The proof of this theorem uses the approach of [34]. The conservativity follows from the following observations: (1) IWD-bisimilarity is definable in terms of predicate and relation symbols only, (2) IWD(o, •, -h) is a complete axiomatization of IWD-bisimilarity on closed IWD(o, •, +)-terms, (3) rWD(o, +, •, 11^) is a sound axiomatization of IWD-bisimilarity on closed IWD(o, -h, •, 11^)-terms (see Theorem 16), (4) the term deduction system for IWD{o, •, -h) is pure, well-founded and in path format, and (5) the term deduction system for IWD(o, -h, •, ||^) is in path format. •
19 (Completeness). The process algebra IWD(o, +, •, ||^) is a complete axiomatization of IWD-bisimilarity on closed IWD(o, +, •, \\^)-terms.
THEOREM
PROOF. By the General Completeness Theorem of [33], the completeness of the process algebra /WD(o, +, •, ||^) follows immediately from the properties mentioned in the proof of Theorem 18 and the fact that IWD(o, -f, •, ||^) has the elimination property for BPA(8E)(SCC Theorem 8) and hence also for IWD{o, -, +). D
When defining an operator for parallel composition, several properties are desirable, such as commutativity, the existence of a unit element, and associativity (under some condition). The proof of associativity in the process algebra is quite complicated. PROPOSITION 5 (Commutativity \\^^ ). For closed IWD{o, -h, -, \\^)-terms x, y, and a set of entities E we have
PROOF. The propositions are proven simultaneously with induction on the general structure of basic terms x and y. Let JC ==
^ f l / ' Xi -h SE
y--
-•£.»• leL
+E« keK
iel
-yi
-\-SF
+EneN
1306
5. Mauw, MA. Renters
for some finite index sets I, K, L, N, ai^bi e A, E, F c. EID and basic terms jc,, yi. Then,
^ liw y = J2Jl'"/€/
^' Ifw bryi+x |f„ SF + Y 1 ^ liw £ + ^£ liw >' + E ^ liw y
l€L
iel
iieN
keK
leLMi=biAEiai)£E
+ /^ iel
X/
^^ ' ^^^^' ••^' )U^^(^/ • v/)
leLMi^bivAEiai)<^E
+ ^AE(x)UF + 2^ ^AE{x) + ^£U/\£(v) + /^ neN
= E
E
^AEiy)
keK
^'-(^'iifw^o
/GL ieI.bi=OiAE{hi)<^E +
/
.
/GL
/
.
^AE(hiyi )UAEiai -.v,)
ieLhi^aiVAE{hi)'^E
+ 5Hfw^ + E ^ l . w ^ + yliw'5£ + E > ' l i w ^
= E E ^ / •>'' iiw«' •^'+^f liw^ + E^iiw^+>'iiw^£ + E>'iiw^ /eZ.
=
i€l
neN
keK
>'liw^
and A:||fw)'=^Liw>' + ) ' l L i w ^ + ^ l i w 3 ' = >'lLiw^+^ILiw>' + >'lfw^ = >'lliw^PROPOSITION
D
6. For closed IWD(o, +, •, ||^')-fermj x we have
x\\le=x,
PROOF. The first proposition is proven with induction on the general structure of basic term JC. Let
iel
keK
for some finite index sets I, K,ai e A, E ^ EID and basic terms x/. The induction hypothesis is JC/ llf^ £ = JC/ for all iel. Then,
iel
keK
= E«'-(^'C£)+^£ + E^ iel
keK
A process algebra for Interworkings
1307
8 iel = X
keK
and
^iel
keK ^
iel
keK
iel
keK
Using these two subcomputations we obtain:
iel
keK
= X. The other part of the proposition is obtained using the commutativity of |||^^ .
D
The following proposition serves our needs in proving interworking merge associative in the next section. PROPOSITION 7 (Associativity of ||j^ ). For closed IWD(o, +, •, \\^)-terms x, y, and z, and sets of entities E\, Ei, and £3 such that AE(x) C E\, AE(y) C Ej, and AE(z) C £3, we have
(- iifw'"'^ y) iilw'"'^'"^' ^ = ^ iifj"'"-^"^" {>' iiiw"'"' z). PROOF. Without loss of generality we can assume that x, j , and z are basic terms. We use the following shorthands: 5 = £1 fl £2 H £3, En = iE\ H £2) \ S. E23 = (Ei H £3) \ S, and £13 = (£1 n £3) \ 5. In Figure 16 these sets are indicated in a Venn diagram. We prove the following propositions simultaneously with induction on the structure of the basic terms x, y, and z.
{xlT'y)lt''''''''z
^ ;cLfj^^^'-^^^{>-||,^-^^),
(- Ifw'^"' y) t'^'"""' z = X t^'^^' {y \^' z), (^ \^'y)l!:f'''^'z = X ifj^^^''^^ (yi^'^^'z),
(5) (6) (7)
1308
S. Mauw, MA. Renters
Fig. 16. Explanation of shorthands.
Let
leL
oeO
neN
qeQ
for some finite index sets I,K,L,N,0,Q,ai,bi,Coe
A, E, F,G c^ EID and basic terms
Xi^yhZo-
We only give the proofs for (6) and (8). The proof for (6) uses induction on the general form of basic terms x, y, and z. FromA£(jc) c E\,AE(y) c E2, and AE(z) c £3 we obtain A^U/) c EuAE(yi) c £2, and AE(zo) c £3 for all / G /, / G L, and o e O. This means that we are allowed to use
First, we give a number of subcomputations. These are used in proving Equation (6). Subcomputation 1:
^ f«/-U/llfj''''y/)lfw^''^'-^'''^.-^.
ifai^bi
AAE(ai)£EnUS.
t ^AEiai:Xi)UAE{hryi) \^^^^^~^^^ Co ' Zo Otherwise
A Gi = Co AAE(ai) ^AE(ai)UAE(xi)UAE{yi)UAEiCo-Zo)
C E\3 U £23 U '^^
^^ ^i = ^/ A A£'(^/) C £'12 U S A (a # Q; V A £ ( a , ) 2 £ 1 3 U £23 U 5 ) ,
I ^A£(«/-A-/)UA£(/?/.y/)UA£(Q,-„)
otherwise
1309
A process algebra for Interworkings cii • ( t e W^^'^^'yi) llfj-^^'^^-^^'z.)
if ai ^ bi AAE(ai)
^EnUS
A ai =CoA AE(ai) c E{3 U £23 U 5, hE(ai-Xi)[jAE(bryi)UAE(co-zo)
Otherwise
cii • (fe it'^^'yi) llfj-^^^^-^^'z.)
if «/ ^^/ ^ c , AA£fe) c 5,
5A£(fl,-jc,)UA£(/7/-y/)UA£(Q,-r,)
Otherwise
«/ • te llfj^''^'-^''' (J/ lliw''''^.))
if ^/ ^ ^ / ^ c , AAE(ai) c 5,
<5A£-(fi[/-x,)UA£(/7/-v/)U/i£-((:vrCo)
Otherwise
ai • fe llfj^"^^'-^^^ (y/ W^^'^^'zo)) if ai ^ bi AAE(ai) c En U £,3 U 5 A^/=COAA£'(Z7/)C£23U5,
5A£(fl,-Jc,)U/^£(/./)U/\£(v/)UA£(c.)
i f («/ # ^/ V A^C^/) g £ l 2 U £"13 U S)
Abi=CoAAE(bi)^E23^S, [ ^AE(ai-xi)UAE(bryi){jAE{co-zo) Otherwise at ' Xi |fj2U£i3U5 ^^ . (^^ IIE23U5 ^^^ .^ b^^CoA E^2^^^^^s,_
„
otherwise
^AE(bi\i)UAEiCoZo)
i£i2U£nU5/,
AE(bi) C £23 U S.
,£^3U5
\
Subcomputation 2: /o
,£i2U5
(^^ liw
\ i^nUET^U^
>') liw
"'
o
,£,3U£23U5. |£i3 .-- ,
^ = ^EUAEiy) U = .
~-
^EUAE{\)UAEiz) ,£,2U£,3U5/
Z
|£23U5
\
Similarly we obtain
and
(- \-r' y) If:-'""""' 5c = X \^^-'--' {y \^^-'80). Subcomputation 3: /
|£,2U5 ^ \ |£i3U£23U5
c. = _
Similarly we obtain
|£,3U£23U5
^A£(v)U/l£(c) |£,2U£,3U5/
,£23U5 X
1310
5. Mauw, MA.
Renters
and
Then, using these subcomputations, we obtain
iel leL o^O
+ (- ifJ^"' 3') ifj-'""^-'"^ 5G + E ( - If:"' y) i f w " ' " ' ' ^ «6A^
qeQ
+ ss iT'"'"' {y liw""' z)+X \^'^^^' (5, \^' z) +X \fr"'''''
{y ifJ-^"' 5o) + E - l i w " " ' " ' (^ \^'"' ^)
neN
qeQ
Finally, Equation (8) is proven as follows:
(^llfw"''^)lliw-^''^"'''^
= (- llfw'^"' y) liw""'""' z + zLfj'^^-^^ ( . llfj^^^.) + (. llfj^"' y) If.'-'"'""'. = {-^ILiw
J + yJLiw
•^ + ^liw
>')lLiw
2 + zlLiw
(^lliw
y)
+ (^Lf:^"' y + y ^ ' X + . ifj^^^ y) ifj'^^-^^ z
- ( - e " ' y ) e " ' " " ' ^ + ( y L f r ' - ) e " ' " " ' ^ + (-lfj"'^)e"'"''^ + zLfj'""""' (x llfj^"' y) + (x^' y) Ifj'"'""' ^ + {^ILfj^"' -) ifJ-^"'""' ^ + (^lfj^"'^)lfr'""'^ = xlLfj^""''"' (> llfw""' z) + y Lf:="'""' (^ llfj'"' z) + X \^^-'"-' (y Lfj^^^ z)
A process algebra for Interworkings
1311
- ^Lfj=""""^ (y l l f r ' ^) + (y llfw'"' ^)Lfj^"'''"'+^ Ifw'^"''-^"' (y e ^ ' z + ^If/"^ y + y if,--^.) ,£l2U£'i3U5 / X 'iw
||£'23U5
(yllfr^^)-
a
By taking E\ ^Ei — E^ we obtain associativity of ||j^ . The final property which we prove is the correspondence between the ojw and || f^, operators. This formalizes the resemblance between the axiomatic definitions of these operators. PROPOSITION
8. For closed IWD(o, +, •, \\^)-terms x and y such thatAE(x)r\AE(y)
= 0
we have
PROOF.
Let
leL
neN
for some finite index sets I, K, L, N, aj^bj e A, E, F ^ EID and basic terms x,, >7. The induction hypotheses are jc/ ||^^, y = x, ojvv y for all / e I and x \\^^. yi = x ojw yi for all / e L. Then
iel
keK
= E « ' • (•^' € y) + ^£u^£-(«) + E ^iLfw y iel
keK
1312
S. Mauw, MA. Renters
iel
keKuGN
= Y^ai ' {xi oi^ y) + 8E Loiwy + X ! ^ ^ ^ ^ ^ iel
keK
= ^ai
' Xi LoiwJ + SE LoiwJ + X ^ L^iwy
= X LoiwJ. In the following computations we use that AE{bi) c AE(y) and A£(x) Pi AE(y) = 0 imply A£(Z?/)nA£(x) = 0:
let
neN
/GL
neNkeK
= J2^l'{^ lfw >V) + 5FUAE(.V) + E E ^ "^ ^^^^'^ let =
neNkeK
^ b j leL
'{X Oiw yi)+X
Roiw^F + X ^ Roivve neN
= ^ x Roiw^/ • yi -{-X Ro[^8r + X " ^ Roiw^ neN
/GL
=
X Roiw}',
iel
leL
/G/
leL
keK
neN
and therefore
= X Loiw}' + ^ Roiw-^' + 5A£(.V)UAE{ V) =
X Oiw y +
5A£(A-)UA£(V)
7. Process algebra for Interworkings In the previous section we introduced the E-interworking merge. This operator was parameterized with the set of entities on which the processes should synchronize. In order for the interworking merge to be generally applicable, the set E must be determined from
A process algebra for Interworkings
1313
the actual operands of the interworking merge. Therefore, we have to generalize the Einterworking merge to the interworking merge operator. There is a technical complication which makes this generalization non-trivial: we have to explicitly attribute every process term with the set of entities that it contains. The reason for this is revealed by the examples in Figures 12 and 13 (see Section 2.4). Using the definitions from the previous sections, interworking X2 from Figure 12 has the following semantical representation: c{c, d, m). There is no explicit mention of the empty entity b. Indeed, this interpretation is exactly the same as the interpretation of interworking X2'from Figure 13. In a context with only + and o\^, operators, this identification would be completely harmless, however Figures 12 and 13 show that there is a merge context which makes a distinction between X2 and X2'. The reason for this anomaly is that we did not take empty entities into consideration. Therefore, in order to properly define the interworking merge, we have to extend our semantical representation with information about the entities contained. There are several ways to achieve this. A first option would be to attribute the empty process e with a set of entities. Empty entity b would then be represented by e{h}. A second option would be to label a complete process term with the set of entities which it ranges over. The semantical representation of X2 would then become {c(c, d, m), {b, c, d]), whereas X2' would be represented by {c{c, d, m), {c, d]). For technical reasons we choose to elaborate on the second option. An Interworking with a dynamical behaviour denoted by x over the entities from E is denoted by (x, £). Such a tuple (x, E) will be called an entity-labeled process. DEFINITION 11 {Signature). The signature of the process algebra IWE{o, -f, ||) consists of the operators (_, _>, +, oiw, and ||j^,. For (z, E) to be a well-formed expression we do not require that the active entities from X are all contained in E. All entities in E which are not active entities in x are empty entities. The active entities of (x, E) can be determined from x solely. The complete set of entities of (jc, £"), denoted by Enti{x, £)), contains the active entities from x and the entities from E. DEFINITION 12 (Active entities, entities). For closed IWD(o, +, •, ||^)-term x, £ c EID, and closed IWE{o,-^, ||)-terms s and t we define the mappings AE:C{IJJWE(O.-\-.\\)) -^ F(EID) and Ent'.CiEjwEio.^^W)) -^ ¥{EID) inductively as follows: AE{{x, E)) = AE(x), AE(s-^t) = AE(s)UAE(t), AE(s oiw /) = AE(s) UAEit), AE(s\\.^t)
=AE(s)[JAE(t)^
Ent{{x,E)) = EUAE(x), Ent{s -h r) = Ent{s) U Ent{t),
1314
S. Mauw, MA. Renters Table 10 Operational semantics of entity-labeled processes (a e A, E ^ EID, x,x' IWD(o, +, -, ||^)-terms, 5, s', t, t' entity-labeled processes)
A-;
{^> E) i si
tI
s+ ti
s+ ti s^
s - ^ 5'
t_^
s + t -^s'
oj,,. {e, Entit))
s-^s'
S Ojw ^ i
5 - ^ s'
(A-, E) - % (A-', EUAEix))
s o;^, t - ^
AE{a)r\AE{s) = V\ t -^ t' s' Oj^. /
AE{a) g £/?r(5) n Entjt)
si
ti
s + t -^ t' oj^. (£, Ent{s))
s-^s'
^IliwU
s Ojvv r - ^
S Ojvv r '
t - ^ r^ A£(^) g £'A?r(5) n £nf(r)
t-^t'
AEia) Q Ent(s) n Entit)
s L.t^^s'
It'
Ent{s oivv 0 = Entis) U £nr(r), Ent(s\\.^t) = Ent(s)U Entit). On entity-labeled processes we define the operators interworking sequencing and interworking merge. The set of all entity-labeled processes is called IWE(o, -H, ||). The definition of the interworking sequencing on entity-labeled processes is straightforward. Before we give axioms for the process algebra IWE(o, -h, ||), we define a operational semantics. The operational semantics of entity-labeled processes, as expressed in Table 10, is similar to the operational semantics of non-labeled processes. The first two rules relate the domains of non-labeled processes and entity labeled processes. In the second rule we have to take care that we do not loose information about the involved entities after executing an action. It may happen that some active entity from X which does not occur in E is not active anymore in x' since the last action from that entity has been executed. Therefore, we have to extend the entity label of x' with the active entities of jc. The rules for the interworking merge correspond to the rules for the Einterworking merge but the condition AE{a) c £ is replaced by AE{a) c Ent{s) n Ent(t). The set Ent(s) n Ent(t) contains the shared entities from s and r, so this is the set of entities which should synchronize. For the "correctness" of the deduction rules for interworking merge it is necessary that the set of entities of a process does not change by executing actions (Lemma 8). This is guaranteed by the deduction rules. We first prove that the set of active entities does not expand due to the execution of actions.
A process algebra for Interworkings
1315
LEMMA 7. For all a € A and closed IWD(o, -}-,•, \\^)-terms x andx' we have: ifx - ^ x', thenAE{x)^AE{x'). This lemma is proven with induction on the structure of closed IWD{o, +, •, ||^)term;:. Suppose that x - % x'. (1) X = e. This case cannot occur as e - ^ . (2) x =8E for some E c EID. This case cannot occur as 8E —^ • (3) X = b for some b e A. Then it must be the case that b = a and x' ~ e. Clearly AE(x) =AE{b) 2 0 = AE(e)=AE(x'). (4) X =x\ -{- X2 for some closed IWD{o, -h, •, ||^)-terms x\ and xj. Then it must be the case that either x\ - % x' or x? - ^ Jc^ By induction we thus have either AEix\) 2 AE(x^) or A£(jC2) 2 AE(xO. In either case we have AE(x) = AEC^i + X2)=^AE(xi)UAE(x2)^AE(x'). (5) X = xi • X2 for some closed IWD(o, +, •, ||^)-terms xi and JC2. Then we can distinguish two cases. First, xi - ^ x\ for some closed/\yD(o, -h, •, ||^)-termxj such that x^ = x[ ' X2. By induction we have AEUi) ^AE{x[). Then AE(x) =AE(x\ X2) = AE(xi) UAE(X2) ^AEix[) U AE(x2) = AE{x\ - X2) =AEix'). Second, X| | and X2 - ^ x'. By induction we have AE(x2) 2 AE(x'). Then AfCx) = AEUi • X2) = AE(xi)UAE(x2)^AE(x\){JAE(x')^AE(x'). (6) X = x\ oiw X2 for some closed IWD{o, +, •, ||^)-terms xi and X2. Then we can distinguish two cases. First, xi —^ xj for some closed IWD(o, + , . , ||^)-term x\ such that x' = x\ o\^ X2. By induction we have AE{x\) 2 AE(x\). Then AE{x) = AECxi oiwX2)=A£'(xi)UA£'(x2) 2 AECxJ) U A£'(x2) = AECxj 01^x2) =AE(x'), Second, A^C^) flA^Cxi) = 0 and X2 - ^ x^ for some closed /WZ)(o, +, •, ||^)-term X2 such that x^ = xi oiw x'^. By induction we have A£'(X2) 2 AE(x'^). Then A^Cx) = AE(xi oiwX2)=AE(xi)UA£(x2)2A£(xi)UAE(x;)=:A£(xi oiw X2) = AE(x'). (7) X = XI ||j^X2 for some E c EID and closed IWDio, +, •, ||^)-terms xi and X2. Then we can distinguish three cases. First, AEia) g E and xi - ^ xJ for some closed /WD(o, +, •, ||^)-term xJ such that x' = xJ \\^^.X2. By induction we have AE(xi) 2 AECxj). Then AE(x) =AE(xi ||f^,X2) = A£(xi) UA£'(x2) ^ AE(x[) U A£(X2) = AE{x[ ||j^X2) = AE{x'). Second, AE{a) g E and X2 - ^ x; for some closed IWD{o, -f,., ||^)-term x^ such that x' = x\ WJ^Xy By induction we have A£'(X2) 2 AE(x!^. Then A£(x)"= A£(xi ||f^,X2) = A^Cxi) U A£'(x2) 2 A£(xi) U AE(x'2)=AE{x\ llj^x;) = A£(x'). Third, A £ ( « ) C £ , x i - % xj, a n d x 2 - ^ 4 for some closed/WD(o,-h, •, ||^)-termsxj andx^ such that x ' = xj Hj^x^. By induction we have A£(xi) 2 AEix[) and A£'(x2) 2 AEix^). Then AE(x) = A^Cxi |f^ X2) = AE(xi) UA£'(X2) 2 A£(x;) UA£(x;) = AECxj ||f;.x;) ^AE(x'). • PROOF.
LEMMA 8. For all closed IWE(o, +, \\)-terms s and t and all a e A we have: ifs - ^ s', then Ent(s) = Ent{s'). PROOF.
term 5.
This lemma is proven with induction on the structure of closed IWE{o, +, ID-
1316
S. Mauw, M.A. Renters
(1) s ~ {x, E) for some closed /WD(o, +, •, ||^)-term jc and £ c EID. Then s -^ s' must be due to x - % x' for some x' such that s' — {x\ E \J AE{x)). Clearly we have Ent{s) = Ent{{x, E)) = E \JAE{x) and Ent{s') = Ent({x\ E UAE(x))) = £ U AE{x) UAE{x'). Using Lemma 7 we obtain Ent(s) = Ent{s'). (2) 5 = 51 + 52 for some closed /WECo,-h, ||)-terms ^i and si. We can distinguish two cases. First, s\ - % s\ for some closed /WfCo,+, ||)-term s\ such that 5^ = s\ oiw {e,Ent{s2))' By induction we have Ent(s\) = Ent(s[). Therefore, £nr(5) = £nr(5i + S2) = £nr(5i) U Enti^si) = Ent{s\) U En/fe) = Ent{s\) U Ent({£, Ent{s2))) — Ent{s\ o\^ {e, Entisi))) = Ent{s). Second, si - ^ 4 ^^^ ^^"^^ closed/W^Co, +, ||)-term ^ such that s' = 5:^ oj^ (6:, Ent{s\)). This case is symmetrical to the first case. (3) s=s\ Oiw S2 for some closed IWE{o, -h, ||)-terms s\ and 52. We can distinguish two cases. First, ^i - ^ s\ for some closed IWE{o, +, ||)-term 5J such that s' = s\ o\^ 52. By induction we have Ent{s\) = Ent{s[). Therefore, Ent(s) = Ent{s\ o\^ 52) = Ent{s\) U Ent{s2) = Ent(s[) U £nr(52) = Ent{s[ o,^ 52) = Ent(s'). Second, AEia) 0 A£(52) = 0 and 52 - ^ s'^ for some closed IWE(o, -h, ||)-term Sj such that 5' = 5i ojw 52- By induction we have Ent(s2) = Ent{s'^). Therefore, Ent{s) = Ent{s\ oi^ 52) = Ent{s\)VJ Ent{s2) = Ent(s\)VJ Ent{s'^) = Ent{s\ o,^. s'^) = Ent{s'). (4) 5=51 II iw "^2 for some closed IWE{o, -h, ||)-terms 5i and 52. We can distinguish three cases. First, A£:(a) <^Ent(s\)nEnt(s2) mds\ - % s[ for some closed/WECo, H-, ||)term s[ such that s' = s[ \\-^^S2. By induction we have Ent{s\) = Ent{s\). Therefore, Ent{s) = £nr(5i 11^^52) = Ent{s\) U Ent(s2) = Ent{s\) U Ent(s2) = Ent{s[ ||j^52) = Ent{s'). Second, AE{a) % Ent{s\) H Ent{s2) and 52 - ^ ^ ^^^ some closed /^^(o,-h, ||)-term 5:^ such that 5' = 5i lli^^- ^^ induction we have Entis2) = Ent{s'^). Therefore,"£nr(5) = £nr(5i llj^.52) = Ent(s\) U Ent{s2) = Ent{s\) U Entis'^) = Ent{s\ ||j^.5;) = Ent(s'), Third, AECfl) C £'nr(5i) H £nr(52), 51 - ^ 5p and 52 - ^ 52 for some closed /W£(o, -h, ||)-terms s\ and 52 such that s' = s\ ||j^4- ^y induction we have Ent{s\) = Ent{s\) and Ent{s'2) = Ent{s2). Therefore, Ent{s) = Ent{s\ \\;^,S2) = Ent(s\) U Ent(s2) = Ent(s\) U £nr(52) = Ent(s\\\,^s',) = Ent(s'). • Next, we adapt the definition of IWD-bisimilarity to take into account the set of entities of a process. DEFINITION 13 (Entity bisimilarity). A symmetric relation R on closed /W£(o,-h, ||)terms is an entity hisimulation, if and only if, for every pair (5, t) e R and a e A, the following conditions hold: (1) AE{s)=AE(t), (2) if 5 I, then r 4, (3) if 5 - ^ s\ then there is a closed /WE(o,+, ||)-term r' such that t - ^ r' and {s\t')eR, (4) Ent(s)=Ent(t). The closed /WECo, +, ||)-terms 5 and t are e«r/r>' hisimilar, notation 5 : ^ r, if and only if there exists an entity bisimulation R relating them.
A process algebra for Interworkings THEOREM
1317
20 (Equivalence). Entity bisimilarity is an equivalence relation.
The proof is similar to the proof that IWD-bisimilarity is an equivalence (Theorem 1) and therefore omitted. D PROOF.
21 (Congruence). Entity bisimilarity is a congruence for the function symbols in the signature ofIWE{o, +, ||) which are defined on IWE(o, -h, \\)-terms.
THEOREM
PROOF. Suppose R : x ±±^^^y and E^ ~ Ey. Now we must prove that there exists an entity bisimulation R' such that R' : (x, £,) 1> (v, Ey). Let R' = {((/?, E), {q, E)) \ pRq, E = E). Let p and q be closed lWD{o, -h, •, ||^)-terms such that pRq and E, F c. EID such that E = F. Since p i^j^^ q we have AE(p) = AE(q). (1) AE{{p, E)) =AE{p) =AE(q)=AEi{q. F)). (2) Suppose that (p, E) - ^ ^ for some closed IWE(o, -h, ||)-term 5. This must be due to p - ^ p' for some closed IWD(o, +, •, ||^)-term p' such that 5 — {p\ E UAE(p)). As p ±>iwd ' w^ have the existence of closed IWD(o, -h, •, ||^)-term q' such that q -^ q' and p'/^i^^ Then we also obtain {q, F) - % {q\ FUAE(q)). Clearly (/7', E \JAE{p))R'{q\ F UAE{q)). (3) Suppose that (p, £> | . This must be due to /? | . As p <±^^-^ q, we have (7 i. Therefore, (<7, F) 4.. (4) Ent({p, E)) = E UAE(p) = FUAE{q) =AE({q, F)). Suppose Ri : si ±> t\ and R2 : ^^2 ±t ti. Let R = {(si -f /i, ^2 + ^2), (P\ ojw (^. E), q\ oiw (8,E)), (p20i^{8, E),q20\^{e, E)) | p\R\q\, piRiqi. E c £//)}. Obviously, this relation is an entity bisimulation. Suppose R\ : s\ <±t\ and Ri : si <±t2. Let R = [ip\ ojw P2^^\ oiw qi) I /^i^i^h PiJ^iqi)' Obviously this relation /? is an entity bisimulation. The proof is similar to the proof that IWD-bisimilarity is a congruence for interworking sequencing (see Theorem 2). Suppose R\ : s\ <±t\ and R2 : S2<±t2. Let R = {(/7i ||j^P2,^i \\\^q2) I P\R\q\. Pi^iqi}' Obviously this relation R is an entity bisimulation. D
As was done in [25], the interworking merge is expressed in terms of the £-interworking merge operator and the common entities of the operands. The axioms for entity-labeled processes are given in Table 11 for £, F c EID. The extension oiIWD{o, •, -h) with entitylabeled processes is denoted by IWE{o, -f-, ||).
Table 11 Axioms of entity-labeled processes (E, F ^ EID)
IWEl IWE2 IWE3 IWE4
{x,E) = {x,EUAEix)) {x, E) + (v, F) = {x + y, E U F) {x, E) oj^. (>•, F) = (A- oi,v y, E U F) (jc, E) llj^, (y, F) = {x \\^^^'^ y, E U F)
if AE{x) C E and AE(\) C F
1318
S. Mauw, M.A. Renters
Axiom IWE\ describes the convention discussed before that the entity-part of an lWE{o, +, ||)-term contains at least the empty entities of the Interworking. Axioms IWE2IWE4 describe how the other operators on IWE(o, -f-, ||)-terms can be defined in terms of their counterparts on IWD{o, +, •, ||^)-terms. It is also possible to define entity bisimulation in terms of IWD-bisimilarity of the process-parts and set equality of the entity-parts. Also for our final process algebra, IWE(o, +, ||), we prove soundness and completeness. THEOREM 22 (Soundness). The process algebra IWE(o, -f, ||) is a sound axiomatization of IWD-bisimilarity on closed IWD(o, -(-,•, \\^)-terms. The process algebra IWE(o, -f, ||) is a sound axiomatization of entity bisimulation on closed IWE{o, -h, \\)-terms. PROOF. For the first proposition observe that we did not add any axioms relating closed IWD(o, +, •, ||^)-terms. We will prove the second proposition. Since entity bisimulation is a congruence for the closed IWE(o, -|-, ||)-terms (Theorem 21) we only have to show that the axioms from Table 11 are sound. Thereto, we provide an entity bisimulation relation for each axiom. For/WEI, the relation R = {((x, £ ) , (JC, £'UA£'(jt)>)}^U/ is an entity bisimulation. For the axiom/W£2 the relation R = {((/?, E)-\-{q, F>, {p + q. EUF)), ({p, E)oi^ (e, F), {p, EUF))\p,q e CiEj^yj^^^^.^^E)), E,F
14 (Basic terms). The set of basic terms is the smallest set that satisfies: if jc is a closed IWD(o, +, -, ||^)-term and E c EID such that AE{x) c F, then (x, F) is a basic IWEio, +, ||)-term. The set of all basic terms over the signature of IWE(o, -h, ||) is denoted by B(i:jwE(o,-h.\\))' DEHNITION
THEOREM 23 (Elimination). For every closed /WF(o, -h, \\)-term s there exists a basic /WF(o, +, Wyterm t such that /WF(o, +, ||) h ^ = r. PROOF. This theorem is proven with induction on the structure of a closed IWE{o, -f, IDterm. First, consider the case s = (x, F) for some closed /M)(o, +, •, ||^)-term x and F C EID. Then ^ = (x, F) = (x, F U AF(x)). Clearly AE(x) c F U AE{x) and hence (x, F U AF(x)) is a basic IWE(o, +, ||)-term. Then, consider the case ^ = ^^i + ^2 for some closed /WF(o, +, l|)-terms ^i and sj. By induction we have the existence of basic terms (xi, E\) and (x2, F2) for some closed/WD(o, -f, •, ||^)-termsxi andx2 and F | , F2 ^EID s u c h t h a t A F ( x i ) c F | andAF(x2) c F2. Then, 5 = ^1 +52 = (-Vi, F|)-h (x2, F2) = (xi -jX2, Fi UF2). Clearly AF(xi +X2) ^ Fi UF2. Next, consider the case 5 =^1 oiw^2 for some closed IWE{o, -h, ||)-terms s\ and S2. By induction we have the existence of basic terms (xi, E\} and (x2, F2> for some closed/WD(o, +, •, ||^)-termsxi andx2 and Fi, F2 c EID such that AF(xi) c E\ and AF(x2) ^ F2. Then s = s\ ojw ^2 = (-^1, E\) ojw (^2, F2) = (xi oiw X2, E\ U F2). Clearly AF(xi oiw X2) = AF(xi) U AF(x2) C Fi U F2. Finally, consider the case s = s\ \\- si for some s\, si closed IWE{o, +, ||)-terms. By induction we
A process algebra for Interworkings
1319
have the existence of basic terms (jci, £"1) and {xi, Ei) for some closed IWD(o^ +, •, 11^)terms x\ and xi and Ei.Ei ^ EID such that AE{x\) c E\ and AE{x2) ^ £"2. Then s = sx 11,^^2 = {XX. Ex) lli^ (JC2, £2) = {-VI llit'''^- -V2, £1 U £2). Clearly AE{xx \\.^.X2) = AE(x\){JAE(x2) C £, U £2. • LEMMA 9. For basic IWE(o, +, ID-r^rm^- (jc, £) and ( j , £) w^ /zav^ {x,E)<±{y,F)
iff X ±>^^^yandE
= F.
First, suppose that R:{x,E) <± {y, F>. Let R' = {(/?, ^) | {/?, £'>/?{^, £'>. ^ ' = F'}. As (jc, £')/?(>', £), A£(x) c £, and AE(y) c £, we have £ = £ UAE(x) = Ent(x) = Ent(y) = FUAE(y) = F. We will prove that R' is an IWD-bisimulation. (1) AE{p) =AE({p. E'))=AE{{q. F')) ^AE{q). (2) /7 ; iff {p, E') i iff {q, F') ; iff ^ ; . (3) Suppose that p-^ p' for some closed /WD(o, +, •, ||^)-term p. Then (p, E') - ^ (/?',£' U A£(/7)). So we have (^, £') - ^ ((7', £' U A£(^')) for some closed IWD{o, + , . , ||^)-term q' such that (/?', E'UAE(p))R{q\ F'\JAE{q')). From this we obtain that £ ' U A£(p') = F'^AE{q'). Thus p'R'q. The proof in the other direction is trivial. D PROOF.
THEOREM 24 (Completeness). 77?^ process algebra IWE{o, +, ||) is a complete axiomatization of entity bisimulation on closed IWE{o, +, \\)-terms. PROOF. By the elimination theorem (Theorem 23) we only have to prove this theorem for basic lWE{o, +, ||)-terms. Let (JC, £ I ) and (>% £2) be basic /W£(o, +, ||)-terms such that (x, £1) ±> (y, £2). By Lemma 9 we have x <±:,^.^ y and Ex = £2. Since IWD{o, -h, •, ||^) is a complete axiomatization of/HD(o)-bisimilarity on closed /WD(o, +, •, ||^)-terms, we have X = >', and hence (x, £1) = (y, £2). •
25 (Conservativity). The process algebra /W£(o, +, ||) is a conservative extension of the process algebra IWD{o, +, •, ||^).
THEOREM
With respect to /WD(o, +, •, || ^)-terms, the process algebra /W£(o, +, ||) and the process algebra IWD{o, +, -, ||^) have exactly the same axioms. Then clearly the same equalities can be derived between closed IWD(o, +, •, || ^)-terms. D PROOF.
We end our treatment of the semantics of Interworkings with some properties of Interworkings. The interworking sequencing is commutative under the assumption that the active entities of the operands are disjoint. Furthermore, it is associative. The interworking merge is both commutative and associative. PROPOSITION
9 (Unit elements). For closed IWE{o, -h, ||) terms s,
5Oiw(e,0) = s, (e,0)oi^^ = 5,
(9) (10)
1320
S. Mauw, MA. Renters
sl^{s,&)
=s^
(11)
(^,0>lli,^ =s.
(12)
PROOF. By the elimination theorem it is allowed to restrict the proof of the statements to basic terms. Let s = (x, E) for some closed IWD(o, -h, •, ||^)-term x and E c EID such that A£:(jc)C£. Then
s oiw {e, 0) = (jc, E) oiw (£, 0) = (j oi^, £, £ U 0) = (jc, £) = 5, (£, 0) oiw 5 = {£, 0) oiw- (x, E) = {e oiw JC, 0 U £) = (x, £) = 5, ^lliw(^'0) = {X. E)\\,^{e.0) {e.id)l^s
={x\\^^''^e, EUid) = {x wis, E)= {X, E) =s,
= {^,0)||i^(x,£)=(^||f,^^^x,0U£) = (^||f^,x,£)=(x,E>=5. D
PROPOSITION 10 (Commutativity and associativity of oiw and IWE(o, +, \\)-terms s, t, u we have so;^t
= to;^,s,
ifAE{s)r\AE{t)
||j^). For closed
= V^
(13)
{s ojw /) o\^u = s ojw (r ojw M), ^h.t = t\\.^^.s.
(14) (15)
(^IUOIIiw" = ^lli,(Mli.,").
(16)
PROOF. By the elimination theorem it is allowed to restrict the proof of the statements to basic terms. Let s = {x\,E\),t = {xi, Ei). and u =• {x3, £3) for some E\, Ei, £3 ^ EID and closed /WD(o, +, •, ||^)-terms x\, X2, and X3 such that AE{x\) c £1, A£(x2) c £2, andA£(x3)C£3.Then 5 Oiw f =
(Xi, £ 1 ) Oiw (X2, £ 2 ) = (-^1 Oiw^2. E\ U £ 2 )
=
{^2 0iwXi, £ 2 U £ 1 ) = {X2, £ 2 ) Oiw (-^1, E\)
=
^Oiw^,
(5 Oiw r) Oiw M = =
({Xi, £ i > Oiw (X2, £ 2 ) ) Oiw {-^3, ^3> (-^1 Oiw -^2, E\ U £ 2 ) Oiw (X3, £3}
= ((^1 Oiw X2) Oiw X3, ( £ 1 U £ 2 ) U £ 3 ) = (^1 Oiw (X2 Oiw X3), £ 1 U ( £ 2 U £ 3 ) ) =
(Xi, £ 1 ) Oiw (X2 OiwX3, £ 2 U £ 3 )
=
( x i , £ i > O i w ( ( X 2 , £ 2 ) o i w {•^3,£'3))
=
5 Oiw ( / O i w M ) ,
sW^^t = (x,,£,)||j^,(X2,£2)=(-Vl||i^j''^^X2,
£lU£2)
= (X2 \\^f^' X,, £2 U £ , ) = (X2, £2> lliw {^1' ^1)
A process algebra for Interworkings (^IliwOlliw" =
1321
((x,,£,>||j^(X2,£2))lli,,(^3,i^3)
= ((^1 lliw""^' ^2) IlL^'^'^^^^'-^ X3, (El U E2) U £3)
= (x, llfj^^^^^^-^^ (.V2 Iht'^^-' ^3), (^1 U £2) U £3) = =
{xi,E,)\\.^^.{x2\\^f^'x,.E2^E,) {X\,E,)\\.^^,{{X2,E2)\\,^.{X3,E3))
= ^lliw(Mli.,^). PROPOSITION
•
11. For closed IWE(o, +, \\)-terms s and t such that Ent(s) H Ent(t) = 0
we have s\\;^t = soi^,t. By the elimination theorem it is allowed to restrict the proof of the statements to basic terms. Let s = (jc, E) and t = (v, F) for some E, F ^ EID and closed IWD(o, + , . , ||^)-terms x and y such that AE{x) c E and AEiy) c F. PROOF.
sl^t
= {x,E)l^{y,F)={x\ty,EUF) = {x oiw y, EUF) = (x, £) oi,,. (y, F).
D
8. Conclusions The starting point of the application described in this chapter was the informal drawing technique, called Interworkings. After analyzing the informal meaning of the language and the way in which users applied this language, our aim was to formalize the Interworking language. The assets of having a formal semantics are well-known. We mention the following. Formalization yields a thorough understanding of the language and the aspects of the appHcation domain which can be modeled; it allows for an unambiguous interpretation of expressions in the language; it enables formal analysis; and it can be used to derive, or even automatically generate supporting tools. These points directly addressed the problems that users were confronted with when applying the language. The language organically grew from a collection of examples and it was not clear which constructs were exactly part of the language. For some diagrams even specialists disagreed on the exact interpretation. It was not clear under which precise conditions two Interworkings could be merged. And, finally, in order to efficiently work with collections of Interworkings tool support was required. The research carried out helped to solve these issues to a large extent. The kernel of the work was the description of the formal semantics of the language by means of process algebra. This is the part of the research covered in this chapter. Our choice was to use process algebra for the formal definition of Interworkings. This worked out quite successfully. The process algebraic approach even proved suitable to
1322
5. Mauw, MA. Renters
define the semantics of a similar, but much larger language (MSC'96). Although it showed very beneficial, we do not advocate that the process algebraic approach is the best or even the only suitable approach towards the formalization of sequence chart languages. Other techniques, such as Petri nets and partial orders, have also been successfully applied, and when considering only the core of these sequence chart languages, the several approaches do not differ too much with respect to expressivity and simplicity. Only when extending the sequence chart language with specific features, such as recursion and interrupts, some approaches offer a more natural way of modeling. The work presented here only describes the part of the project which has to do with the theoretical foundations of the project. The main point here was to identify the basic Interworking constructs and operators, and to give their operational and algebraic semantics. The extension with a theory of refinement or the derivation of computer tools is not in the focus of this handbook. Although already an overwhelming variety of operators has been described in process algebra literature, we have introduced yet more operators. This is typical for the process algebraic approach. For a specific application domain a specific algebra is needed. In the case of sequence charts, the standard operators for sequential and parallel composition do not properly describe the user's intuition. Because the synchronization implied by strong sequential composition is in contradiction with intuition, we developed the interworking sequencing. Because the standard parallel composition operator could not deal with overlapping areas of an Interworking, we had to investigate a variation: interworking merge. Even though these are newly invented operators, their definitions resemble the definition of well-studied operators. This approach of defining new operators and variations on existing operators has been illustrated in this chapter. We have treated all proof obligations, such as soundness and completeness in full detail. We have especially taken care of setting up our theory in a modular way. This means that we have first defined the kernel of the theory (i.e., the semantics of single Interworking diagrams) and subsequently extended this with other operators. The kernel of our theory just consists of the interworking sequencing operator. This single operator already allows for the definition of the semantics of Interworking diagrams. After that, we defined the basic process algebra consisting of the standard operators for alternative and sequential composition, extended with a special constant for expressing partial deadlocks. The alternative composition operator is used to express alternative scenarios. This process algebra is independent of the previous one, and the next module simply consisted of the combination of these two theories. The interworking sequencing can now be expressed in terms of the other operators. The axioms defining the interworking sequencing in the first process algebra are now derivable properties. Finally, we extended this algebra with the interworking merge operator. This required two separate steps. First we introduced the E-interworking merge, which is parameterized by the set of entities which should synchronize. And next, we extended the semantical interpretation of Interworkings in order to be able to define the unparameterized interworking merge. This modular approach is illustrated in Figure 17. In our opinion, such a modular approach brings several assets. A mathematical theory, just like a piece of software, requires maintenance. Parts of the theory may become obsolete due to new insights or new extensions may be required due to additional user re-
A process algebra for
Interw'orkings
1323
Fig. 17. Overview of conservative extensions.
quirements. A modular theory makes it easier to isolate the parts of the theory which are affected by such modifications. A modular design also reduces the impact of a misdesign of one or more concepts. The modules defining the other concepts can easily be reused, while replacing the inappropriate concepts. An example of such a misdesign could be the interworking merge. Contrary to the interworking sequencing, which seems to be very stable and well accepted, several alternatives for the interworking merge have been proposed in literature (such as the environmental gate merge, see [30]). The part of the algebra describing the interworking merge can easily be replaced by a definition of another similar operator.
9. Bibliographical notes In this section we will give a comprehensive overview of the relevant literature on Interworkings and the related language Message Sequence Chart (MSC). Interworkings. In [24], Mauw, Van Wijk and Winter give a concrete textual syntax for the language IW and present both an informal and a formal definition of its semantics. The formal semantics does not consider entities without events (empty entities). A short version appeared as [25]. Based on the work on the formal semantics several prototype tools have been developed. A description of the prototype tool set is given in [26]. This tool set consists of three parts, the interworking processor (IWP), the intermediate language compiler (ILC) and a term rewriting system (TRS). The formal semantics of Interworkings is not able to deal with empty entities and refinement. This has been solved in [19-21].
1324
S. Mauw, MA. Renters
The deduction rules for [Lj^ are different from the deduction rules used in [21] in the sense that the termination behaviour of \\f^ is coded in the termination behaviour of [L-^ instead of using the termination operator ^ used there to describe the termination behaviour of E-interworking merge. There are two reasons for this change. First, in [35] and [32] also the termination behaviour is described with the left-merge operator. Second, it is easier to define the set of active entities of a process term A* [Lj^ y in this case. In [21] we reported the following. For closed IWD(o, -h, •, ||^)-terms x, y, z, and sets of entities E\, E2, Ei, we have
This is not true. In the case that x can execute an action a such that AE{a) 2 E\ and AE{a) c. EzD E3 the equation does not hold. This can be explained as follows. The sets E\, Ei. and £3 are intended to model the instances of ;c, j , and z respectively. In the situation sketched above we have that x executes an action defined on an instance that does not belong to x! Here we presented an improved and correct version of this proposition. The interworking merge as defined in [25] did not have the associativity property. This difference is a direct consequence of our decision to maintain the entities of an Interworking statically. In [7] the language Interworking is extended with discrete absolute time features. Events can have a discrete time stamp or a discrete time interval associated with them. The authors describe the timed versions of interworking sequencing and interworking merge. In [10], Feijs uses Interworkings as a starting point for generating finite state machines. This is useful for obtaining feedback from a set of scenarios (Interworkings) during a system's definition phase or test phase. In [9], possibilities and impossibilities of using Interworkings are studied in the context of describing a service, a protocol, or a protocol entity in the OSI reference model on different levels of abstraction. The author concludes that Interworkings are useful for analyzing a limited number of interesting cases such as test runs, simulation runs, and debug sessions, but also that Interworkings lack sufficient power to act as a specification formalism. Message Sequence Charts. From the vast amount of graphical languages that resemble Interworking the language Message Sequence Chart, which is standardized by Study Group 10 of Question 9 of the Telecommunications Standardisation Sector of the International Telecommunication Union, is best known. The language MSC describes the asynchronous communication between instances (entities). The language is very rich in its syntax and has a standardized formal semantics [13,28]. This formal semantics is inspired by the work on the formal semantics of Interworking. In [17] a process algebra semantics of Basic MSC (only simple diagrams) is given. In [16], prototype tools are defined based on this formal semantics. In [27,18] the formal semantics of Basic MSCs is extended to the language MSC92 except for instance decomposition and conditions. Later, this semantics is standardized as Annex B to Recommendation Z.120 [13]. Also De Man [15] gives a process algebra semantics for Basic MSC. In [22], High-level Message Sequence Charts are treated. In [23,28], an operational semantics for a large fragment of MSC96 is presented.
A process algebra for Interworkings
1325
Besides the literature on the semantics of MSC based on process algebra, we also mention some other approaches. In [11], an MSC is transformed into a Petri net. In [14], a semantics of Message Flow Graphs is presented that translates an MSC into a Btichi automaton. In [2], Alur, Holzmann and Peled, present a partial order semantics for Basic Message Sequence Charts. In the ITU Recommendation Z. 120, the only assumption about communication between entities is that it is asynchronous and that sending of a message occurs before its receipt. In [8], communication is discussed based on FIFO buffers. A variety of communication models is obtained by considering different ways of connecting entities through buffers. A hierarchy of these communication models is presented based on the possibility of implementing MSCs in the communication models. One of the communication models is identified with the synchronous communication in Interworkings.
References [1] W.M.P. van der Aalst, Interorganizational workflow: An approach based on Message Sequence Charts and Petri nets. Systems Anal. - Modelling - Simulation 34 (3) (1999), 335-367. [2] R. Alur, G.J. Holzmann and D. Peled, An analyzer for Message Sequence Charts, Software - Concepts and Tools 17 (2) (1996), 70-77. [3] J.C.M. Baeten and S. Mauw, Delayed choice: an operator for joining Message Sequence Charts, Formal Description Techniques VII, Proc. 7th IFIP WG 6.1 International Conference on Formal Description Techniques, Berne, D. Hogrefe and S. Leue, eds. Chapman & Hall (1995), 340-354. [4] J.C.M. Baeten and C. Verhoef, A congruence theorem for structured operational semantics with predicates, CONCUR'93, International Conference on Concurrency Theory, Lecture Notes in Comput. Sci. 715, E. Best, ed.. Springer-Verlag (1993), 477^92. [5] J.C.M. Baeten and C. Verhoef, Concrete process algebra. Semantic Modelling, Handbook of Logic in Computer Science 4, S. Abramsky, D.M. Gabbay and T.S.E. Maibaum, eds, Oxford University Press (1995), 149-268. [6] J.C.M. Baeten and W.P. Weijland, Process Algebra, Cambridge Tracts Theoret. Comput. Sci. 18, Cambridge University Press (1990). [7] J. van den Brink and W.O.D. Griffioen, Formal semantics of Interworkings with discrete absolute time. Algebra of Communicating Processes, Utrecht 1994 Workshops in Computing A. Ponse, C. Verhoef and S.F.M. van Vlijmen, eds. Springer-Verlag (1995), 106-123. [8] A. Engels, S. Mauw and M. A. Reniers, A hierarchy of communication models for Message Sequence Charts, Formal Description Techniques and Protocol Specification, Testing and Verification Proc. FORTE X and PSTV XVII '97, Osaka, Japan, T Mizuno, N. Shiratori, T. Higashino and A. Togashi, eds. Chapman & Hall (1997), 75-90. [9] L.M.G. Feijs, Synchonous sequence charts in action. Information and Software Technology 39 (1997), 583-606. [10] L.M.G. Feijs, Generating FSMsfrom Interworkings, Distrib. Comput. 12 (1) (1999), 3 1 ^ 0 . [11] J. Grabowski, P. Graubmann and E. Rudolph, Towards a Petri net based semantics definition for Message Sequence Charts, SDL'93 - Using Objects, Proc. 6th SDL Forum, Darmstadt, O. Faergemand and A. Sarma, eds, North-Holland, Amsterdam (1993), 179-190. [12] ITU-T, Recommendation Z.120: Message Sequence Chart (MSC), ITU-T, Geneva (1993). [ 13] ITU-T, Recommendation Z. 120 Annex B: Algebraic semantics of Message Sequence Charts, ITU-T, Geneva (1995). [14] P.B. Ladkin and S. Leue, Interpreting message flow graphs. Formal Aspects of Computing 7 (5) (1995), 473-509. [15] J. de Man, Towards a formal semantics of Message Sequence Charts, SDL'93 - Using Objects, Proc. 6th SDL Forum, Darmstadt, O. Faergemand and A. Sarma, eds, North-Holland, Amsterdam (1993) 157-165.
1326
S. Mauw, M.A. Renters
[16] S. Mauw and E.A. van der Meulen, Generating tools for Message Sequence Charts, SDL'95 - with MSC in CASE, Proc. 7th SDL Forum, Oslo, R. Brack and A. Sarma, eds, North-Holland, Amsterdam (1995), 51-62. [17] S. Mauw and M.A. Reniers, An algebraic semantics of Basic Message Sequence Charts, Comput. J. 37 (4) (1994), 269-277. [18] S. Mauw and M.A. Reniers, An algebraic semantics of Message Sequence Charts, Technical Report CSN 94/23, Eindhoven University of Technology, Department of Computing Science, Eindhoven (1994). [19] S. Mauw and M.A. Reniers, Empty Interworkings and refinement - semantics of Interworkings revised. Technical Report CSR 95-12, Eindhoven University of Technology, Department of Computing Science (1995). [20] S. Mauw and M.A. Reniers, Empty Interworkings and refinement - semantics of Interworkings revised, ACP'95, Proc. Second Workshop on Algebra of Communicating Processes Computing Science Reports CSR 95/14, 3 Eindhoven University of Technology, Department of Computing Science (1995), 67-385. [21] S. Mauw and M.A. Reniers, Refinement in Interworkings, CONCUR'96, Pisa, Italy, Lecture Notes in Comput. Sci. 1119, U. Montanari and V. Sassone, eds. Springer-Verlag (1996), 671-686. [22] S. Mauw and M.A. Reniers, High-level Message Sequence Charts, SDL'97: Time for Testing - SDL, MSC and Trends, Proc. 8th SDL Forum, Evry, France, A. Cavalli and A. Sarma, eds. North-Hoi land, Amsterdam (1997), 291-306. [23] S. Mauw and M.A. Reniers, Operational semantics for MSC96, Computer Networks amd ISDN Systems 31 (17) (1999), 1785-1799. Special issue on Advanced topics on SDL and MSC, A. CavalH, ed. [24] S. Mauw, M. van Wijk, and T. Winter, Syntax and semantics of synchronous Interworkings, Technical Report RWB-508-re-92436, Information and Software Technology, Philips Research (1992). [25] S. Mauw, M. van Wijk and T. Winter, A formal semantics of synchronous Interworkings, SDL'93 - Using Objects, Proc. 6th SDL Forum, Darmstadt, O. Faergemand and A. Sarma, eds, North-Holland, Amsterdam (1993), 167-178. [26] S. Mauw and T. Winter, A prototype toolset for Interworkings, Philips Telecommunication Review 51 (3) (1993), 4 1 ^ 5 . [27] M.A. Reniers, An algebraic semantics of Message Sequence Charts, M.S. thesis. Department of Mathematics and Computing Science, Eindhoven University of Technology (1994). [28] M.A. Reniers, Message Sequence Chart: Syntax and semantics, Ph.D. thesis, Eindhoven University of Technology (1999). [29] A. Rensink and H. Wehrheim, Weak sequential composition in process algebras, CONCUR'94: Concurrency Theory, Lecture Notes in Comput. Sci. 836, Uppsala, B. Jonsson and J. Parrow, eds. Springer-Verlag (1994), 226-241. [30] E. Rudolph, P. Graubmann and J. Grabowski, Message Sequence Chart: Composition techniques versus OO-techniques - 'tema con variazioni', SDL'95 - with MSC in CASE, Proc. 7th SDL Forum, Oslo, R. Braek and A. Sarma, eds, North-Holland, Amsterdam (1995), 77-88. [31] J. Rumbaugh, I. Jacobson and G. Booch, The Unified Modeling Language Reference Manual, AddisonWesley (1999). [32] J.J. Vereijken, Discrete-time process algebra, Ph.D. thesis, Eindhoven University of Technology (1997). [33] C. Verhoef, A general conservative extension theorem in process algebra. Programming Concepts, Methods and Calculi (PROCOMET'94), IFIP Transactions A: Computer Science and Technology 56, E.-R. Olderog, ed., Elsevier Science B.V. (1994), 149-168. [34] C. Verhoef, A congruence theorem for structured operational semantics with predicates and negative premises, Nordic J. Comput. 2 (2) (1995), 274-302. [35] J.L.M. Vrancken, The algebra of communicating processes with empty process, Theoret. Comput. Sci. 177 (2) (1997), 287-328.
A process algebra for
Inter^'orkings
1327
Subject index alternative composition, 1272, 1274, 1276, 1277, 1288-1290, 1292, 1293, 1296, 1300, 1322 associativity, 1290, 1297, 1307, 1319 atomic action, 1280, 1300 causal order, 1274, 1276, 1278 communication, 1270-1274, 1278, 1281, 1282, 1324, 1325 commutativity, 1290, 1293, 1296, 1305, 1319, 1320 completeness, 1270, 1274, 1283-1285, 1287, 1288, 1290, 1292, 1295, 1296, 1302, 1305, 1318,1319, 1322 congruence, 1283, 1284, 1288, 1289, 1292-1294, 1296, 1302, 1317, 1318 conservativity, 1273, 1293, 1295, 1305, 1319, 1323 deadlock, 1278-1284, 1288-1290, 1294, 1302 deduction rule, 1280, 1281, 1283, 1288, 1300, 1301, 1314, 1324 -conclusion, 1280 delayed choice, 1276, 1277 f-interworking merge, 1273, 1300-1302, 13121314, 1322, 1324 elimination, 1284, 1291, 1295, 1304, 1318 empty entity, 1313 empty process, 1280, 1281, 1283, 1288, 1289, 1313 entity, 1271, 1274-1282, 1289, 1300, 1305, 1307, 1312-1314, 1316, 1317, 1322-1325 - active, 1281, 1282, 1288, 1293, 1301, 1313, 1314, 1319, 1324 -empty, 1278-1280, 1313, 1318, 1323 entity bisimulation, 1316-1319 equivalence, 1282, 1283, 1317 hypothesis, 1280 Interworking, 1271-1278, 1281, 1312, 1313, 1318, 1321-1325 -empty, 1275 Interworking diagram, 1270-1283, 1288, 1322 Interworking language, 1270-1273, 1276, 1321 interworking merge, 1273, 1307, 1312-1314, 1317, 1319, 1322-1324 interworking sequencing, 1272, 1273, 1276, 12801283, 1288, 1292-1294, 1296, 1297, 1314, 1317,1319, 1322-1324
ITU, 1272, 1273, 1324, 1325 IWD-bisimulation, 1282-1284, 1287-1290, 12921296, 1302, 1303, 1305, 1316-1319 left-merge, 1293, 1324 -£-interworking, 1301 merge-inconsistent, 1278, 1279 Message Flow Graphs, 1325 Message Sequence Chart, see MSC MSC, 1271-1273, 1276, 1322-1325 non-deterministic choice, 1276, 1277 operational semantics, 1270, 1274, 1280, 1281, 1283, 1293, 1300, 1314, 1322, 1324 parallel composition, 1272, 1274, 1277, 1297, 1305, 1322 partial deadlock, 1273, 1282, 1322 path format, 1283, 1289, 1294, 1295, 1302, 1305 Petri net, 1322, 1325 scenario, 1271, 1273, 1274, 1277, 1322, 1324 sequential composition, 1272-1276, 1288, 1289, 1292-1294, 1296, 1300, 1322 signature, 1280-1284, 1295, 1296, 1302, 1313, 1317, 1318 soundness, 1274, 1283, 1284, 1287-1289, 1292, 1294, 1295, 1302, 1303, 1305, 1318, 1322 strong bisimulation, 1282 strong sequential composition, 1276, 1322 synchronization, 1272, 1276 term, 1280 -basic, 1284, 1290, 1318 -closed, 1280 term deduction system, 1280-1283, 1289, 1294, 1295,1301, 1302, 1305 -pure, 1295, 1305 -well-founded, 1295, 1305 UML, 1272 Use Case, 1272 weak sequential composition, 1273, 1276
This Page Intentionally Left Blank
Author Index Roman numbers refer to pages on which the author (or his/her work) is mentioned. Italic numbers refer to reference pages. Numbers between brackets are the reference numbers. No distinction is made between first and co-author(s).
Aalst, W.M.P. van der 1273, 1325 [1] Abadi, M. 180, 190 [1]; 537, 539 [1] Abdulla, P.A.590,677[1] Abramsky, S. 48, 94, 95 [1]; 95 [2]; 199, 243, 252, 273-276, 279, 280 [1]; 280 [2]; 280 [3]; 702, 707 [1] Aceto, L. 88, 89, 95 [3]; 176, 190 [2]; 190 [3]; 199, 201, 217, 224, 238, 241-252, 270, 271, 274^278, 280, 280 [4]; 280 [5]; 280 [6]; 280 [7]; 280 [8]; 280 [9]; 280 [10]; 280 [11]; 280 [12]; 280 [13]; 337, 342, 346, 347, 355, 357, 360, 361, 363, 364, 370, 385 [1]; 385 [2]; 385 [3]; 385 [4]; 385 [5]; i85 [6]; i<^5 [7]; 385 [8]; 395, 425 [1]; 431, 475 [1]; 640, 681 [1]; 692, 707 [2]; 713, 719, 762 [1]; 795, 815, 832, 867 [1]; 908, 938, 939 [1]; 947-950, 955-957, 959, 960, 962, 963, 966, 977, 991, 1002, 1005, 1009, 1036,1037 [1]; 1037 [2]; 1037 [3]; 1037 [4]; 1037 [5]; 1037 [6]; 70i7 [7]; 1037 [8]; 1050, 1052, 1059, 1061, 1067, 1091, 1095, 1096, 1098-1100, 1108, 1109, 1141 [1]; 1141 [2]; 1141 [3]; 7747 [4]; 1141 [5]; 7747 [6]; 7747 [7]; 7747 [8]; 7747 [9]; 1222, 7265 [1] Ackermann, W.B. 190 [19] Aczel, P. 51, 95 [4]; 279, 280 [14] Agha, G. 536, 539 [2] Aitken,W. 265, 280 [15] Alfaro, L. de 706, 707 [9]; 708 [23]; 708 [24] Algayres,B. 1213, 7265 [2] Allen, S. 265, 280 [15]; 282 [66] Alpem, B. 161, 790 [4] Alur, R. 591, 677 [2]; 677 [3]; 1325, 7525 [2] Amadio, R.M. 539, 540 [3]; 948, 1011-1014, 1016-1019, 1021, 1025, 1026, 7057 [9]; 7057 [10]; 7057 [11]; 7057 [12] Andersen, H.R. 318, 321, 323, 327 [1]; 327 [2]; 757, 762 [2] Andre,Ch. 884, 940 [15]
Arden, D.N. 336, 385 [9] Arnold, A. 318, 327 [3]; 1261, 7265 [3] Astesiano, E. 537, 540 [4] Austry,D. 231, 280 [16] Azcorra, A. 674, 683 [39] Aziz, A. 706, 707 [3] Baader, F. 225, 280 [17]; 346, 385 [10] Back, R.J.R. 120, 176, 790 [5]; 790 [6]; 790 [7]; 790 [8]; 1059, 7747 [10] Backus, J. 205, 280 [18] Badouel, E. 237, 242, 279, 280 [19]; 280 [20]; 950, 954, 7057 [13] Baeten, J.C.M. 8, 28, 74, 88, 89, 93, 95 [5]; 95 [6]; 95 [7]; 134, 790 [9]; 199, 207, 208, 217, 222, 223, 228, 231, 233, 235, 243, 245, 248, 280 [21]; 280 [22]; 280 [23]; 280 [24]; 280 [25]; 287 [26]; 287 [27]; 287 [28]; 338, 342, 344-347, 364, 375, 381, 383-385, 385 [11]; 385 [12]; 385 [13]; 385 [14]; 385 [15]; 393, 423 [2]; 549, 566, 677 [4]; 677 [5]; 629-632, 637, 641, 643, 645, 652, 660, 661, 666, 673, 674, 687 [2]; 687 [3]; 687 [4]; 687 [5]; 687 [6]; 687 [7]; 687 [8]; 687 [9]; 687 [10]; 682 [11]; 713, 714, 754, 755, 758, 762 [3]; 762 [4]; 762 [5]; 762 [6]; 762 [7]; 771-773, 783, 789, 793, 795, 804, 807, 809, 815, 831, 832, 835, 837, 852, 853, 866, 867 [2]; 867 [3]; 867 [4]; 867 [5]; 867 [6]; 876, 881, 911, 931, 940 [2]; 940 [3]; 940 [4]; 950, 978, 1010, 7057 [14]; 1052, 1061, 1067, 1077, 1108, 7747 [11]; 1153, 1170, 1174, 1188, 7206 [8]; 1211, 1213-1217, 1221, 1224, 1227, 1228, 1260, 7265 [4]; 7265 [5]; 7265 [6]; 7265 [7]; 7265 [8]; 7265 [9]; 1276, 1280, 1283, 1288, 1289, 1297, 1302, 7525 [3]; 7525 [4]; 7525 [5]; 7525 [6] Baier, C. 698, 706, 707, 707 [4]; 707 [5]; 707 [6]; 707 [7]; 707 [8]
1329
1330
Author Index
Bakker, J.W. de 6, 8, 51, 95 [8]; 95 [9]; 110, 120, 190 [10]; 190 [11]; 199, 281 [29]; 281 [30] 327 [4]; 1050, 1051, 1055-1057, 1071,1141 [12]; 1141 [13]; 1144 [83]; 1153, 7206 [11] Balarin, F. 706, 707 [3] Banieqbal, B. 327 [5] Bar-Hillel, Y. 548, 565, 677 [6] Barendregt, H.P. 264, 265, 281 [31]; 1109, 77^7 [14]; 1165, 7205 [1] Barrett, G. 713, 748, 762 [8] Barringer, H. 327 [5]; 327 [6] Basten, T. 255, 281 [32]; 758, 762 [4]; 773, 796, 811, 817, 820, 827, 828, 830, 867, 867 [8]; 867 [9]; 867 [10]; 876, 940 [2]; 1069, 1141 [15] Bauer, F.L. 147, 790 [12]; 790 [13] Bednarczyk, M. 950, 1005, 70i7 [15]; 70i7 [16] Bekic, H. 316, 327 [7]; 1153, 7205 [3] Belina, F. 1211, 7265 [10] Ben-Abdallah, H. 422, 424 [27] Ben-Ari, M. 595,677[7] Bendix, P.B. 346, 387 [54] Berge, C. 607,677[8] Bergstra, J.A. v, viii [1]; 8, 22, 28, 74, 75, 87, 89, 95 [6]; 95 [10]; 95 [11]; 104, 134, 790 [9]; 790 [14]; 790 [15]; 790 [16]; 790 [17]; 199, 208, 222, 223, 225, 227, 233, 235, 238, 245, 247-250, 262, 280 [22]; 280 [23]; 280 [24]; 280 [25]; 281 [33]; 281 [34]; 281 [35]; 281 [36]; 287 [37]; 281 [38]; 281 [39]; 281 [40]; 281 [41]; 336-338, 345-347, 359, 360, 363-365, 372, 374, 375, 381-383, 385 [11]; 385 [12]; 385 [16]; 386 [17]; 386 [18]; 386 [19]; 386 [20]; 386 [21]; 386 [22]; i86 [23]; 386 [24]; 393, 42i [2]; 549, 553, 565, 566, 677 [4]; 677 [5]; 677 [9]; 629-632, 641, 643, 645, 652, 660, 661, 666, 673, 674, 687 [2]; 687 [3]; 687 [4]; 687 [5]; 687 [6]; 687 [7]; 687 [8]; 682 [12]; 682 [13]; 682 [14]; 713-715, 748, 754, 755, 762 [5]; 762 [9]; 762 [10]; 772, 773, 783, 786, 787, 804, 807, 809, 823, 831, 846, 852, 853, 866, 867 [3]; 867 [4]; 867 [11]; 868 [12]; 868 [13]; 868 [14]; 939, 940 [5]; 950,1037 [17]; 1071, 7747 [16]; 1153, 1186, 7206 [6]; 7206 [7]; 1212-1215, 1217, 1221, 1226-1229, 1260, 1261, 7265 [4]; 7265 [5]; 7265 [6]; 7265 [11]; 7265 [12]; 7265 [13]; 7266 [14]; 7266 [15]; 7266 [16] Bernardo, M. 754, 755, 762 [11]; 1059, 1078, 1100, 7742 [23] Bernstein, K, 269, 287 [42] Berry, G. 200, 201, 287 [43]; 538, 540 [5]; 713, 714, 749, 754, 755, 762 [12]; 762 [13]; 1017, 1023, 70i7[18] Berthelot,G. 884, 940 [15] Best, E. 757, 762 [14]; 762 [15]; 783, 820, 866, 868 [15]; 868 [16]; 868 [17]; 868 [18]; 876, 877,
884, 899, 903, 904, 908, 912, 918, 937, 939, 940 [6]; 940 [7]; 940 [8]; 940 [9]; 940 [10]; 940 [11]; 940 [12]; 940 [13]; 941 [37]; 955, 70i7[19]; 1052,7747 [17] Bethke, I. 238, 287 [33]; 336, 337, 346, 359, 360, 363, 365, 372, 374, 375, 385 [16]; 386 [17]; 786, 787, 823, 867 [11] Bezem, M.A. 1154, 1173, 1175, 1197, 7205 [2]; 7205 [4]; 7205 [5] Bhat, G. 713, 714, 753, 754, 756, 758, 762 [16] Bianco, A. 706, 707 [9] BirtwistlcG. 592, 622 [120] Bloom, B. 8, 41, 49, 90, 93, 95 [12]; 199, 201, 203, 207, 209, 211, 215, 217, 227, 228, 230, 237, 238, 243-255, 258, 259, 262, 263, 269, 270, 279, 280, 280 [6]; 280 [7]; 280 [8]; 287 [44]; 287 [45]; 287 [46]; 287 [47]; 287 [48]; 287 [49]; 287 [50]; 282, 282 [51]; 282 [52]; 282 [53]; 282 [54]; 282 [55]; 283 [74]; 283 [75]; 289 [232]; 1067, 7747 [4]; 7742 [18] Bloom, S.L. 336, 386 [25]; 386 [26] Blute, R. 704, 705, 707, 707 [10] Boer, F.S.de790[18] Bol, R.N. 209, 211, 214, 217, 229, 282, 282 [56]; 282 [57]; 638, 640, 682 [15]; 1154, 7205 [2] Bolognesi, T. 199, 282 [58]; 393, 423 [3]; 714, 762 [17] Booch, G. 1272, 7i26[31] Boreale, M. 538, 540 [6]; 540 [7]; 1024, 1025, 70i7 [20] Borgia, R. 537, 540 [8] Bos, S.H.J. 673, 682 [16] Boselie, J. 365, 386 [27] Bosscher, D.J.B. 249, 282 [59]; 336, 386 [28] Bouajjani, A. 593, 598, 599, 606, 607, 612, 615, 616, 677 [11]; 677 [12]; 677 [13] Bouajjani, R. 593, 601, 612, 615, 677 [10] Bouali, A. 404, 407, 422, 423 [4]; 423 [5] Boudol, G. 231, 280 [16]; 538, 540 [5]; 540 [9]; 540 [10]; 748, 762 [18]; 866, 868 [19]; 868 [20]; 876, 940 [14]; 947-954, 956-961, 964, 968, 973-975, 977, 979, 980, 986, 991, 995-997, 999-1001, 1003, 1007, 1011, 1013, 1016-1019, 1021, 1023, 1031, 1034, 1035, 70J7 [10]; 70i7 [18]; 70i7 [21]; 70i7 [22]; 70i7 [23]; 70i7 [24]; 70i7 [25]; 70i7 [26]; 70i7 [27]; 70i7 [28]; 1038 [29]; 1038 [30]; 1050-1052, 1071, 1078, 1093, 7742 [19]; 7742 [20]; 7742 [21] Bouziane, Z. 613, 678[14] Bradfield, J.C. 304, 311-313, 318, 319, 321, 327 [8]; 327 [9]; 327 [10]; 327 [11]; 327 [12]; 327 [13]; 591, 592, 598, 610, 678 [15]; 678 [16]; 678 [17]; 687,704, 707 [11]; 715, 762 [19] Brams,G.W. 884, 940 [15]
Author Index Brand, M. van de 225, 282 [60] Brauer, W. 1050, 1142 [22] Bravetti, M. 757, 762 [20]; 1036, 1038 [31]; 1059, 1078, 1100, 1104, 1142 [23]; 1142 [24]; 1142 [25] Brayton, R.K. 706, 707 [3] Bremonde-Gregoire, P. 713-715, 730, 754, 762 [21]; 762 [22]; 762 [23] Brink, J. van den 674, 682 [17]; 1324, 1325 [7] Brinksma, E. 393, 423 [3]; 707, 708 [21]; 708 [22]; 714, 762 [17]; 1058, 77^2 [26] Brock, J.D. 79(? [19] Bromley, H. 265, 282 [66] Brookes, S.D. v, viii [2]; 8, 22, 32, 95 [13]; 95 [14]; 97 [46]; 158, 790 [20]; 235, 237, 282 [61]; 429, 476 [2]; 629, 682 [18]; 1057, 1099, 1129, 1142 [27] Brown, G. 201, 289 [232] Browne, A. 317, i28 [43] Broy, M. 169, 172, 173, 176, 180, 181, 190 [21]; 797 [22]; 797 [23]; 797 [24]; 797 [25]; 797 [26]; 797 [27]; 797 [28]; 1059, 77'^2 [28]; 1142 [29]; 1259, 7266 [17] Bruns, G. 448, 476 [3]; 876, 940 [16] Bryant, R.E. 254, 282 [62]; 404, 405, 423 [6]; 423 [7] Buchi, J.R. 296, 327 [14]; 579, 601, 618 [18]; 618 [19] Burch, J.R. 547, 618 [20] Burkart, O. 322, 327 [15]; 327 [16]; 561, 566, 578, 589, 603, 605-609, 616, 617, 618 [21]; 618 [22]; 618 [23]; 618 [24]; 618 [25]; 618 [26]; 675 [27]; 618 [28]; 678 [29] Busi,N. 1050, 1052, 1061, 1085, 1087, 1098-1100, 77^2 [30]; 7742 [31] Camilleri, J. 713, 714, 731, 741-747, 763 [24] Cardelli, L. 537, 540 [11]; 949, 1013, 1014, 1026-1028, 1038 [32]; 1038 [33]; 1038 [34] Carriero, N. 1033,1038 [35]; 1038 [36] Castagna, G. 949, 1013, 1014, 1028, 1030, 1042 [160]; 1042 [\6\] Castellani, I. 539, 540 [3]; 748, 762 [18]; 763 [25]; 866, 868 [19]; 876, 940 [14]; 940 [17]; 947-954, 956-964, 966-968, 973-975, 977-981, 985, 986, 991,995-997,999-1003, 1005, 1007, 1013, 1016, 1018, 1026, 1035, 1037 [11]; 1037 [23]; 1037 [24]; 70i7 [25]; 1037 [26]; 70i7 [27]; 1037 [28]; 70J8 [29]; 70i8 [37]; 1038 [38]; 7038 [39]; 1038 [40]; 1078, 1093, 7742 [20]; 7742 [21] Castellano, L. 955,1038 [41]; 1052, 1054, 1093, 7742 [32] Caucal, D. 322, 327 [15]; 348, 386 [29]; 551, 552, 554, 561, 566, 576, 578, 580, 582, 589, 606, 608, 618 [23]; 678 [24]; 678 [30]; 678 [31]; 678 [32]; 678 [33]; 678 [34] Celikkan, U. 411, 416,423 [8]; 423 [9] Cerans, K. 590,677[1]
1331
Chandy, K.M. 137, 797 [29]; 792 [65]; 1154, 7206 [9] Chen, L. 630, 674, 682 [19] Cheng, A. 253, 282 [52] Cherief, F. 1059, 1069, 7742 [33]; 7742 [34] Choi, J.-Y. 730, 762 [21] Christensen, S. 553, 565, 566, 569, 589, 678 [35]; 678 [36]; 678 [37]; 678 [38]; 678 [39]; 820, 869 [40]; 1035, 70i8 [42]; 70i8 [43]; 70i8 [44] Christoff, I. 700, 706, 707 [12]; 708 [13]; 708 [14]; 713, 727, 758, 764 [65] Christoff, L. 700, 706, 708 [13]; 708 [14]; 713, 727, 758, 764 [65] Clark, K. 215, 216, 282 [63] Clarke, E.M. vi, ix [3]; 298, 300, 301, 317, 327 [17]; 327 [18]; 328 [22]; 328 [43]; 329 [61]; 547, 550, 592, 595, 596, 611, 616, 678 [20]; 679 [40]; 679 [41]; 679 [42]; 622 [135]; 706, 707 [7]; 708 [15]; 708 [16] Cleaveland, R. 199, 241, 265, 282 [64]; 282 [65]; 282 [66]; 408, 411, 416, 422, 423 [9]; 423 [10]; 423 [11]; 423 [12]; 476 [4]; 598, 604, 605, 679 [43]; 679 [44]; 679 [45]; 687, 692, 695, 700, 706, 708 [17]; 708 [18]; 709 [49]; 709 [53]; 713-715, 719, 720, 723, 725-727, 731, 732, 736, 747, 753-758, 762 [16]; 763 [26]; 763 [27]; 763 [28]; 763 [29]; 763 [30]; 764 [56]; 764 [65]; 7742 [35] Coenen, J. 797 [30] Constable, R. 265, 280 [15]; 282 [66] Conway, J.H. 336, 356, 386 [31] Copi, I.M. 335, 336, 384, 386 [30] Corradini, F. 337, 347, 386 [32]; 386 [33]; 386 [34]; 674, 682 [20]; 947, 948, 956, 959, 995, 997, 999, 1000, 1009-1013, 70i8 [46]; 70i8 [47]; 70i8 [48]; 1038 [49]; 70i8 [50] Costantini, R. 1059, 7742 [36] Courcelle, B. 272, 282 [67]; 608, 679 [46] Courcoubetis, C. 416, 423 [13]; 591, 677 [2]; 706, 708 [19] Courtiat, J.R 1050, 1099, 7742 [37] Cremer, J. 265, 282 [66] Crvenkovic, S. 355, 386 [35] Czaja, I. 1050, 1054, 7742 [38] Da-Wei Wang 792 [78] Dam, M. 309, 327 [19]; 601, 611, 613, 679 [47] D'Argenio, RR. 217, 223, 282 [68]; 282 [69]; 691, 692, 707, 708 [20]; 708 [21]; 708 [22] Darondeau, Ph. 8, 22, 95 [15]; 237, 238, 242, 280 [20]; 282 [70]; 948, 950, 953-955, 958-960, 971, 991, 994, 995, 1003, 1005, 70i7 [13]; 70i8 [51]; 70i8 [52]; 1038 [53]; 1050, 1052, 1054, 1055, 1069, 1094, 1095, 7742 [39]; 7742 [40]; 7742[41];774i[42]
1332
Author Index
Davey, B.A. 902, 9^6>[18] Elgot, C.C. 335, 336, 384, 386 [30] Davidson, S. 713, 714, 754, 762 [22] Ellsberger, J. 1211, 7266 [18] Davies, J. 674, 682 [21]; 748, 763 [31] Emde-Boas, R van 137, 193 [96] Dayar, Z. 700, 709 [53] Emerson, A. 205, 283 [76] De Cindio, F. 950,1038 [45] Emerson, E.A. vi, ix [3]; 295, 298-301, 304, 312-314, De Francesco, N. 243, 282 [71] 316, 318, 327 [17]; 327 [18]; 328 [21]; 328 [22]; de Frutos, D. 674, 683 [39] 328 [23]; 328 [24]; 328 [25]; 329 [68]; 592, 595, De Michelis, G. 950, 955,1038 [41]; 1038 [45]; 1052, 596, 598, 679 [40]; 679 [41]; 679 [49]; 679 [50]; 1054, 1093,1142 [32] 706, 708 [15]; 708 [16] de Morgan, A. 303, 327 [20] Enders, R. 254, 283 [77] De Nicola, R. 8, 22, 56-59, 85, 95 [16]; 95 [17]; Engberg, U. 537, 540 [12]; 1007, 70i9 [64]; 1050, 97 [49]; 158, 797 [31]; 258, 270, 282 [72]; 337, 1052, 1092, 1093, 1099, 7747 [5]; 7745 [110] 347, 386 [32]; 386 [33]; 386 [34]; 476 [5]; 538, Engelfriet, J. 66, 95 [18] 540 [7]; 700, 708 [25]; 866, ,^65 [21]; 876, Engelhardt, K. 176, 792 [80] 940 [19]; 948, 950, 952-956, 958, 959, 995, 997, Engels,A. 1325, 7i25 [8] 999-1001, 1013, 1033, 1038 [47]; 1038 [48]; Esik, Z. 336, 355, 386 [25]; 386 [26]; 386 [35] 1038 [50]; 70i5 [54]; 1038 [55]; 7(?J9 [56]; Esparza, J. 311, 327 [12]; 589, 590, 602, 607, 609, 1039 [59]; 70i9 [60]; 7039 [61]; 1041 [120]; 610, 612-614, 616, 617, 677 [12]; 678 [25]; 7047 [121]; 1055, 1057, 1078, 1088, 1095, 1099, 679 [51]; 679 [52]; 679 [53]; 679 [54]; 679 [55]; 1129,1143 [43]; 1143 [45]; 1143 [46]; 774i [47] 679 [56]; 679 [57]; 876, 940 [16]; 1052, 7747 [17] Degano, P. 218, 282 [73]; 537, 540 [8]; 757, 76i'[32]; 866, 868 [21]; 876, 940 [19]; 948, 950, 952-955, 958-960, 971, 991, 994, 995, 1000, 1001, 1003, Pages, F 211, 28i [78] 1005, 1038 [51]; 1038 [52]; 1038 [53]; 1038 [54]; Feijs, L.M.G. 1324, 1325 [9]; 1325 [10] 1038 [55]; 70i9 [56]; 1039 [57]; 70i9 [58]; Felleisen,M. 201, 289 [234] 70i9 [59]; 1039 [60]; 70J9 [61]; 70i9 [62]; Felty, A. 1154, 7206 [12] 1050-1052, 1054-1056, 1061, 1069, 1071, 1078, Fernandez, C. 783, 868 [17] 1088, 1094, 1095, 7742 [39]; 7742 [40]; 7742 [41]; Fernandez, J.-C. 241, 283 [79]; 422, 424 [14]; 1190, 774i [42]; 774i [45]; 774i [46]; 774i [47]; 7206 [15] 774i [48]; 1143 [49]; 1143 [50]; 774i [51] Ferrari, G. 539, 540 [13]; 540 [14]; 950, 954, 959, Derman, C. 687, 691, 708 [27] 978, 1000, 1013, 1033, 1039 [65]; 70i9 [66]; Deshamais, J. 704, 705, 707, 707 [10]; 708 [28]; 70i9 [67]; 70i9 [68]; 7047 [120]; 7047 [121] 708 [29]; 708 [30]; 708 [31] Fidge, C.J. 713, 748, 763 [33] Devillers, M.C.A. 1191, 7206 [13] Filkom, T. 254, 283 [77] Devillers, R. 757, 762 [14]; 820, 866, 868 [15]; Fischer,!. 1260, 7266 [19] 868 [16]; 876, 877, 884, 899, 903, 904, 908, 912, Fischer, M.J. 298-300, 328 [26] 918, 937, 940 [8]; 940 [9]; 940 [10]; 940 [11]; Hoyd, R.W. 328 [27]; 592, 679 [58] 940 [20]; 940 [21]; 940 [22]; 955, 1037 [19]; Fokkink, W.J. 88, 89, 95 [3]; 134, 790 [14]; 217-220, 70i9 [63]; 1050, 1052, 1069, 7747 [17]; 774i [52] 224, 225, 228-231, 238, 255, 256, 258-261, 264, Dickson, L.E. 551, 679 [48] 265, 269, 270, 280 [9]; 287 [34]; 282 [53]; 283, Dietz, C. 866, 868 [22] 283 [80]; 283 [81]; 283 [82]; 283 [83]; 283 [84]; Dijkstra, E.W. 145, 797 [32]; 774, 868 [23] 283 [85]; 283 [86]; 283 [87]; 336, 337, 342, 346, Dill, D.L. 797 [33]; 547, 678 [20] 347, 350, 354, 355, 357, 359-361, 364, 370, Dolinka, I. 355, 386 [35] 385 [1]; 385 [2]; 385 [3]; 385 [4]; 385 [5]; 385 [6]; D'Ortenzio, D. 674, 682 [20] 386 [36]; 386 [37]; 386 [38]; 386 [39]; 386 [40]; Dowek,G. 1154, 7206 [12] 386 [41]; 386 [42]; 386 [43]; 387 [44]; 395, Dsouza, A. 237, 253, 254, 282 [52]; 283 [74]; 283 [75] 423 [1]; 431, 475 [1]; 640, 645, 647, 648, 687 [1]; 682 [22]; 682 [23]; 682 [24]; 692, 707 [2]; 713, Echague Zappettini, J.V. 1059, 1143 [53] 719, 762 [1]; 783, 787, 793, 795, 804, 809, 815, Echahed, R. 593, 598, 599, 601, 606, 612, 615, 823, 832, 835, 846, 867 [1]; 868 [12]; 868 [24]; 677 [10]; 677 [11] 868 [25]; 881, 908, 938, 939, 939 [1]; 940 [5]; Edalat, A. 704, 705, 707, 707 [10]; 708 [28]; 708 [29]; 940 [23]; 950, 7037 [6]; 1067, 7747 [6]; 1222, 708 [30] 1261, 7265 [1]; 7265 [12]; 7265 [13] Ehrig,H. 1162, 7206 [14]
Author Index Foumet,C. 537,540[15];949, 1011, 1013, 1014, 1022, 1024-1026, 1037 [20]; 1039 [69]; 1039 [70]; 1039 [11], 1039 [12] Fr^czak,W. 876, 940 [12] Francez, N. 429, 476 [6]; 713, 763 [34] Fredlund, L.-A. 1154, 1186, 1206 [16] Gammelgaard, A. 1260, 1266 [20] Garavel, H. 422, 424 [14]; 424 [[5]\ \ 190, 1206 [15] Gay, SJ. 538, 540 [16] Gelder, A.v. 212, 283, 283 [88]; 283 [89] Gelemter, D. 1033, 1038 [35]; 7055 [36] Gelfond, M. 211,2<Si[90] Genrich, H.J. 884, 940 [24] Gentzen, G. 254,25i[91] Gerber, R. 713, 715, 730, 754, 762 [23]; 763 [35]; 763 [36] Germain, F 1034, 1038 [30] German, S.M. 756, 763 [37] Gerth,R. 1059, 1143 [54] Ghelli, G. 1027, /OiS [32] Giacalone, A. 687, 694, 695, 708 [32]; 1011, 1014, 1016, 1042 [157] Girault, C. 884, 940 [15] Gischer, J.L. 867, 868 [26]; 951, 1002, 1039 [73]; 1091, 1143 [55] Glabbeek, R.J. van 3, 51, 95, 96 [19]; 96 [20]; 96 [21]; 96 [22]; 109, 191 [34]; 202, 204, 207, 209, 211-214, 218, 224, 228-231, 234-237, 248, 254, 255, 258, 259, 264, 280 [9]; 282 [53]; 283, 283 [83]; 283 [92]; 283 [93]; 25i [94]; 283 [95]; 284, 254 [96]; 284 [97]; 254 [98]; 284 [99]; 254 [100]; 254 [101]; 254 [102]; 254 [103]; 254 [104]; 337, 342-344, 346, 347, 356, 361, 364, 365, 385 [2]; 385 [13]; 386 [43]; 387 [45]; 387 [46]; 387 [47]; 557 [48]; 557 [49]; 393, 395, 408, 424 [16]; 424 [17]; 431, 432, 476 [7]; 566, 6/9 [59]; 687, 691, 700, 705 [33]; 754, 755, 765 [76]; 772, 777, 866, 565 [27]; 565 [28]; 565 [29]; 565 [30]; 948, 950, 953, 955, 956, 958, 984, 1005, 7059 [74]; 7059 [75]; 7059 [76]; 7059 [77]; 7059 [78]; 7059 [79]; 7059 [80]; 7059 [81]; 1050, 1052-1055, 1059, 1061, 1068, 1069, 1081, 1083-1085, 1087, 1091, 1093, 1095, 1096, 1098-1100, 1124, 1131, 7742 [31]; 7742 [38]; 1143, 7745 [56]; 7745 [57]; 7745 [58]; 7745 [59]; 7745 [60]; 7/45 [61]; 7/45 [62]; 7745 [63]; 1144 [64]; 1144 [65]; 1144 [66]; 7744 [67]; 7744 [68]; 1153, 1169, 1170, 7207 [49]; 7207 [50] Godskesen, J.C. 1260, 7266 [21]; 1266 [24] Goguen,J. 276,254[105] Gold, R. 1050, 1142 [22] Goltz, U. 866, 565 [31]; 876, 881, 884, 911, 940 [25]; 940 [26]; 940 [27]; 941 [28]; 948, 950, 953, 955,
1333
956, 958, 984, 1005, 1039 [75]; 1039 [76]; 1039 [77]; 1039 [78]; 1039 [79]; 7059 [82]; 7040 [83]; 7040 [84]; 7040 [85]; 7040 [105]; 1050, 1052-1055, 1081, 1083-1085, 1087, 1088, 1091, 1093, 1095, 1098, 1107, 1110, 1113, 1115, 1126, 1131, 1142 [38]; 1143, 1143 [60]; 1143 [61]; 1143 [62]; 1143 [63]; 1144 [64]; 1144 [69]; 1144 [10]; 1145 [\02] Gonthier, G. 537, 540 [15]; 713, 749, 754, 755, 762 [13]; 949, 1011, 1013, 1014, 1022, 1025, /059 [70]; /059 [71] Gordon, A. 264, 254 [106] Gordon, A.D. 537, 559 [1]; 540 [11]; 949, 1013, 1014, 1026-1028, /055 [32]; /055 [33]; /055 [34] Gorrieri, R. 754, 755, 757, 762 [11]; 762 [20]; 950, 955, 956, 978, 1000, 1036, /055 [31]; 7059 [57]; 7059 [66]; 7040 [86]; 1040 [87]; 1050-1052, 1054, 1056, 1058, 1059, 1061, 1071, 1072, 1078, 1095, 1098-1100, 1104, 1107, 1110, 1113, 1115, 1129-1131, 1136, 1138, 1140, /742 [23]; 1142 [24]; 7742 [25]; 7/42 [31]; 1143 [48]; 1143 [49]; 1143 [50]; 1143 [51]; 1144 [69]; 1144 [71]; 1144 [72]; 1144 [73]; 7744 [74]; 1144 [75]; 1144 [76]; 1144 [77]; 1144 [78]; 1146, //46 [123]; //46 [124] Grabowski, J. 867, 565 [32]; 884, 941 [29]; 951, 1002, /040 [88]; 1091, 1144 [19]; 1323, 1325, /525 [11]; 1326 [30] Grahlmann, B. 820, 565 [18] Graubmann, R 1323, 1325, 1325 [11]; 1326 [30] Gries, D. 137, 193 [91]; 243, 256 [168] Griffioen, W.O.D. 674, 652 [17]; 1191, 1206 [13]; 1324,/525 [7] Griffor, E. 273,255[210] Groote, J.F 8, 45, 46, 78, 93, 96 [23]; 96 [24]; 96 [25]; 199, 200, 204, 207, 209, 211, 214^218, 227, 229, 230, 238, 258, 263, 264, 270, 282, 252 [56]; 252 [57]; 284, 254 [107]; 254 [108]; 254 [109]; 254 [110]; 254 [111]; 337, 342, 346, 363, 555 [7]; 557 [50]; 408, 424 [18]; 436, 475, 476 [8]; 476 [9]; 476 [10]; 476 [11]; 566, 619 [60]; 619 [61]; 638, 640, 652 [15]; 652 [25]; 867, 565 [33]; 565 [34]; 1067, 1124,7744 180]; 7/44 [81]; 1154, 1156, 1159, 1168, 1172, 1173, 1175, 1176, 1178, 1180, 1186, 1197, 1205 [2]; 1205 [4]; 1205 [5]; 1206 [16]; 1206 [17]; 1206 [18]; 1206 [19]; 1206 [20]; 1206 [21]; 1206 [22]; 1206 [23]; 1206 [24]; 1206 [25]; 1206 [26]; 1258, 1260, 1266 [22] Grumberg, O. 550, 619 [42] Guessarian, I. 271, 272, 274, 276, 254 [112]; //44 [82] Gunter, C.A. 120, 191 [35]; 200, 254 [113]
1334
Author Index
Gupta, V. 107, 708 [31] Gurevich, Y. 296, 328 [28] Habermehl, R 593, 601, 612, 614, 615, 677 [10]; 677 [13]; 679 [62] Hack, M. 548, 619 [63] Halbwachs, N.591,677[2] Hall, J.G. 820, 866, 868 [15]; 876, 940 [9]; 941 [30] Hankin, C. 243, 280 [2] Hansel, D. 612, 679 [54] Hansen, M.R. 1260, 1266 [24] Hansson, H. 687, 691, 706, 708 [34]; 708 [35]; 708 [36]; 713, 730, 732, 747, 763 [38] Hantz, F. 1213, 7265 [2] Harel, D. 797 [36]; 328 [29]; 754, 755, 763 [39] Harper, R. 200, 264, 265, 282 [66]; 286 [161] Harrington, L. 296, 328 [28] Hartel, R207,25^[114] Hartog, J.I. den 1055, 1056, 1144 [83] Hartonas Garmhausen, V. 706, 707 [7] He, J. 117, 185, 797 [37] Hebermehl, R614,679[64] Hee, K.M. van 820, 867, 869 [35] Hennessy, M. 8, 22, 38, 52, 53, 85, 95 [17]; 96 [26]; 96 [27]; 96 [28]; 158, 176, 790 [3]; 797 [31]; 797 [38]; 199, 200, 205, 242, 244, 251, 252, 254, 258, 264, 270-274, 276-279, 280 [10]; 282 [64]; 282 [72]; 284 [115]; 284 [116]; 284 [117]; 284 [118]; 284 [119]; 285, 285 [120]; 285 [121]; 285 [122]; 285 [123]; 285 [124]; 285 [125]; 285 [126]; 296, 298, 328 [30]; 337, 387 [51]; 407, 408, 423 [10]; 424 [19]; 429, 453-455, 457, 459, 464-467, 475, 476 [5]; 476 [12]; 476 [13]; 476 [14]; 476 [15]; 476 [16]; 476 [17]; 476 [18]; 476 [19]; 476 [20]; 476 [21]; 477 [43]; 538, 540 [17]; 592, 594, 679 [65]; 674, 682 [26]; 700, 704, 708 [25]; 705 [37]; 713, 714, 719, 720, 725-727, 748, 758, 762 [18]; 763 [26]; 763 [40]; 763 [41]; 947-949, 953, 955-961, 964, 973-975, 977-979, 986, 991, 995-997, 999, 1000, 1003, 1007, 1011-1014, 1016, 1018-1020, 1024, 1025, 1035, 1037 [7]; 1037 [8]; 1037 [28]; 1038 [29]; 70J5 [39]; 1040 [89]; 7040 [90]; 7040 [91]; 7040 [92]; 7040 [93]; 7040 [101]; 7047 [140]; 7047 [141]; 7047 [142]; 1050, 1052, 1057, 1061, 1068, 1096, 1098-1100, 1108, 1109, 1129, 1131, 7747 [7]; 7747 [8]; 7747 [9]; 1143 [43]; 7744 [84]; 7 744 [85]; 7 744 [86]; 7 744 [87] Henzinger, T.A. 591, 677 [2]; 677 [3] Herbelin, H. 1154, 7206 [12] Hermanns, H. 691, 692, 707, 707 [6]; 707 [8]; 708 [20]; 708 [38]; 754, 755, 757, 763 [42]; 763 [43]
Hesketh, M. 876, 930, 947 [31] Hewitt, C. 536, 540 [18] Hillebrand, J.A. 359, 386 [18]; 673, 682 [27]; 1186, 7206 [6] Hillston, J. 707, 709 [39] Hirshfeld, Y. 565, 566, 571, 573, 574, 576, 586, 589, 618 [36]; 678 [37]; 620 [66]; 620 [67]; 620 [68]; 620 [69]; 620 [70]; 620 [71]; 620 [72]; 1035, 1038 [44] Ho, RH. 591, 677 [2] Hoare, C.A.R. v, v/7/ [2]; 7, 8, 14, 21, 22, 32, 81, 86, 88, 89, 93, 95 [13]; 96 [29]; 96 [30]; 96 [31]; 96 [40]; 104, 106, 114, 117, 137, 150, 157, 158, 176, 185, 190 [20]; 797 [37]; 797 [39]; 797 [40]; 797 [41]; 191 [42]; 797 [43]; 192 [70]; 193 [94]; 235, 237, 243, 264, 270, 282 [61]; 285 [127]; 285 [131]; 328 [31]; 393, 422, 424 [20]; 429, 476 [2]; 476 [22]; 476 [23]; 629, 682 [18]; 682 [28]; 713, 715, 747, 748, 758, 763 [44]; 783, 793, 869 [36]; 877, 947 [32]; 1057, 1077, 1096, 1098, 1099, 1108, 1129, 7742 [27]; 7744 [88]; 7745 [113]; 1153, 7206 [27]; 1260, 7266 [30] Hogrefe, D. 1211, 7265 [10]; 7266 [18] Holla, M. 820, 869 [40] Hollenberg, M.J. 53, 96 [32] Holzmann, G.J. 611, 620 [73]; 1196, 7206 [28]; 1325, 1325 [2] Honda, K. 538, 540 [19]; 542 [55]; 1011, 1017, 1023, 1031, 7040 [94] Hopcroft, J.E. vi, ix [4]; 91, 96 [33]; 152, 797 [44]; 548, 551, 576, 620 [74]; 627 [95] Hopkins, R.R 876, 940 [12] Howe, D. 265, 269, 280 [15]; 282 [66]; 285 [128] Huber, R 820, 869 [40] Huet, G. 1154, 1206 [\2] Hugonnet, F. 1213, 7265 [2] Huhn,M. 1050, 1052, 1059, 1061, 1117, 1127, 1128, 7744 [89]; 7744 [90] Hungar, H. 605, 606, 609, 620 [75]; 620 [76]; 620 [77]; 620 [78] Hungerford, T.W. 797, 869 [37] Huttel, H. 93, 96 [24]; 328 [32]; 565, 566, 569, 618 [38]; 675 [39]; 679 [61]; 620 [79]; 620 [80] Huynh, D.T. 566, 620 [81]; 620 [82] Hwang, L.J. 547, 678 [20] Ingolfsdottir, A. 199, 224, 250-252, 264, 270, 271, 274-278, 280, 280 [9]; 280 [11]; 280 [12]; 280 [13]; 285 [120]; 285 [121]; 285 [129]; 337, 355, 357, 361, 364, 385 [2]; 385 [3]; 385 [4]; 385 [5]; 385 [8]; 429, 434, 475, 476 [14]; 476 [15]; 476 [24] Inverardi, R 243, 282 [71]; 674, 682 [20]
Author Index Istrail, S. 8, 41, 49, 90, 93, 95 [12]; 199, 203, 207, 209, 211, 215, 227, 230, 237, 238, 251, 253, 263, 282, 282 [54]; 282 [55]; 1067, 1142 [18] Iyer, P. 706, 709 [49] Jacobson,!. 1272, 7326 [31] Jagadeesan, R. 707, 708 [31] Jancar, P. 558, 586, 588-591, 619 [55]; 620 [83]; 620 [84]; 620 [85]; 620 [86]; 620 [87]; 620 [88]; 620 [89]; 627 [90]; 62i [91] Janicki, R. 757, 763 [46]; 876, 935, 941 [33] Janin, D. 314, 326, 328 [33]; 328 [34] Janssen, W.RM. 797 [45]; 867, 869 [38]; 1056, 1117-1121, 7745 [91]; 7746 [142] Jantzen, M. 614, 627 [92] Jategaonkar, L. 1050, 1052, 1053, 1059, 7745 [92]; 7745 [93]; 7745 [94] Jeffrey, A. 237, 285 [130]; 713, 754, 763 [47] Jensen, C.-T. 713, 747, 748, 756, 758, 763 [48] Jensen, K. 820, 867, 869 [39]; 869 [40]; 1153, 1207 [31]
Jerrum, M. 565, 566, 573, 574, 576, 589, 620 [68]; 620 [69]; 620 [70]; 620 [11]
Jha,S. 317,328[43] Jifeng,H. 270, 255 [131] Johnson, D. 612, 627 [93] Jones, C.B. 797 [46] Jonsson, B. 797 [47]; 797 [48]; 687, 688, 691, 697, 702, 704, 706, 708 [35]; 708 [36]; 709 [40]; 709 [41]; 709 [42]; 709 [43]; 754, 763 [49]; 1058, 1091, 7742 [26]; 7745 [95] Josephs, M.B. 117, 185, 797 [37] Jou, C. 687, 694, 695, 708 [32] Joyal, A. 1005, 1040 [95] Jutla, C.S. 316, 328 [23]; 328 [24] Kahn, G. 797 [49] Kaivola, R. 318, 328 [35]; 328 [36] Kanellakis, RC. 398, 424 [21]; 715, 723, 764 [50] Katoen, J.-R 691, 692, 707, 707 [6]; 708 [20]; 705 [21]; 705 [22] Katz, S. 1059, 7745 [96] Keller, R.M. 104, 792 [50]; 201, 285 [132] Kennaway, J.K. 8, 22, 96 [34] Kerbrat, A. 422, 424 [14]; 1190, 7206 [15] Khrisnan, R 1011, 7040 [96] Kiehn, A. 602, 609, 679 [56]; 748, 762 [18]; 947-949, 953, 955-961, 964, 973-975, 977-979, 986, 991, 992,994-997,999-1001, 1003, 1007, 1013, 1016, 1018, 1035, 1037 [19]; 70i7 [28]; 1038 [29]; 7040 [97]; 7040 [98]; 7040 [99]; 7040 [100]; 7040 [101] Klaudel, H. 876, 940 [12]; 947 [34]
1335
Kleene, S.C. 122, 792 [51]; 237, 285 [133]; 335, 336, 384, 387 [52]; 387 [53]; 786, 869 [41] Kleijn, J.J.T. 1154, 7207 [32] Klein, M. 604, 679 [43] Klint, R 225, 282 [60]; 674, 682 [12] Klop, J.W. V, via [1]; 8, 22, 28, 74, 75, 87, 89, 95 [6]; 95 [10]; 95 [11]; 104, 134, 790 [9]; 790 [15]; 790 [16]; 790 [17]; 199, 208, 222, 223, 225, 227, 233, 235, 247-250, 262, 280 [24]; 280 [25]; 281 [35]; 281 [36]; 281 [37]; 281 [38]; 281 [39]; 281 [40]; 337, 338, 345, 347, 359, 364, 375, 381, 383, 385 [11]; 385 [12]; 386 [19]; 386 [20]; 386 [21]; 386 [22]; 393, 423 [2]; 549, 553, 565, 566, 677 [4]; 677 [5]; 677 [9]; 629, 682 [13]; 713-715, 754, 755, 762 [5]; 762 [6]; 762 [9]; 772, 783, 804, 868 [13]; 868 [14]; 1071, 7747 [16]; 1153, 7206 [7] Klusener, A.S. 199, 264, 270, 283 [84]; 285 [134]; 647, 674, 682 [23]; 682 [29]; 682 [30] Knabe, R 1011, 1014, 1016, 7042 [157] Knijnenburg, RM.W. 1051, 1071, 1075, 7745 [97] Knoblock, T. 265, 282 [66] Knuth, D.E. 346, 387 [54]; 574, 627 [94] Koens, M.J. 673, 652 [31] Kok, J.N. 6, 95 [8]; 790 [18]; 1051, 1071, 1075, 7745 [97] Koomen, C.J. 134, 792 [52]; 364, 383, i57 [55] Korenjak, A.J. 548, 576, 627 [95] Korver, H. 1154, 1155, 1168, 1186, 7206 [16]; 7206 [17]; 7207 [33] Kosaraju,S.R. 613,627 [96] Koutny, M. 757, 762 [14]; 762 [15]; 763 [46]; 820, 866, 565 [16]; 876, 877, 899, 903, 904, 908, 912, 918, 930, 937, 939, 940 [10]; 940 [11]; 940 [22]; 947 [31]; 947 [35]; 947 [36]; 947 [37] Koymans, C.RJ. 384, 387 [56] Kozen, D. 301, 328 [37]; 328 [38]; 328 [39]; 336, i57 [57]; 596, 627 [97] Kramer, A. 1011, 1014, 1016, 7042 [157] Kristensen, J.E. 1260, 7266 [20] Krob, D. 336, 387 [58] Kucera, A. 589-591, 620 [86]; 620 [87]; 627 [98]; 621 [99] Kuiper, R. 327 [6]; 1059, 774i [54] Kumar, K.N. 792 [53] Kuo, T.M. 1011, 1014, 1016, 7042 [157] Kwiatkowska, M. 706, 707 [7] Labella, A. 337, 347, 356 [32]; 386 [33]; 386 [34] Lacoste, M. 1034, 7035 [30] Ladkin, RB. 1325, 7325 [14] Ladner, R.E. 298-300, 325 [26] Lamport, L. 180, 790 [1]; 792 [54]; 792 [55]; 306, 325 [40]: 592, 627 [100]; 764 [52]; 1059, 7745 [98]
1336
Author Index
Laneve, C. 1098, 1100,1144 [73]; 1144 [74] Langeralc, R. 950, 954,1040 [102]; 1078, 1081, 1117, 1145 [99]; 1145 [100] Lanve, C. 1024, 1025,1037 [20] Larsen, K.G. 8, 41, 49, 96 [35]; 199, 203, 263, 285 [135]; 285 [136]; 285 [137]; 687, 688, 691, 696, 697, 700, 704, 705, 709 [41]; 709 [44]; 709 [45]; 709 [46]; 76)9 [60]; 754, 763 [49] Larsen, K.S. 1050, 1052, 1092, 1093, 1098, 7745 [101]; 77^5 [110] Lau, S. 1260, 7266 [19] Lauer,L. 199, 285 [138] Lauer, P.E. 117, 150, 792 [56]; 876, 935, 941 [33]; 941 [38] Lautenbach, K. 884, 940 [24] Lavrov,A.939, 940[13] Le Metayer, D. 201, 285 [139] Lee, I. 422,424 [27]; 713-715, 730, 754, 762 [21]; 762 [22]; 762 [23]; 763 [35]; 763 [36] Lehman, D. 429, 476 [6] Lei, C.-L. 299, 316, 318, 328 [25]; 598, 679 [49] Lejeune, Y. 1213, 7265 [2] Lenzi, G. 319, 328 [41]; 598, 627 [101] Leth, L. 537, 540 [8]; 1011, 1014, 1016, 1042 [157] Leue,S. 1325, 7i25 [14] Levi, F. 755, 764 [53]; 1027, 1040 [103] Levy, J.-J. 949, 1011, 1014, 1022, 1025, 1039 [71]; 7040 [104] Lewi, J. 323, 329 [73] Lhoussaine, C. 1019, 1021, 1037 [10] Lichtenstein, O. 611, 627 [102] Lifschitz, V. 211,285[90] Lilius, J. 876, 947 [39] Lin, H. 429, 453^55, 457, 459, 464-467, 475, 476 [16]; 476 [17]; 476 [18]; 476 [25]; 476 [26]; 476 [27]; 538, 539, 540 [17]; 540 [20]; 540 [21]; 1012, 7040 [91]; 1131, 7744 [86] Lindstrom, 1.273, 2M [210] Lipton, R. 614, 627 [103] Liu, X. 323, 328 [42]; 475, 476 [19] Loeckx, J. 120, 792 [57] Logrippo, L. 1071, 7745 [111] Lohrey, M. 757, 763 [42] Long,D. 317,J25[43] Loogen, R. 876, 940 [26]; 950, 7040 [105]; 1088, 7745 [102] Lowe, 0.713, 748, 764 [54] Lucas, R 199, 285 [140]; 285 [141] Lucidi, F. 199, 282 [58] Lugiez, D. 610, 627 [104] Luttgen, G. 713, 714, 722-724, 728, 729, 731, 732, 735, 736, 739, 747, 753-758, 762 [16]; 763 [27]; 763 [28]; 763 [29]; 764 [55]; 764 [56] Luttik, S.R 436, 476 [8]; 1154, 1190, 1191, 7207 [34]
Lynch, N.A. 792 [55]; 792 [58]; 792 [59]; 687, 691, 697, 706, 709 [56]; 1154, 7207 [35] MacQueen, D. 200, 264, 286 [161] Madelaine,E. 243, 285 [142] Mader, A. 311, 323, 327 [12]; 328 [44] Mahr, B. 1162, 7206 [14] Main, M. 204, 285 [143] Maler, 0.607,612, 616, 677 [12] Man,J.de 1324, 7i25 [15] Manna, Z. 295, 328 [45]; 328 [46]; 595, 600, 677 [7]; 627 [105] Maranget, L. 949, 1011, 1013, 1014, 1022, 1025, 1026, 70i9[7I];70i9[72] Maraninchi, F 756, 764 [57] Marchetti, S. 950, 1039 [57]; 1051, 1071, 1072, 7744 [75] MarrercW. 317, i28 [43] Mason, I. 279, 285 [144] Mateescu, R. 422, 424 [14]; 1190, 1191, 7206 [15]; 7207 [46] Mauw, S. 243, 285 [145]; 1162, 7207 [40]; 1272, 1274, 1276, 1317, 1323-1325, 1325 [3]; 7i25 [8]; 7i26 [16]; 7i26 [17]; 7i26 [18]; 7i26 [19]; 7i26 [20]; 7i26 [21]; 7i26 [22]; 7i26 [23]; 7i26 [24]; 7i26 [25]; 7J26 [26] Mayr, E.W. 588, 613, 627 [106] Mayr, R. 589-591, 602, 603, 605, 610, 612, 614, 616, 617, 679 [64]; 620 [86]; 627 [98]; 627 [99]; 627 [107]; 627 [108]; 627 [109]; 627 [110]; 627 [111]; 627 [112] Mazurkiewicz, A. 106, 792 [60]; 867, 869 [42]; 884, 888, 947 [40]; 950, 951, 7040 [106]; 7040 [107]; 1091, 1117, 7745 [103]; 7745 [104]; 1153, 7207 [36] McCarthy,!. 199, 286 [146] McCulloch, W.S. 335, 387 [59] McMillan, K.L. 254, 286 [147]; 547, 678 [20] Meerendonk, J.M.S. van den 673, 682 [32] Memmi,G. 884, 940 [15] Mendler, M. 757, 762 [2]; 763 [27] Mendler, N. 265, 282 [66] Merro, M. 1023, 7040 [108] Meulen, E.A. van der 1324, 7i26 [16] Meyer, A.R. 5, 8, 41, 49, 90, 93, 95 [12]; 96 [36]; 199, 203, 207, 209, 211, 215, 227, 230, 232, 237, 238, 251, 253, 263, 271, 282, 282 [54]; 282 [55]; 286 [148]; 771, 869 [43]; 1050, 1052, 1053, 1055, 1067, 1105, 7742 [18]; 7745 [93]; 7745 [94]; 7745 [105]; 7745 [106] Meyer, J.-J.Ch. 6, 95 [8] Middelburg, C.A. 674, 682 [14]; 715, 748, 762 [10]; 1212, 1215, 1226, 1229, 1260, 1261, 7265 [7];
Author Index 1265 [12]; 1265 [13]; 1266 [14]; 1266 [15]; 1266 [16]; 7266 [23] Milne, G. 199, 286 [149]; 429, 476 [28] Milner, R. v, ix [6]; 7, 8, 38, 43, 47, 48, 52, 53, 88, 89, 96 [27]; 96 [28]; 96 [37]; 96 [38]; 96 [39]; 104, 109, 112, 114, 116, 127, 150, 152, 154, 156, 192 [61]; 192 [62]; 192 [63]; 792 [64]; 199, 200, 203-205, 217, 224, 231, 232, 234, 235, 238, 242-244, 249-252, 254, 255, 262, 264, 270, 271, 273, 274, 279, 285, 285 [122]; 285 [123]; 286 [149]; 286 [150]; 286 [151]; 286 [152]; 286 [153]; 256 [154]; 256 [155]; 286 [156]; 256 [157]; 286 [158]; 256 [159]; 256 [160]; 256 [161]; 296, 298, 328 [30]; 328 [47]; 336-338, 344, 347, 358, 359, 361, 384, 387 [60]; 387 [61]; 387 [62]; 557 [63]; 357 [64]; 393, 407, 408, 424 [22]; 424 [23]; 429, 431, 433, 437, 441, 442, 446-448, 459, 466, 470, 471, 474, 476 [20]; 476 [28]; 476 [29]; 476 [30]; 476 [31]; 477 [32]; 477 [33]; 477 [34]; 477 [35]; 536-539, 540 [22]; 540 [23]; 540 [24]; 540 [25]; 540 [26]; 540 [27]; 540 [28]; 540 [29]; 547 [30]; 547 [31]; 547 [32]; 548, 558, 559, 566, 592, 594, 679 [65]; 621 [113]; 627 [114]; 627 [115]; 627 [116]; 629, 652 [33]; 652 [34]; 687, 704, 705 [37]; 709 [47]; 713, 715-718, 720-724, 728, 730, 734, 737, 739, 740, 743, 744, 755, 757, 758, 764 [58]; 764 [59]; 764 [60]; 783, 793, 836, 842, 846, 569 [44]; 569 [45]; 876, 882, 934, 947 [41]; 947 [42]; 947, 949, 962, 1007, 1008, 1013, 1015, 1017, 1031, 7040 [109]; 7040 [110]; 7040 [111]; 7040 [112]; 7040 [113]; 7040 [114]; 1057, 1062, 1067-1069, 1108, 7744 [87]; 7745 [107]; 7745 [108]; 1153, 1155, 1170, 1196, 7207 [37]; 7207 [38]; 7207 [39] Minsky, M.L. 381, 387 [65]; 586, 609, 615, 622 [117] Misra, J. 137, 797 [29]; 792 [65]; 1154, 7206 [9] Moller, B. 176, 181,797 [27] Moller, F. 199, 244, 256 [162]; 256 [163]; 322, 327 [15]; 538, 542 [56]; 558, 563, 565, 566, 573, 574, 576, 586, 589-592, 617, 675 [36]; 675 [37]; 679 [55]; 620 [69]; 620 [70]; 620 [71]; 620 [72]; 620 [87]; 620 [88]; 620 [89]; 621 [90]; 621 [91]; 627 [116]; 622 [118]; 622 [119]; 622 [120]; 630, 674, 652 [35]; 652 [36]; 715, 750, 764 [61]; 1035, 70J5[44]; 1061, 7745 [109] Molloy, M.K. 687, 709 [48] Monfort, R. 606, 675 [34] Monin,F. 1154, 1156, 1186, 7206 [18]; 7206 [19] Montanari, U. 539, 540 [13]; 540 [14]; 732, 764 [62]; 866, 565 [21]; 569 [46]; 876, 940 [19]; 947, 948, 950,952-955,958, 959, 964, 970, 971, 978, 995, 1000, 1001, 1036, 70i5 [54]; 70i5 [55]; 1039 [56]; 70J9 [58]; 70i9 [59]; 70i9 [60]; 70i9 [61]; 1039 [66]; 1039 [67]; 70i9 [68]; 7040 [86];
1337
7047 [115]; 7047 [116]; 7047 [117]; 1051, 1052, 1055, 1071, 1072, 1078, 1088, 1095, 774i [45]; 1143 [46]; 7/4i [47]; 1144 [75]; 7744 [76]; 7744 [77] Moore, E.F. 548, 622 [121] M0rk, S. 1260, 7266 [24] Morris, J.H. 574, 627 [94] Mosses, RD. 120, 797 [35]; 217, 256 [164] Mounier, L. 422, 424 [14]; 1190, 7206 [15] Mukund, M. 748, 758, 764 [63]; 947, 958, 968, 970, 977, 1000, 7047 [118] Muller, D.E. 322, i25 [48]; 602, 622 [122] Murata, T. 783, 569 [47]; 884, 947 [43] Murphy, D. 947, 948, 959, 1009, 1010, 1012, 1013, 70i5[49]; 7047 [119] Murthy, C. 1154, 7206 [12] Mycroft, A. 876, 940 [27]; 950, 7040 [83] Narasimha, M. 706, 709 [49] Natarajan, V. 713, 727, 731, 732, 736, 747, 757, 758, 763 [28]; 763 [29]; 764 [64]; 764 [65] Nestmann, U. 537, 538, 547 [33]; 541 [34]; 547 [35] Nicollin, X. 218, 270, 256 [165]; 591, 677 [2]; 630, 674,65i[37]; 1215, 7266 [25] Niebert, R i25 [49] Nielsen, M. 537, 540 [12]; 748, 758, 764 [63]; 765 [78]; 772, 778, 867, 569 [48]; 569 [49]; 947, 950, 954, 958, 968, 970, 977, 1000, 1005, 1007, 1039 [64]; 7040 [95]; 7047 [118]; 7047 [122]; 7047 [123]; 7042 [147]; 7042 [170]; 1050, 1052, 1092, 1093, 7745 [110] Nielson, F. 200, 256 [166]; 538, 547 [36] Nielson, H. 200, 256[166] Nipkow, T. 225, 250 [17]; 346, 385 [10] Nivat, M. 112, 792 [66]; 272, 252 [67] Niwiriski, D. 311, 316, 318, 325, 327 [3]; 328 [50]; 328 [51]; 598, 601, 622 [123]; 622 [124] Obaid, A. 1071, 7745 [111] Oei, L.H.673, 652[31] Olderog, E.-R. 6, 8, 22, 32, 74, 75, 87, 95 [8]; 95 [10]; 95 [11]; 96 [40]; 114, 127, 140, 141, 145, 150, 157, 158, 790 [16]; 790 [17]; 792 [67]; 792 [68]; 792 [69]; 792 [70]; 866, 569 [50]; 876, 941 [44]; 950, 954, 1041 [124]; 1041 [125]; 1077, 7745 [112]; 7745 [113] Olivero, A. 591,677[2] Oostrom, V.v. 230, 256[167] Orava, F 713, 730, 732, 747, 763 [38]; 1058, 7742 [26] Ossefort, M. 137, 792 [71] Owicki, S. 243,256[168] Owre, S. 1154, 1207 [41]
1338
Author Index
Paczkowski, P. 475, 477 [36] Paige, R. 401, 424 [24]; 715, 723, 764 [66] Palamidessi, C. 190 [18]; 538, 541 [37] Panangaden, P. 265, 282 [66]; 704, 705, 707, 707 [10]; 708 [28]; 708 [29]; 708 [30]; 708 [31] Pandya, P.K. 192 [53]; 192 [72] Parent, C 1154, 1206 [12] Parikh, R. i25 [39] Park, D.M.R. 8, 9, 35, 47, 53, 65, 96 [41]; 110, 192 [73]; 200, 203, 286 [169]; 301, 311, 329 [52]; i29 [53]; 336, 387 [66]; 429, 477 [37]; 558, 622 [125]; 715, 718, 734, 764 [67]; 772, 777, 869 [51]; 947, 704/[126] Parrow, J. 135, 792 [74]; 237, 241, 242, 264, 270, 282 [65]; 286 [160]; 286 [170]; 408, 416, 422, 423 [11]; 464, 467,475, 476 [4]; 477 [35]; 477 [38]; 477 [39]; 537-539, 547 [30]; 541 [31]; 547 [38]; 541 [39]; 547 [40]; 547 [41]; 547 [42]; 758, 764 [60]; 764 [68]; 1007, 1012, 1013, 1015, 1017, 1031, 7040 [114]; 7047 [127] Paterson, M.S. 591, 622 [143] Paulin-Mohring, C. 1154, 7206 [12] Paulson, L.C. 1154, 7207 [41]; 7207 [42] Peled, D.A. 550, 679 [42]; 1196, 7206 [28]; 1325, 1325 [2] Pelz, E. 876, 940 [12]; 947 [39] Penczek, W. 329 [54] Pepper, R 176, 181, 797 [27] Pedes, M. 548, 565, 677 [6] Peterson, J. 950, 7047 [128] Peterson, J.L. 563, 622 [126]; 783, 869 [52] Petri, C.A. 772, 778, 869 [53]; 950, 7047 [129]; 7047 [130] Phillips, I.C.C. 8, 24, 96 [42]; 228, 254, 288 [218]; 1153, 7207 [43] Pierce, B.C. 537, 538, 547 [34]; 547 [43]; 547 [44]: 547 [45]; 547 [46]; 949, 1013, 1014, 1016, 1020-1022, 1031, 7047 [131]; 7047 [132]; 7042 [150]; 7042 [151]; 7042 [152] Pistore, M. 1036,7047 [115] Pitts, A. 264, 284 [106] Pitts, W. 335, 387 [59] Plaisted, D.A. 346, 387 [67] Plotkin, G.D. v, ix [7]; 113, 792 [75]; 792 [76]; 199-201, 251, 264, 271, 273, 275, 277, 279, 285 [124]; 285 [125]; 286 [172]; 286 [173]; 286 [174]; 287 [175]; 287 [176]; 288 [214]; 341, 388 [68]; 395, 424 [25]; 429, 476 [21]; 477 [40]; 637, 683 [38]; 687, 709 [50]; 713, 718, 733, 764 [69]; 867, 869 [48]; 875, 947 [45]; 950, 7047 [123]; 7047 [133]; 1063, 7745 [114] Pnueli, A. 8, 28, 96 [43]; 797 [36]; 205, 287 [177]; 295, 327 [6]; 328 [29]; 328 [45]; 328 [46];
329 [55]; 429, 476 [6]; 592, 595, 600, 611, 677 [7]; 627 [102]; 621 [105]: 622 [127]; 687, 709 [51] Podelski, A. 617, 679 [57] Poel, M. 797 [45]; 1056, 1117-1121, 7745 [91] Pol, J.C. van de 1154, 1156, 7206 [19]; 7206 [26] Pomello, L. 8, 28, 95, 97 [44]; 867, 869 [54]; 950, 955, 1037 [19]; 1038 [41]; 1038 [45]; 1052, 1054, 1093, 7742 [32] Ponse, A. 134, 790 [14]; 199, 233, 238, 264, 270, 281 [33]: 287 [34]; 287 [41]; 284 [109]; 287 [178]; 336, 337, 346, 359, 360, 363, 365, 372, 374, 375, 381, 382, 385 [16]: 386 [17]; 386 [18]; 386 [23]; 386 [24]: 475, 476 [9]; 476 [10]; 786, 787, 823, 846, 867, 867 [11]; 868 [12]; 868 [33]; 939, 940 [5]; 950, 1037 [17]; 1154, 1156, 1159, 1186, 7206 [6]; 7206 [20]; 7206 [21]; 1258, 1260, 1266 [22] Prasad, K.V.S. 713, 715, 730, 764 [70]; 764 [71] Prasad, S. 948, 1011, 1014, 1016, 1017, 1019, 1025, 7037 [12]; 7042 [157] Pratt, V.R. 295, 298, 300, 301, 329 [56]; 329 [57]; 329 [58]: 574, 627 [94]; 867, 869 [55]; 951, 7047 [134]; 7047 [135]: 1054, 1091, 7745 [115] Priami, C. 218, 282 [73]; 287 [179]; 537, 540 [8]; 757, 763 [32]: 959, 1039 [62] Priestley, H.A. 902, 940 [18] Prinz, A. 1260, 7266 [19] Pruitt, L. 1212, 7266 [26] Przymusinski, T. 212, 214, 287 [180]; 287 [181] Pugliese, R. 1013, 1033, 7047 [120]; 7047 [121] Purushothaman, S. 687, 709 [52] Qin, H. 1196, 7207 [44] Quaglia, R 538, 539, 540 [14]; 547 [47] Quemada, J. 674, 683 [39] Quemener, Y.-M. 608, 618 [26] Rabin, M.O. 104, 792 [77]; 296, 329 [59]; 329 [60]; 687, 709 [54] Rabin, R.O. 593, 622 [128] Rabinovich, A. 955, 1005, 7047 [136]; 1055, 1092, 1095, 7745 [116] Ramakrishnan, C.R. 323, 328 [42] Rathke, J. 475, 477 [41]: 477 [42]: 477 [43] Ravn, A.P 1260, 7266 [30] Redei,L. 571, 622 [129] Redko, V.N. 336, 356, 388 [69] Regan, T. 199, 285 [126]; 674, 682 [26] Reingold, N. 792 [78] Reisig, W. 200, 287 [182]; 757, 764 [72]; 783, 869 [56]; 869 [51]: 869 [58]; 884, 947 [28]; 947 [46]: 950, 7040 [84]; 7040 [85]; 7047 [137]; 7047 [138]: 1153, 7207 [45] Rem, M. 137, 792 [79] Remy, D. 949, 1011, 1014, 1022, 1025, 1039 [71]
Author Index Reniers, M.A. 475, 476 [11]; 673, 682 [16]; 867, 868 [34]; 1154, 1207 [32]; 1215-1217, 1266 [27]; 1272, 1276, 1277, 1323-1325, J325 [8]; J326 [17]; 1326 [18]; 1326 [19]; 1326 [20]; /i26 [21]; 1326 [22]; /J26 [23]; 1326 [27]; /i26 [28] Rensink, A. 269,287 [183]; 955, 956, 1040 [87]; 1050, 1052, 1054, 1056, 1058, 1059, 1061, 1080, 1091, 1095, 1107, 1110, 1113, 1115, 1117, 1122, 1126, 1129-1131, 1136, 1138, 1140, 7/44 [69]; 1146, 1146 [117]; 1146 [118]; 1146 [119]; 1146 [120]; 1146 [121]; 1146 [122]; 7/46 [123]; 7746 [124]; 7746 [125]; 7746 [126]; 1273, 1326 [29] Reppy,J. 200, 264, 287 [184] Ressouche, A. 422, 423 [5] Rettelbach, M. 754, 755, 763 [43] Rety,J.-H. 1036,7047 [139] Riely, J. 948, 949, 1011-1014, 1016, 1019, 1020, 1024, 1025, 1040 [92]; 1040 [93]; 1041 [140]; 1041 [141]; 1041 [142] Riemann, R.-Ch. 876, 947 [34] Robbana, R. 593, 598, 599, 606, 677 [11] Roccetti, M. 1078, 7744 [78] Roever, W.-R de 137, 176, 190 [11]; 797 [30]; 792 [80]; 193 [96]; 1057, 7747 [12] Rogers, H. 234, 257 [185] Romijn, J.M.T. 1191, 1206 [13] Rooda,J.E. 1154, 7207 [32] Roscoe, A.W. v, viii [2]; 8, 22, 95 [13]; 95 [14]; 97 [45]; 158, 190 [20]; 79i [81]; 217, 231, 235, 237, 282 [61]; 287 [186]; 422, 424 [26]; 429, 476 [2]; 476 [23]; 629, 682 [18]; 1057, 1099, 1129, 7742 [27] Rosenthal, K. 279, 287 [187] Rosolini, G. 1056, 774i [51] Ross, K. 212, 283, 283 [88]; 283 [89] Rossmanith, R 612, 679 [54] Roucairol, G. 866, 868 [20]; 884, 940 [15] Rounds, W.C. 8, 32, 97 [46] Roy, V. 422, 423 [5] Rozenberg, G. 790 [11]; 783, 867, 869 [54]; 869 [57]; 869 [58]; 1057, 7747 [12]; 7746 [127] Rudolph, E. 1323, 1325, 1325 [11]; 7i26 [30] Rumbaugh,J. 1272, 7i26 [31] Rushby,J.M. 1154, 7207 [47] Rutten, J.J.M.M. 51, 96 [22]; 790 [18]; 279, 287 [188]; 287 [189]; 287 [190]; 287 [191] Ryan, M. 706, 707 [7] Saidouni, D.E. 1050, 1059, 1099, 7742 [37]; 7746 [128] Salomaa, A. 204, 287 [192]; 336, 355, 388 [70]; 355 [71]; 548, 622 [130] Sands,D. 201,268, 257 [193]
1339
Sangiorgi, D. 265, 270, 257 [194]; 257 [195]; 464, 467, 477 [39]; 477 [44]; 537-539, 540 [3]; 547 [32]; 547 [41]; 547 [48]; 547 [49]; 547 [50]; 547 [51]; 541 [52]; 948, 1007, 1008, 1014, 1018, 1020, 1021, 1023, 1026, 1027, 7 0 i 7 [ l l ] ; 7040 [103]; 1040 [108]; 7047 [131]; 1042 [143]; 7042 [144]; 7042 [145]; 7042 [146] Sangiovanni-Vincentelli, A.L. 706, 707 [3] Sannella, D. 79i [82] Sarma, A. 1211, 7265 [10]; 7266 [18] Sasaki, J. 265, 252 [66] Sassone, V. 954, 7042 [147] Sawa,Z. 590, 627 [91] Schatz, B. 181,79i[83] Schlipf, J. 212, 283, 283 [88]; 25i [89] Schmidt, D. 201, 255 [139] Schneider, F.B. 137, 161, 190 [4]; 79i [91] Schneider, S. 264, 270, 257 [196]; 748, 763 [31] Schnoebelen, Ph. 42, 94, 97 [47]; 610, 627 [104]; 1069, 7742 [34] Scholten, C.S. 774, 565 [23] Schoneveld, A. 673, 683 [40] Schreiber, G. 866, 565 [22] Schreiber, M.Z. 475, 477 [45] Schupp, RE. 322, 328 [48]; 602, 622 [122] Schwoon,S. 612, 679 [54] Scott, D.S. 104, 120, 797 [35]; 792 [77]; 79i [84]; 270, 273, 257 [197] Segala, R. 687, 691, 697, 700, 706, 709 [55]; 709 [56] Segers,J. 1059, 774J [54] SeidelH. 617, 622 [131] Sellink, M.PA. 1156, 1206 [25] Senizergues, G. 548, 589, 590, 622 [132]; 622 [133]; 622 [134] Sewell, RM. 337, 357, 359, 388 [72]; 797, 569 [59]; 949, 1013, 1014, 1016, 1021, 1022, 1031, 1034, 7042 [148]; 7042 [149]; 1042 [150]; 7042 [151]; 7042 [152] Shamir, E. 548,565, 677 [6] Shankar, N. 1154, 1207 [41] Shankland, C. 1156, 1191, 1207 [48] Sharp, R. 1260, 7266 [24] Shields, M.W. 117, 150, 792 [56]; 950, 7042 [153] Shoenfield, J.R. 144, 79i [85] Sieber, K. 120, 792 [57] Sifakis, J. 218, 270, 256 [165]; 591, 677 [2]; 630, 674, 683 [37]; 884, 940 [15]; 1215, 7266 [25] Sighireanu, M. 422, 424 [14]; 424 [15]; 1190, 1191, 7206 [15]; 7207 [46] Simone, C. 867, 569 [54]; 950, 70i5 [45] Simone, R. de 207, 227, 231-234, 241, 243, 257 [198]; 255 [199]; 255 [200]; 255 [201]; 404, 407, 422, 423 [4]; 423 [5]; 692, 705 [26]; 866, 565 [20]; 1067, 1143 [44]
1340
Author Index
Simpson, A. 254, 288 [202] Sims, S. 422, 423 [12]; 713, 757, 763 [29] Singhal, V. 706, 707 [3] Sistla, A.R vi, ix [3]; 300, 316, 327 [18]; 328 [24]; 329 [61]; 596, 611, 616, 619 [41]; 622 [135]; 706, 708 [15] Skou, A. 8, 41, 49, 96 [35]; 199, 203, 263, 285 [136]; 285 [137]; 687, 688, 691, 696, 704, 705, 709 [44]; 709 [45]; 709 [46] Smith, S. 265, 279, 282 [66]; 285 [144]; 2<^<5 [203] Smolka, S.A. 323, 328 [42]; 398, 424 [21]; 687, 691, 692, 694, 695, 700, 708 [17]; 708 [32]; 708 [33]; 709 [53]; 709 [59]; 713, 715, 723, 754, 755, 764 [50]; 765 [73]; 765 [75]; 765 [76]; 950, 7057 [17] Smyth, M. 277, 288 [204] Snepscheut, J.L.A, van de 137, 193 [86] Sokolsky, O. 422, 424 [27]; 605, 619 [44]; 687, 695, 705[18];715, 723, 765[30] §oricu|, R. 1260, 1266 [15] Springintveld, J. 1154-1156, 1172, 1176, 1178, 1180, 1186, 7206 [18]; 7206 [24]; 7207 [33] Srinivasan 595, 679 [50] Stancampiano, E. 1078, 1144 [78] Stark, E.W. 792 [58]; 193 [87]; 692, 700, 709 [59] Starke, RH. 884, 941 [47] Stavi, J. 328 [29] Steel, T. 199, 288 [205] Stefanescu, G. 169, 797 [28] Steffen, B. 241, 282 [65]; 322, 327 [15]; 327 [16]; 408, 416, 422, 423 [11]; 476 [4]; 561, 566, 578, 589, 598, 603-609, 616, 617, 618 [23]; 618 [24]; 618 [27]; 618 [28]; 618 [29]; 679 [43]; 679 [45]; 620 [78]; 622 [131]; 687, 691, 700, 708 [33]; 713, 715, 754, 755, 765 [73]; 765 [76] Stins, A. 673, 683 [40] Stirling, C.R 205, 243, 252, 254, 288 [206]; 288 [207]; 288 [208]; 288 [209]; 295, 304, 310-313, 316, 319-321, 327 [2]; 327 [13]; i29 [62]; 329 [63]; i29 [64]; 329 [65]; 329 [66]; 549, 558, 565, 566, 569, 589, 591, 592, 598, 618 [17]; 618 [38]; 618 [39]; 620 [80]; 622 [136]; 622 [137]; 622 [138]; 687, 704, 707 [11]; 715, 762 [19] Stoltenberg-Hansen, V. 273, 288 [210] Stoughton, A. 266, 271, 288 [211]; 288 [212] Stoy,J.E. 120, 79i[88] Strachey, C. 270, 273, 287 [197] Streett, R.S. 304, 312-314, 329 [67]; 329 [68] Stfibma, J. 590, 622 [139] Subrahmanyam, RA. 687, 709 [52] Talcott, C 279, 285 [144] Taijan, R.E. 401, 424 [24]; 715, 723, 764 [66] Tarlecki, A. 7746[129]
Tarski, A. 122, 193 [89]; 597, 622 [140] Taubner, D.A. 254, 283 [77]; 336, 386 [26]; 549, 622 [141]; 866, 869 [60]; 876, 881, 947 [48]; 950, 7042 [154]; 7042 [155] Thatcher,!. 276, 284 [105] Thiagarajan, RS. 329 [69]; 772, 778, 869 [49]; 884, 940 [24] Thomas, W. 325, 329 [70]; 600, 622 [142] Thomsen, B. 537, 538, 540 [8]; 547 [53]; 547 [54]; 1011, I0I4, 1016, 7042 [156]; 7042 [157] Tian,L. 566, 620 [81]; 620 [82] Tini,S. 201, 288 [213] Tofte,M. 200, 264, 286 [161] Tofts, C. 199, 286 [163]; 630, 674, 682 [35]; 682 [36]; 687, 691, 700, 708 [33]; 713, 715, 750, 754, 755, 764 [61]; 765 [74] Tokoro,M. 538, 540 [19]; 1011, 1017, 1023, 1031, 7040 [94] Torrigiani, RR. 117, 150, 192 [56] Trakhtenbrot, B.A. 955, 1005, 7047 [136]; 1055, 1092, 1095, 7745 [116] Troeger, D.R. 336, 346, 388 [73] Tucker, J.V. 338, 386 [22] Turi, D. 279, 287 [191]; 288 [214] Turner, D.N. 537, 547 [45]; 547 [46]; 1014, 1031, 7047 [132]; 7042 [158] Tuttle, M. 192 [59] Tzeng, W.-G. 700, 709 [57] Ulidowski, I. 228, 249, 250, 254, 288 [215]; 288 [216]; 288 [217]; 288 [218] Ullman, J.D. vi, ix [4]; 91, 96 [33]; 152, 797 [44]; 551, 620 [74] Uselton, A.C. 755, 765 [75] Usenko, Y.S. 674, 682 [14]; 715, 748, 762 [10] Vaandrager, RW. 8, 45, 46, 96 [25]; 199-201, 204, 207, 217, 218, 227, 229-235, 237, 238, 241, 243-249, 253, 258, 259, 262-264, 270, 280, 280 [6]; 280 [7]; 280 [8]; 284, 284 [110]; 284 [111]; 288 [219]; 288 [220]; 288 [221]; 342, 346, 387 [50]; 408, 424 [18]; 866, 868 [30]; 950, 955, 7039 [80]; 7039 [81]; 7042 [159]; 1055, 1067, 1096, 1098, 7747 [4]; 7744 [65]; 7744 [66]; 7744 [81]; 1191, 7206 [13]; 1225, 7266 [28] Valette, R. 884, 940 [15]; 1050, 7746 [130] Valiant, L.G. 591, 622 [143] Valk, R. 614, 627 [92] Valmari, A. 90, 97 [48] Vardi, M.Y. 299, 311, 329 [71]; 329 [72]; 416, 423 [13]; 600, 601, 611, 613, 616, 622 [144]; 622 [145]; 622 [146]; 687, 691, 709 [58] Varpaaniemi, K. 611, 623 [147]
Author Index Vasconcelos, V.T. 538, 542 [55] Veglioni, S. 8, 56-59, 97 [49] Veltink, G.J. 243, 285 [145]; 1162,1207 [40] Vereijken, J.J. 199, 207, 288 [222]; 673, 674, 683 [41]; 683 [42]; 1215-1217, 1266 [27]; 1324, 1326 [32] Vergamini, D. 241, 243, 285 [142]; 288 [201] Vergauwen, B. 323, 329 [73] Verhoef, C. 88, 89, 95 [3]; 199, 207, 217-220, 222, 223, 225, 226, 228, 229, 253, 265, 269, 281 [26]; 281 [27]; 282 [60]; 282 [69]; 283 [85]; 283 [86]; 285 [223]; 288 [224]; 289, 2<59 [225]; 289 [226]; 259 [227]; 342, 346, 385 [6]; i55 [14]; 395, 423 [1]; 431, 475 [1]; 629, 637, 638, 640, 645, 648, 681 [1]; 681 [9]; 65/ [10]; 652 [24]; 683 [43]; 692, 707 [2]; 713, 719, 750, 762 [1]; 765 [77]; 783, 789, 793, 795, 809, 815, 832, 835, 837, 567 [1]; 567 [5]; 881, 908, 938, 939 [1]; 940 [3]; 950, 1037 [6]; 1067, 1141 [6]; 1211, 1214, 1216, 1222, 1224, 1227, 7265 [1]; 7265 [8]; 7266 [29]; 1280, 1283, 1288,1289,1295,1296, 1302,1305, 7i25 [4]; 7i25 [5]; 1326 [33]; 1326 [34] Vickers, S. 94, 95 [2]; 279, 280 [3] Victor, B. 537-539, 541 [35]; 541 [42]; 542 [56] Vidal-Naquet, G. 884, 940 [15] Vink, E.P. de 230, 256 [167]; 1050, 1051, 1055, 1056, 1071, 1141 [13]; 1144 [83]; 1153, 7206 [11] Vitek, J. 949, 1013, 1014, 1028, 1030, 70^2 [160]; 7042 [161] Vogler, W. 79J [90]; 884, 941 [49]; 955,1042 [162]; 1050, 1052, 1055, 1093, 1098, 1099, 1106, 7742 [22]; 7746 [131]; 7746 [132]; 7746 [133]; 7746 [134] von der Beeck, M. 755, 764 [56] von Neumann, J. vi, ix [5] Voorhoeve, M. 796, 867, 567 [9]; 567 [10] Vrancken, J. 207, 225, 259 [228] Vrancken, J.L.M. 336, 384, i57 [56]; 388 [74]; 1324, 7i26 [35] Wagner, E. 276, 254 [105] Walker, D.J. 241, 242, 251, 264, 270, 273, 256 [160]; 259 [229]; 259 [230]; 304, 311-313, 319, 320, 329 [65]; 329 [66]; 477 [35]; 537-539, 547 [30]; 547 [31]; 547 [47]; 542 [57]; 758, 764 [60]; 1007, 1008, 1013, 1031, 7040 [114]; 7042 [163]; 1069, 7746 [135] Wallner,E 611, 623 [148] Walukiewicz, I. 314, 315, 326, J25 [33]; 328 [34]; 329 [741; 329 [75]; 607, 616, 623 [149] Wamel, J.J. van 199, 257 [41]; 1162, 7207 [51] Warinschi,B. 1261, 7266 [16] Watt, D. 264, 259 [231] Waveren, A. van 673, 683 [45]
1341
Weber, S. 201, 259 [232] Wehrheim, H. 1050, 1056, 1059, 1117, 1122, 1126, 7744 [70]; 7746 [125]; 7746 [126]; 7746 [136]; 7746 [137]; 1273, 7i26 [29] Weijland, W.P. 88, 93, 95 [7]; 207, 217, 231, 243, 248, 254, 255, 257 [28]; 284, 254 [103]; 254 [104]; 338, 342, 344, 347, 365, 383-385, 385 [15]; i57 [49]; 408,424 [17]; 629, 652 [11]; 713, 762 [7]; 783, 789, 793, 804, 809, 835, 567 [6]; 881, 911, 931, 940 [4]; 950, 978, 1010, 70i7 [14]; 1052, 1059, 1061, 1067-1069, 1077, 1108, 7747 [11]; 7744 [67]; 7744 [68]; 1153, 1170, 1174, 1188, 7206 [8]; 1211, 1214, 1260, 7265 [9]; 1276, 1297, 1325 [6] WeiB, T. 754, 755, 763 [43] Werner, B. 1154, 7206 [12] Widom,J. 137, 79i[91] Wijk, M. van 1274, 1317, 1323, 1324, 1326 [24]; 7i26 [25] Winkowski, J. 950, 7042 [164] Winskel, G. 8, 55, 97 [50]; 150, 162, 193 [92]; 254, 259 [233]; 321, 327 [2]; 713, 714, 731, 741-747, 758, 763 [24]; 765 [78]; 867, 569 [48]; 570 [61]; 950, 954, 1005, 1010, 7040 [95]; 7047 [123]; 7042 [147]; 7042 [165]; 7042 [166]; 7042 [167]; 7042 [168]; 7042 [169]; 7042 [170]; 1054, 1066, 1078, 1083-1085, 7746 [138]; 7746 [139]; 7746 [140]; 1153, 7207 [52] Winter, T. 1274, 1317, 1323, 1324, 7i26 [24]; 7i26 [25]; 7i26 [26] Wirsing, M. 176, 181, 797 [27] Wirth, N. 145, 193 [93]; 1049, 7746 [141] Wojciechowski, FT. 949, 1013, 1014, 1016, 1022, 1031, 7042 [150]; 7042 [151]; 7042 [152] Wolper, P. 299, 329 [72]; 416, 423 [13]; 600, 611, 613, 622 [146] Wright, A. 201, 259 [234] Wright, J. 276, 254 [105] Wright, J.B. 335, 336, 384, i56 [30] Wu, S.-H. 692, 700, 709 [59] Yankelevich, D. 732, 764 [62]; 866, 569 [46]; 947, 948, 958, 964, 970, 971, 974, 995, 1000, 1036, 1041 [\16]: 1041 [117]; 1042 [111]
Yannakakis, M. 416, 423 [13]; 706, 705 [19] Yen, H. 614, 62i [150] Yi, W. 630, 674, 683 [44]; 687, 691, 700, 704, 709 [42]; 709 [43]; 709 [60]; 713, 715, 748, 749, 754, 755, 763 [49]; 765 [79] Yoshida, N. 538, 542 [58] Yovine, S.591,677[2] Yuen, S. 700, 709 [53]
1342
Author Index
Zantema, H. 238, 283 [87]; 337, 346, 350, 387 [44]; 388 [75] Zhang, G.Q. 954,1038 [40] Zhou, C. 137,193 [94]; 1260,1266 [30] Zucca, E. 537, 540 [4] Zuck, L. 687, 709 [51]; 1033, 1038 [36] Zuck, L.D. 192 [78]
Zucker, J.I. 6, 8, 51, 95 [8]; 95 [9]; 199, 281 [30] Zwaag, M.B. van der 359, 388 [76]; 1156, 1191, 1207 [48] Zwarico, A. 692, 700, 708 [17] Zwiers, J. 137, 141, 143, 148,191 [30]; 191 [45]; 79i [95]; 79i [96]; 1056, 1117-1121, 7745 [91]; 7746 [142]