May and Must Testing in the Join-Calculus Cosimo Laneve Technical Report UBLCS-96-4 March 1996Revised: May 1996 Department of Computer Science University of Bologna Piazza di Porta S. Donato, 540127 Bologna (Italy) The University of Bologna Department of Computer Science Research Technical Reports are available ingzipped PostScript format via anonymous FTP from the area ftp.cs.unibo.it:/pub/TR/UBLCS or viaWWW at URL http://www.cs.unibo.it/. Plain-text abstracts organized by year are available in thedirectory ABSTRACTS. All local authors can be reached via e-mail at the address last-name@cs.unibo.it. Questions and comments should be addressed to tr-admin@cs.unibo.it. Recent Titles from the UBLCS Technical Report Series 94-19 On Group Communication in Large-Scale Distributed Systems, "O. Babao*glu, A. Schiper, July 1994. 94-20 Dynamic Allocation of Signature Files in Multiple-Disk Systems, P. Ciaccia, August 1994. 94-21 Parallel Independent Grid Files Based on a Dynamic Declustering Method Using Multiple Error CorrectingCodes, P. Ciaccia, November 1994. 95-1 Performance Preorder and Competitive Equivalence, F. Corradini, R. Gorrieri, M. Roccetti, January 1995(Revised December 1995). 95-2 Clepsydra Methodology, P. Ciaccia, O. Ciancarini, W. Penzo, January 1995. 95-3 A Unified Framework for the Specification and Run-time Detection of Dynamic Properties in DistributedComputations, "O. Babao*glu, E. Fromentin, M. Raynal, January 1995 (Revised February 1995). 95-4 Effective Applicative Structures, A. Asperti, A. Ciabattoni, January 1995. 95-5 An Open Framework for Cooperative Problem Solving, M. Gaspari, E. Motta, A. Stutt, February 1995. 95-6 Considering New Guidelines in Group Interface Design: a Group-Friendly Interface for the CHAOS System,D. Bottura, C. Maioli, S. Mangiaracina, February 1995. 95-7 Modelling Interaction in Agent Systems, A. Dalmonte, M. Gaspari, February 1995. 95-8 Building Hypermedia for Learning: a Framework Based on the Design of User Interface, S. Mangiaracina, C. Maioli, February 1995. 95-9 The Bologna Optimal Higher-Order Machine, A. Asperti, C. Giovannetti, A. Naletto, March 1995. 95-10 Synchronization Support and Group-Membership Services for Reliable Distributed Multimedia Applications,F. Panzieri, M. Roccetti, March 1995 (Revised July 1995). 95-11 The Inherent Cost of Strong-Partial View-Synchronous Communication, "O. Babao*glu, R. Davoli, L.-A.Giachini, P. Sabattini, April 1995. 95-12 On the Complexity of Beta-Reduction, A. Asperti, July 1995. 95-13 Optimal Multi-Block Read Schedules for Partitioned Signature Files, P. Ciaccia, August 1995. 95-14 Integrating Performance and Functional Analysis of Concurrent Systems with EMPA, M. Bernardo, L. Donatiello, R. Gorrieri, September 1995. 95-15 On Programming with View Synchrony, "O. Babao*glu, A. Bartoli, G. Dini, September 1995. 95-16 Generative Communication in Process Algebra, P. Ciancarini, R. Gorrieri, G. Zavattaro, October 1995. 95-17 Dynamic Declustering Methods for Parallel Grid Files, P. Ciaccia, A. Veronesi, November 1995. 95-18 Failure Detectors, Group Membership and View-Synchronous Communication in Partitionable AsynchronousSystems (Preliminary Version), "O. Babao*glu, R. Davoli, A. Montresor, November 1995. 96-1 An Investigation on the Optimal Implementation of Processes, C. Laneve, January 1996. 96-2 Expansivity, Permutivity, and Chaos for Cellular Automata, F. Fagnani, L. Margara, January 1996. 96-3 Enriched View Synchrony: A Paradigm for Programming Dependable Applications in Partitionable Asyn-chronous Distributed Systems, "O. Babao*glu, A. Bartoli, G. Dini, February 1996. 96-4 May and Must Testing in the Join-Calculus, C. Laneve, March 1996. 96-5 The Shape of Shade: a Coordination System, S. Castellani, P. Ciancarini, D. Rossi, March 1996. 96-6 Engineering Formal Requirements: an Analysis and Testing Method for Z Documents, P. Ciancarini, S.Cimato, C. Mascolo, March 1996. 96-7 Using Bayesian Belief Networks for the Automated Assessment of Students' Knowledge of Geometry ProblemSolving Procedures, M. Roccetti, P. Salomoni, March 1996. 96-8 Virtual Interactions: An Investigation of the Dynamics of Sharing Graphs, A. Asperti, C. Laneve, April1996. 96-9 Towards an Algebra of Actors, M. Gaspari, April 1996. 96-10 Mobile Petri Nets, A. Asperti, N. Busi, May 1996. May and Must Testing in the Join-Calculus Cosimo Laneve 1 Technical Report UBLCS-96-4 March 1996Revised: May 1996 Abstract The may and must-semantics are studied for the join-calculus. We provide a complete characterization ofmay-testing through a restricted set of contexts. The same characterization, up-to the basic observations, is also proved to be complete with respect to the must-testing semantics. 1. Department of Computer Science, University of Bologna, Piazza Porta S. Donato 5, 40127 Bologna, Italy. 1 1 Introduction 1 Introduction The join-calculus has been recently introduced for describing communicating processes [6]. Asin the asynchronous ss-calculus [2, 9] messages have no continuation and the scoping disciplineis static. However, the join-calculus departs from the asynchronous ss-calculus for two features:the presence of elaborate synchronization schemas and the possibility to create computational rules dynamically. Dynamic creation may happen when a pattern of messages matches with asynchronization schema. This triggers a new process which may add new computational rules. These new rules do not concern already defined names (static binding).The main motivation pervading the definition of join-calculus is pragmatical: the distributed implementation of the ss-calculus [11]. We refer to [6] for a detailed discussion of this issue. Apartfrom that, Fournet and Gonthier have also pursued on a semantic investigation with the worthy purpose of carrying over the join-calculus the metatheory of the ss-calculus. To this aim theyhave considered weak barbed congruence and, up-to this equivalence, they have proved that join-calculus and ss-calculus have the same expressive power.However the semantic theory of the join-calculus deserves a more detailed analysis because the results of [6] cannot reveal properties which are peculiar of the calculus. In this paper weundertake this analysis by considering the testing approach and exploring the corresponding theory in the join-calculus.Testing semantics [4, 7] is the adaptation of Morris' semantics in the *-calculus to genericlanguages. The paradigm is the following: 1. define a notion of "observable" for terms of the language. Usually it is the outcome of acomputation or a test whether a computation terminates or not; 2. take the coarsest congruence which is closed under the above notion of observable.In deterministic calculi (such as call-by-name, lazy or call-by-value *-calculus) every term hasalways a unique observable outcome. This is false in nondeterministic calculi. Take for instance the convergence of a computation as observable. Then, given a term P , we have the followingoutcomes: (a) every computation starting at P converges, (b) there are convergent and divergentcomputations starting at P , (c) every computation pointed at P diverges. Testing equivalence isthe congruence yielded by these three observations. It turns out that this equivalence is indeed the intersection of two coarser semantics: may and must-testing semantics. May-semantics is thecongruence which is unsensitive to observations (a) and (b). Must semantics is unsensitive to outcomes (b) and (c).Checking testing equivalence between processes is usually difficult because one has to verify the coincidence of observables over all possible contexts. The expedient to overcome this problemconsists in determining a set of canonical tests which is suitable to establish testing equality. The characterization of these tests in the join-calculus is the main contribution of this paper. Inparticular we prove that the same tests suit both for may and must-testing (and therefore for testing equivalence). This seems odd, if compared to the corresponding property owned byMilner's CCS, for instance [7]. Therefore some insights on our results may be useful. Let P be a join-calculus process. Each test C[ ] allows to check the immediate emissions only,that is the messages emitted by C[P ] after a sequence of internal moves. In order to check forsuccessive emissions we have to plug C[P ] into other contexts which define free variables of C[P ], and so on. It follows that may-tests are sequences of nested definitions. The crucial pointis to realize that may-tests can be rid of computational rules replacing patterns of messages with complex processes. Better, the relevant tests for may-testing have the shape: def J1 B K1 in \Delta \Delta \Delta def Jn B Kn in [ ] j K : where Ji, Ki, K are multisets of emissions xhu1; \Delta \Delta \Delta ; uhi. After that, the striking observation isthat the same tests allows to check for the alternative presence of a set of emissions. To this purpose it suffices to define separately each variable which is emitted. These latter tests allowin some sense to encode the must-tests of [7], thus justifying our contribution. Finally, thanks to the elaborate synchronization schema of the join-calculus, it is also possible to test for thesimultaneous presence of a multiset of emissions. In other words, the testing approach in the UBLCS-96-4 2 2 The join-calculus join-calculus gives a multiset testing semantics.The structure of the paper is as follows. In Section 2 we present the join-calculus, namely its syntax, the structural equivalence and the reduction relation. Our contribution starts at Section 3with the definition of may-testing semantics and few simple properties about it. Section 4 is devoted to the proof of the Context Lemma for the may-semantics. Evidence is given to theimportance of this result for checking semantic relations. The must-semantics is defined in Section 5. In the same section it is also proved the Context Lemma for must-testing. TheConclusion contains few remarks on related works and some issues for future research. 2 The join-calculus Let V be a countable set of variables fx; y; z; u; v; \Delta \Delta \Delta g, each of them comes with an arity. Let ev bea tuple of variables in V. We shall write xhevi provided that the length of the tuple ev is equal tothe arity of x. This amounts to use a recursive sort discipline and to consider only well-sortedprocesses. A process P , a definition D and a join pattern J are inductively defined by the followingsyntax: P ::= xhevi j def D in P j P j P D ::= J B P j D and D J ::= xhevi j J j J In an elementary definition J B P , where J = x1h ev1i j \Delta \Delta \Delta j xkh evki, we shall always assume thatvariables in e vi are pairwise distinct; similarly the sets f evig; f evjg and fx1; \Delta \Delta \Delta ; xkg are mutuallydisjoint, with i 6= j. The set f ev1; \Delta \Delta \Delta ; evkg is called the set of received variables of J (notation rv(J)); fx1; \Delta \Delta \Delta ; xkg is the set of defined variables of J (notation dv(J)), which lifts to definitions as follows: dv(J1 B P1 and \Delta \Delta \Delta and Jk B Pk) = [ 1^i^k dv(Ji) Finally, the set of free variables of a definition D (resp. process P ), written fv(D) (resp. fv(P )), isdefined inductively as follows: fv(J B P ) = dv(J) [ (fv(P ) n rv(J)) fv(D and D0) = fv(D) [ fv(D0) fv(xhevi) = fx; evg fv(def D in P ) = (fv(P ) [ fv(D)) n dv(D) fv(P j Q) = fv(P ) [ fv(Q) The process xhevi is called atom. The following ones are syntactical definitions: Definition 2.1 A process is simple if it is the parallel composition of atoms. A definition is simple whenit has the shape J B K, where K is a simple process. Simple definitions will play an important role in the theory we are going to develop. 2.1 The structural equivalence The structural equivalence j is the least congruence over processes, definitions and patterns satis-fying the following axioms: ffl let P be ff-equivalent to Q, then P = Q; ffl P j Q = Q j P , (P j Q) j R = P j (Q j R); ffl if dv(D) " fv(P ) = ? then P j def D in Q = def D in (P j Q); ffl if fv(D) " fv(D0) = ? then def D in def D0 in P = def D0 in def D in P ; ffl D and D0 = D0 and D, D and (D0 and D00) = (D and D0) and D00, D and D = D; ffl J j J0 = J0 j J.It is immediate by induction on the definition of j (including the rules of reflexivity, symmetry,transitivity and congruence) that P j Q entails fv(P ) = fv(Q) and that P j def D1 in \Delta \Delta \Delta def Dn in J,for some D1; \Delta \Delta \Delta Dn; J. UBLCS-96-4 3 2 The join-calculus 2.2 The reduction relation The reduction relation is the set of o/ -transitions of a labelled transition system ffi\Gamma !, where ffi rangesover fJ B P g [ fo/ g. The transition relation is the smallest relation such that for every J B P , Jae J BP\Gamma ! P ae ae is a renaming of rv(J) and for every transition P ffi\Gamma ! P 0, P j Q ffi\Gamma ! P 0 j Q def D in P ffi\Gamma ! def D in P 0 if fv(D) " dv(ffi) = ; def D in P o/\Gamma ! def D in P 0 if D = ffi or D = ffi and D0 Q ffi\Gamma ! Q0 if P j Q and Q0 j P 0 We give some examples of processes together with a description of their meaning. (the forwarder) The process def xhui B yhui in P behaves as P except that every emission over x is captured by the definition xhui B yhui andtransformed into an emission on y. More precisely the above process is equivalent, up-to aninternal move, to the process P [y=x], where \Gamma [\Gamma =\Gamma ] is the substitution operator. (the chaos) The process \Omega def= def xhi B xhi in xhi is the most undefined process (in our semantics). It performs an infinite sequence of internalmoves and it is reminiscent of the term (*x: xx)(*x: xx) in the *-calculus. (the internal and external nondeterminism) The process def xhi B P and xhi B Q in xhi encodes internal nondeterminism. It may become P or Q by means of an internal move. Thischoice is by no means affected by the environment. The process def uhi j chi B P and vhi j chi B Q in xhu; vi j chi encodes external nondeterminism. It may become P or Q according to the environment emitsan atom uhi or vhi. In virtue of the static scoping discipline, this is possible provided that a ruleinvolving the atom xhu; vi is fired. Indeed, it is the participation of xhu; vi into a rule which allowsto extrude the variables u and v out of the enclosing definition uhi j chi B P and vhi j chi B Q. Theatom chi guarantees that at most one of the processes P and Q is triggered. The transition system of the join-calculus, restricted to o/ -moves, is finite branching. Proposition 2.2 (Finite branching property) For every P , f[P 0] j P o/! P 0 and P 0 j [P 0]g is finite. Proof: By definition every process may emit a finite number of atoms. Moreover emissions maybe enclosed by a finite number of definitions. Now observe that a finite number of emissions may trigger definitions in a finite number of different ways. Henceforth the finiteness of successors ofprocesses. UBLCS-96-4 4 3 The may-testing semantics 3 The may-testing semantics The only way for a process to communicate with the environment is eventually to emit a messageon one of its free variables. The emission of a message is formalized by the following predicate +m. We first define the immediate emission on a particular variable x, in notation P # x, as the leastpredicate satisfying: 1. xhevi # x; 2. P # x implies (P j Q) # x; 3. P # x and x 62 dv(D) imply (def D in P ) # x. Remark 3.1 1. P # x implies x 2 fv(P ); 2. an immediate emission cannot be destroyed by reductions, namely if P # x and P o/\Gamma ! Q then Q # x. Definition 3.2 The may-emission relation is defined by: P +m x def= 9Q: P o/\Gamma ! \Lambda Q and Q # x: We shall write P 6+m x when P +m x is false. When P +m x we say P may-emits on x, and we shalloften omit the prefix "may". Remark 3.3 It is important to note that in the join-calculus we are forced to observe outputs only. Thisbecause inputs are hidden in the definitions. In other calculi, the choice of observations is questionable [1, 2, 9]. Proposition 3.4 P +m x and P j Q imply Q +m x. This is an immediate consequence of definitions of may-emission and structural equivalence.The semantics we are going to define is the may-testing preorder. Firstly let us introduce the join-calculus contexts as the set of processes with exactly one hole [ ] in the place where a processmay appear. Contexts are ranged over by C[ ]. Definition 3.5 The may-testing preorder is the relation vm over processes defined by P vm Q def= 8C[ ]: 8x: C[P ] +m x ) C[Q] +m x Two processes P and Q are may-testing equivalent, in notation P 'm Q, if P vm Q and Q vm P . Both the may-testing preorder and the may-testing equivalence are pre-congruences, by defi-nition. By Proposition 3.4 we have the following: Corollary 3.6 P j Q implies P vm Q. A few examples should clarify the discriminating power of the may-testing preorder. Forevery process P : ffl \Omega vm P (recall that \Omega def= def xhi B xhi in xhi). This because, for every context C[ ],if C[\Omega ] +m y then there must be a derivation oe of C[\Omega ] which never uses the definition xhi B xhi. Observe that oe is also a derivation of C[P ]; ffl P 'm def xhi B xhi and xhi B P in xhi (we assume x 62 fv(P )). This because, at eachmoment, the process def xhi B xhi and xhi B P in xhi may behave as P or perform aninternal move and may-testing is unsensitive to internal moves; UBLCS-96-4 5 4 The context lemma for the may-testing ffl P [z=x] 'm def xheui B zheui in P . Because every emission on x by P is replaced by anemission on z in P [z=x]. This replacement is explicitly defined in def xheui B zheui in P at thecost of an internal move. In standard process algebras (CCS, CSP, ss-calculus, etc.) may-testing coincides with tracesemantics [7]. In join-calculus this coincidence fails because the synchronization schemas allow to test for the presence of multisets of messages (see Remark 3.7 below). So we get some sort ofmultiset trace semantics. However this is still not so evident because definitions combine in a single place the operation of restriction, reception and replication of ss-calculus (the reader mayget some evidence by looking at the encoding of the core join-calculus into the ss-calculus in [6]).For instance yhi vm def xhi B yhi and xhi B zhi in xhi but the vice versa is false because the process in the right may also emit on z. Now take the process P = def xhui B yhui in zhxi : The environment recognizes immediately that P emits on z. However it is also possible to testthat P emits on y after the emission on z. To this aim take the context C[ ] = def zhvi B vhwi in [ ] and observe that C[ ] distinguishes between P and zhxi, for instance.It is also possible to count the number of times a definition is used (this is an expedient we will exploit in the proofs). For example in order to count how many times the definition J B Qis used in def J B Q in Q0, consider the process def J B Q j dhi in Q0 where d is a fresh variable.When the process reaches a stable state (no transition is possible) the foregoing number is given by the amount of emissions on d. Remark 3.7 Alternative definitions of may-testing, still equivalent to the foregoing one, may be providedby taking one of the following basic observations: 1. P may-converges if and only if there exists x such that P +m x;2. P may-converges to fjx1; \Delta \Delta \Delta ; xnjg (fj jg is the multiset constructor) if there exist P 0 such that P o/! \Lambda P 0 and P 0 emits on the multiset fjx 1; \Delta \Delta \Delta ; xnjg. This last predicate can be formalizedgeneralizing the definition of immediate emission. 4 The context lemma for the may-testing Due to the universal quantification over contexts, it is difficult to prove or disprove P vm Q. Wenow prove a property, called the context lemma, which establishes that, in order to test a process, it is enough to plug it into a restricted set of contexts. These contexts, ranged over by T [ ] andcalled simple contexts, are those given by the grammar: T [ ] ::= [ ] j [ ] j K j def J B K in T [ ] where K is simple process. simple processNamely, the generic shape of a simple context is: def J1 B K1 in \Delta \Delta \Delta def Jn B Kn in [ ] j K : Observe that the definitions in the above contexts are always simple. Simple contexts induce thefollowing preorder: P vs Q def= 8T [ ]: 8x: T [P ] +m x ) T [Q] +m x (the index s stays for "simple"). Clearly vm`vs but the vice versa is by no means obvious. Inorder to prove the coincidence of vm and vs it is enough to prove that vs is a pre-congruence.This is the purpose of the following propositions. The proof technique consists in encoding the behaviours induced by generic contexts into behaviours of simple ones. UBLCS-96-4 6 4 The context lemma for the may-testing It turns out that a satisfactory formalization of the following proof must use a labelled variantof the join-calculus. Let \Psi be a countable set of labels and ff 2 \Psi . The labelled join-calculus issimilar to the one defined in Section 2 with the following changes: ffl definitions are generated by the following grammar: D ::= J B P j J Bff P j D and D ffl the reduction relation is enriched by adding the following rule: P J BQ\Gamma ! P 0 implies def J Bff Q in P ff\Gamma ! def J Bff Q in P 0 def J Bff Q and D in P ff\Gamma ! def J Bff Q and D in P 0 It is possible to generalize may-emission in order to take into account transitions labelled in \Psi [ fo/ g. Namely P ++m x def= 9Q: P \Gamma !\Lambda Q and Q # x: where \Gamma !\Lambda denotes a sequence of transitions labelled in \Psi [ fo/ g. Proposition 4.1 1. Let P be a process, syntactically equal to Q, up-to labels of definitions. Then P ++m x if and only if Q ++m x.2. Let P be an unlabelled process (definitions miss of labels); let Q be a process syntactically equal to P , up-to labels of definitions. Then P +m x if and only if Q ++m x. In virtue of the foregoing proposition we can safely reason on labelled processes and carryingthe results over the unlabelled ones. In particular, we shall always consider well-labelled processes: Definition 4.2 A process is well-labelled when every definition D is generated by the following syntax: D ::= J B K j J Bff P j D` and D` (K is simple; P is not simple) D` ::= J Bff Q j D` and D` and labels are pairwise different. Informally, a process is well-labelled when every not simple definition is labelled by a unique label. Proposition 4.3 P vs Q implies P j R vs Q j R, for every process R. Proof: We assume that R is well labelled. Let T [ ] be a simple context such that T [P j R] ++m xand T [Q j R] 6++m x. Let oe be the derivation T [P j R] \Gamma !\Lambda P 0 # x, and let n be the number ofreductions along oe which are marked by labels in \Psi . By induction on n we prove that, for every R and for every context T [ ] such that T [P j R] \Gamma !\Lambda P 0 # x, with n0 transitions marked in \Psi , and T [Q j R] 6++m x and n0 ^ n, there exists a simple context T 0[ ] such that T 0[P ] +m x and T 0[Q] 6+m x.Without loss of generality we may assume that R = def D1 in \Delta \Delta \Delta def Dr in J and boundvariables in R are different from variables in P and Q.( n = 0) Then only simple definitions Di are used along oe. Let D0i be Di if Di is simple and D0ibe x1h ev1i j \Delta \Delta \Delta j xhhfvhi j ahi B ahi, where dv(Di) = fx1; \Delta \Delta \Delta ; xhg and where a is a fresh variable (withrespect to those used in P; Q and R), otherwise. The simple context T 0[ ] is defined as follows: T 0[ ] = T [def D01 in \Delta \Delta \Delta def D0r in ([ ] j J)] (n ? 0) Let fl1 \Delta \Delta \Delta fln be the sequence of labels in \Psi along oe and let Di be the first definition in R such that a label in Di occurs in fl1 \Delta \Delta \Delta fln. Let T1[ ] = def D01 in \Delta \Delta \Delta def D0i\Gamma 1 in [ ] where D0j is defined as in the basic case (with respect to definitions D1; \Delta \Delta \Delta ; Di\Gamma 1). There are twosubcases: UBLCS-96-4 7 4 The context lemma for the may-testing 1. Di is J0 Bff R0. Let c be the number of occurrences of ff in fl1 \Delta \Delta \Delta fln and let fv(R0) = fx1; \Delta \Delta \Delta ; xtg. Consider the following context T2[ ]: T2[ ] = def x1h eu1i j dx1hvi B vh eu1i j dx1hvi in. .. def xth euti j dxthvi B vh euti j dxthvi in ([ ] j dhdx1; \Delta \Delta \Delta ; dxti) where d and dxi are fresh variables. Now consider the context T3[ ]: T3[ ] = def J0 j dhdx1; \Delta \Delta \Delta ; dxti B dx1hx1i j \Delta \Delta \Delta j dxthxti in [ ] and let T 4[ ] = T1[ T3[ ] ] R00 = (def Di+1 in \Delta \Delta \Delta def Dr in J) j T2[R0] j \Delta \Delta \Delta j T2[R0]-- -z "" c times where the labels in the istances of R0 in R00 are pairwise different. It is possible to verifythat T [ T4[P j R00] ] +m x and T [ T4[Q j R00] ] 6+m x. Moreover T [ T4[P j R00] ] shows up x witha number of reductions labelled in \Psi which is strictly less then n.2. Di is J1 Bff1 R1 and \Delta \Delta \Delta and Ji0 Bffi 0 Ri0. Let fi1 \Delta \Delta \Delta fic be the subsequence of fl1 \Delta \Delta \Delta fln such that flj 2 fff1; \Delta \Delta \Delta ; ffi0g. We denote with J(k) Bfik R(k) the subdefinition of Di labelled by fik. Let J(k) = xk1 h ev1i j \Delta \Delta \Delta j xkekh fveki, e = Pck=1 ek and dv(D) = fx1; \Delta \Delta \Delta ; xe0g (observe that e * e0). Let mkj = maxfs j J(k) j xjh ev1i j \Delta \Delta \Delta j xjh evsi-- -z "" s times j J0g Mj = Pck=1 mkj Let eaj = aj1; \Delta \Delta \Delta ; ajMj+1. The sets eaj and d1; \Delta \Delta \Delta ; de0 are all fresh variables with respect to those in P; Q; R. Let H[ ] = def x1h ev1i j d1ha0; eb1i B a0hx1; ev1i j d1h eb1; a0i in. .. def xe0hfve0 i j de0ha0; fbe0i B a0hxe0; fve0i j de0hfbe0; a0i in [ ] and let A = aM1+1h eu1i j \Delta \Delta \Delta j aMe0+1h fue0i in C[ ] = def A B A in def ae\Gamma echyc1; ev1i j \Delta \Delta \Delta j aehycec ; evci B Rec in. .. def a1hy11; ev1i j \Delta \Delta \Delta j ae1hy1e1 ; evci B Re1 in [ ] j d1h ea1i j \Delta \Delta \Delta j de0h fae0i where al and ykj are defined as follows: ffl al is asr if over the first l-th emissions in the sequence J(1) \Delta \Delta \Delta J(c) there are exactly remissions on xs; ffl ykj = xkj if over the first j emissions in the sequence J(k) (fix an ordering for J(k)) there is exactly one emission on xkj . Otherwise ykj is a fresh variable.Observe that definitions in C[ ] are not simple in general. Let R00 = H[C[def Di+1 in \Delta \Delta \Delta def Dr in J]] : where Re1; \Delta \Delta \Delta ; Rec are such that labels are pairwise different. It is possible to prove thatthere is a derivation of T [T1[R00 j P ]] which emits x by using at most n-times not simpledefinitions in R00. Similarly no derivation of T [T1[R00 j Q]] emits x. Finally remark that itis possible to transform R00 as described in the subcase 1. This allows to apply inductivehypothesis and terminate the proof. UBLCS-96-4 8 4 The context lemma for the may-testing Proposition 4.3 has an immediate consequence: Corollary 4.4 P vs P 0 and Q vs Q0 imply P j Q vs P 0 j Q0. Proposition 4.5 P vs Q implies def D in P vs def D in Q, for every definition D. Proof: The proof is along the lines of the one of Proposition 4.3. Indeed, if def D in P 6vs def D in Q, by means of the technique developed in Proposition 4.3, it is possible to define asimple context T [ ] such that T [P j R] +m x and T [Q j R] 6+m x, for some R and x. This means that P j R 6vs Q j R and, by Proposition 4.3, this entails P 6vs Q. Proposition 4.6 P vs Q implies def J B P in R vs def J B Q in R and def J B P and D in R vsdef J B Q and D in R, for every definition D and process R. Proof: Let DP and DQ be J B P and J B Q, respectively, or J B P and D and J B Q and D, re-spectively. Let T [ ] be a simple context which discriminates between def DP in R and def DQ in Rand let oe be a derivation of T [def DP in R] showing up x and let n be the number of times thedefinition J B P is used along oe. We consider the case DP = J B P and D, the other beingsimpler. Let fv(P ) = fx1; \Delta \Delta \Delta ; xk; y1; \Delta \Delta \Delta ; yhg and fv(Q) = fx1; \Delta \Delta \Delta ; xk; z1; \Delta \Delta \Delta ; zlg with xi 6= yj 6= zr. Take H[ ] = def x1h eu1i j dx1hvi B vh eu1i j dx1hvi in. .. def xkhfuki j dxkhvi B vhfuki j dxkhvi in def y1h ev1i j dy1hvi B vh ev1i j dy1hvi in. .. def yhhfvhi j dyhhvi B vhfvhi j dyhhvi in def z1hfw1i j dz1hvi B vhfw1i j dz1hvi in. .. def zlhfwli j dzlhvi B vhfwli j dzlhvi in [ ] j dhdx1; \Delta \Delta \Delta ; dxk; dy1; \Delta \Delta \Delta ; dyh; dz1; \Delta \Delta \Delta ; dzli where d and dxi; dyi; dzi are fresh variables with respect to those in P; Q; R. Now take \Delta , \Delta hXiand the context C[ ] defined below: \Delta = dx1; \Delta \Delta \Delta ; dxk; dy1; \Delta \Delta \Delta ; dyh; dz1; \Delta \Delta \Delta ; dzl \Delta hXi = dx1hx1ij \Delta \Delta \Delta jdxkhxkijdy1hy1ij \Delta \Delta \Delta jdyhhyhijdz1hz1ij \Delta \Delta \Delta jdzlhzli C[ ] = def J j dh\Delta i B \Delta hXi and D in [ ] It is possible to show that T [C[R j H[P ] j \Delta \Delta \Delta j H[P ]-- -z "" n times ]] +m x T [C[R j H[Q] j \Delta \Delta \Delta j H[Q]-- -z "" n times ]] 6+m x and, by Proposition 4.5 and Corollary 4.4, this implies P 6vs Q. Corollary 4.7 The relation vs is a pre-congruence. Lemma 4.8 (The context lemma for the may-testing) vs coincides with vm. UBLCS-96-4 9 5 The must-testing semantics Proof: The containment vm`vs is obvious by definition. Let us prove vs`vm. Let P vs Q and C[P ] +m x, where C[ ] is a (generic) context. Then C[P ] vs C[Q] because vs is a pre-congruence.This implies that C[Q] +m x. The context lemma is important for several reasons. It shows that the may-semantics of aprocess is completely characterized by replacing multiset of emissions on free variables with other multisets of emissions. In a sense, what counts of a process is its reaction in terms of emissionsto stimuli which are also emissions. It is useless to look at complex reactions. Moreover, by restricting the universal quantification over contexts, the context lemma allows us to prove moreeasily some semantic relations. For instance, let us check the following: 8P: fv(P ) = ? ) \Omega 'm P : It suffices to verify that, for every simple context T [ ] and for every x, T [\Omega ] +m x if and only if T [P ] +m x. Since both \Omega and P are closed, there exists a Q such that T [\Omega ] j Q j \Omega and T [P ] j Q j P .Then, by definition of may-emission and the hypothesis fv(P ) = ?, Q j \Omega +m x if only if Q +m xif only if Q j P +m x. This entails \Omega 'm P . Remark 4.9 By the proof of the context lemma it appears that simple contexts are in some sense a minimalset of tests for checking whether two processes are may-testing equivalent or not. The existence of a smaller set of tests is a question that this paper leaves open. Surely, if this is the case, one should provide completelydifferent proofs. 5 The must-testing semantics In the may-testing approach the relevant tests for processes were the ability to respond positively toa test. Must testing is obtained by changing the relevant tests into the inability to respond negatively to a test. Namely a process P is considered less specified than the process Q if, whenever P mustrespond positively to a particular test, Q must respond positively, too.It turns out that a satisfactory formalization of the must-testing semantics must take into account the notion of maximal computation. We say that P1 o/\Gamma ! \Delta \Delta \Delta o/\Gamma ! Pn is maximal Pn is terminal, namely there is no Q such that Pn o/\Gamma ! Q, noted with Pn 6!. Definition 5.1 The must-emission relation is defined as follows: P1 +M x if, for every maximal compu-tation P1 o/\Gamma ! \Delta \Delta \Delta o/\Gamma ! Pn o/\Gamma ! \Delta \Delta \Delta there exists k such that Pk # x.We write P 6+M x when P +M x is false. When P +M x we say P must-emits on x, and we shalloften omit the prefix "must". In the following we note P \Gamma !n P 0 when there is a computation P = P1 o/\Gamma ! \Delta \Delta \Delta o/\Gamma ! Pn = P 0. Proposition 5.2 P +M x if and only if there exists n such that the following items hold:1. (P \Gamma !m P 0 6! ^ m ! n) ) P 0 # x;2. (P \Gamma !n 0 P 0 ^ n0 ? n) ) P 0 # x. Proof: The if-direction is obvious. Let us check the only-if one. Assume that, for every n, (P \Gamma !m P 0 6! ^ m ! n ^ P 0 6# x) or (P \Gamma !n 0 P 0 ^ n0 ? n ^ P 0 6# x) We prove that P 6+M x. This is immediate when P \Gamma !m P 0 6! ^ m ! n ^ P 0 6# x because, byRemark 3.1, emission is persistent over transitions. Let P \Gamma !n 0 P 0 ^ n0 ? n ^ P 0 6# x. Let T = lim n Tn, where Tn is inductively defined asfollows: UBLCS-96-4 10 5 The must-testing semantics 1. T0 is the tree with the node (P; 0) and without edges; 2. Tn+1 is the tree Tn where an edge is added to every leaf (P; n) such that P 6# x and P o/\Gamma ! P 0.The edge connects (P; n) and (P 0; n + 1). T is finite branching, by Proposition 2.2. Moreover, by hypothesis, Tn+1 6= Tn. Then, by the K"onigLemma, T has an infinite path. This means there exists a maximal computation P = P1 o/\Gamma ! P2 o/\Gamma ! \Delta \Delta \Delta such that, for every i, Pi 6# x. Hence P 6+M x. Proposition 5.3 P +M x and P j Q imply Q +M x. Now we can define the must-testing preorder. Definition 5.4 The must-testing preorder is the relation vM over processes defined by P vM Q def= 8C[ ]: 8x: C[P ] +M x ) C[Q] +M x Two processes P and Q are must-testing equivalent, in notation P 'M Q, if P vM Q and Q vM P . Must-testing preorder and equivalence are pre-congruences, by definition. An immediateconsequence of Proposition 5.3 is: Corollary 5.5 P j Q implies P vM Q. We examine the discriminating power of must-testing through some examples which alsohighlight differences with may-testing. For every process P and Q: ffl \Omega vM P because, informally, if C[\Omega ] +M y then every derivation oe starting at C[\Omega ] mustconverge. This means that the process \Omega is never "enabled" along oe. Therefore also P isnever enabled along derivations of C[P ]. ffl let x 62 fv(P ) [ fv(Q). Then \Omega j def xhi B P in xhi 'M \Omega j def xhi B Q in xhi; ffl let 0 = def xhi j yhi B xhi in xhi. Observe that 0 6vM \Omega . For example take the context C[] = def zhi B ahi in [] j zhi. It happens that C[0] +M a while C[\Omega ] 6+M a because of thecomputation C[\Omega ] o/\Gamma ! C[\Omega ] o/\Gamma ! \Delta \Delta \Delta and C[\Omega ] 6# a.Notice that the second and third items establish that may and must-testing are uncomparable. The first item decrees that \Omega is the least process in the must-testing scenario, too. It is alsoworth noting that must-testing remains unchanged by taking the "must-adaptations" of the basic observations defined in Remark 3.7. Since we are not primarily concerned with these refinementshere, we overlook this issue. The surprising property (at least for us) of the join-calculus is that, up-to the basic observations,the must-testing preorder holds the same context lemma of the may-testing one. This is false in Milner's CCS, for instance [7]. In order to show that simple contexts suffice, let P vS Q def= 8T [ ]: 8x: T [P ] +M x ) T [Q] +M x where T [ ] are the simple contexts defined in the previous section. The proof for checking thecoincidence of vM and vS carries over along the same lines as the one of Lemma 4.8. Nemely,we (re)consider the labelled join-calculus and the relation P ++M x which is similar to the must-emission, except that it forgets labels. We also omit the adaptation of Proposition 4.1 to the case of must-testing. For running the induction in the case of must-testing it is crucial a measureof complexity of well-labelled processes, noted ", which gives a sequence of integers an \Delta \Delta \Delta a0.Foremost let us define the complexity of a not simple definition labelled ff in a well-labelledprocess P , noted [(P; ff), by structural induction over P as follows: UBLCS-96-4 11 5 The must-testing semantics 1. if P = P1 j \Delta \Delta \Delta j Pn and ff occurs in Pi then [(P; ff) = [(Pi; ff); 2. if P = def J1 Bfi1 Q1 and \Delta \Delta \Delta and Jk Bfik Qk in R and ff 2 ffi1; \Delta \Delta \Delta ; fikg then [(P; ff) = 1; 3. if P = def D in R and ff occurs in R then [(P; ff) = [(R; ff); 4. if P = def J1 Bfi1 Q1 and \Delta \Delta \Delta and Jk Bfik Qk in R and ff occurs in Qi then [(P; ff) = [(Qi; ff) + 1. The complexity of a label is robust with respect to structural equivalence: Proposition 5.6 If P j Q then [(P; ff) = [(Q; ff). Finally, the complexity of a well-labelled process P , noted "(P ) is the sequence of integer an \Delta \Delta \Delta a0 such that ai is the cardinality of the set of labels ff such that [(P; ff) = i + 1. Proposition 5.7 P vS Q implies P j R vS Q j R, for every process R. Proof: For every , and for every R such that "(R) = , and T [P j R] ++M x and T [Q j R] 6++M x,for some T [ ], we show the existence of a T 0[ ] such that T 0[P ] +M x and T 0[Q] 6+M x. We argueby induction on ,, where sequences are ordered by the lexicographic ordering. Without loss ofgenerality we assume R = def D1 in \Delta \Delta \Delta def Dr in J. (, = 0) Obvious. (, = an \Delta \Delta \Delta a0) Let T [P j R] +M x and let oe be a maximal computation of T [Q j R] never emittingon x.If no label in \Psi occurs along oe then let R0 = H1[\Delta \Delta \Delta Hr[ ] \Delta \Delta \Delta ] where Hi[ ] = def Di in [ ]if Di is simple and Hi[ ] = def x1h ev1i B x1h ev1i in \Delta \Delta \Delta def xhhfvhi B xhhfvhi in [ ] if Diis not simple and dv(Di) = fx1; \Delta \Delta \Delta ; xhg. It is easy to prove that T [P j R0] +M x and T [Q j R0] 6+M x. Remark also that by the structural equivalence T [P j R0] and T [Q j R0] maybe easily transformed into T 0[P ] and T 0[Q], for some simple context T 0[ ].Otherwise, let Di be the not simple definition of R whose label (or a label of a componentdefinition) ff occurs as first label in \Psi along oe. There are three subcases: 1. Di is J Bff S or Di is a sub-definition, namely J1 Bfi1 R1 and \Delta \Delta \Delta and Ji0 Bfii 0 Ri0, ff 2 ffi1; \Delta \Delta \Delta ; fii0g and no fik is the first label in \Psi occurring along oe.Let R0 = H1[\Delta \Delta \Delta Hr[ ] \Delta \Delta \Delta ] where Hj[ ] = def Dj in [ ] if Dj is simple; Hi[ ] = def x1h ev1i B x1h ev1i in \Delta \Delta \Delta def xhhfvhi B xhhfvhi in [ ] where dv(Di) = fx1; \Delta \Delta \Delta ; xhg; Hj[ ] = def x1h ev1i B xhevi in \Delta \Delta \Delta def xhhfvhi B xhevi in [ ] if Dj is not simple and dv(Dj) = fx1; \Delta \Delta \Delta ; xhg. It is easy to show that T [R0 j P ] +M x and T [R0 j Q] 6+M x. 2. Di is a sub-definition, namely J1 Bfi1 R1 and \Delta \Delta \Delta and Ji0 Bfii 0 Ri0, ff 2 ffi1; \Delta \Delta \Delta ; fii0g and no derivation of T [P j R] has ff as first label in \Psi . Let ff = fik and let dv(Di) n dv(Jk) = fy1; \Delta \Delta \Delta ; yh0 g. Remark that, by hypothesis, fy1; \Delta \Delta \Delta ; yh0g is not empty. Nowtake R0 = H1[\Delta \Delta \Delta Hr[ ] \Delta \Delta \Delta ] where Hj[ ] = def Dj in [ ] if Dj is simple; Hi[ ] = def Jk B Jk in def y1h ev1i B xhevi in \Delta \Delta \Delta def yh0 h fvh0 i B xhevi in ([ ] j xhevi); and Hj[ ] = def x1h ev1i B xhevi in \Delta \Delta \Delta def xhhfvhi B xhevi in [ ] if i 6= j and Dj is not simple and dv(Dj) = fx1; \Delta \Delta \Delta ; xhg. It is possible to prove that T [P j R0] +M x and T [Q j R0] 6+M xand T [P j R0] and T [Q j R0] may be easily transformed into T 0[P ] and T 0[Q], for some T 0[ ]. 3. There is a derivation of T [P j R] having ff as first label in \Psi . There are two subcases.( Di is J0 Bff R0). Let fv(R0) = fx1; \Delta \Delta \Delta ; xtg and let n be the integer of Proposition 5.2.This means that every derivation of T [P j R] emits x with at most n transitions labelled ff. Now take the following context H[ ]: H[ ] = def x1h eu1i j dx1hvi B vh eu1i j dx1hvi in. .. def xth euti j dxthvi B vh euti j dxthvi in [ ] j dhdx1; \Delta \Delta \Delta ; dxti j d0hi UBLCS-96-4 12 5 The must-testing semantics where d, d0 and dxi are fresh variables. Let \Delta = d0hi j \Delta \Delta \Delta j d0hi-- -z "" n times and: H0[ ] = def \Delta B \Delta in def J j dhdx1; \Delta \Delta \Delta ; dxti B dx1hx1i j \Delta \Delta \Delta j dxthxti in [ ] Finally let R00 = def D1 in \Delta \Delta \Delta def Di\Gamma 1 in H0[def Di+1 in \Delta \Delta \Delta def Dr in J j H[R0] j \Delta \Delta \Delta j H[R0]-- -z "" n times ] It follows that T [P j R00] +M x and T [P j R00] 6+M x. Furthermore, notice that "(R00) ! "(R) (assuming that occurrences of R0 in R00 have different labels). This allows to applyinductive hypothesis. (Di is J1 Bfi1 R1 and \Delta \Delta \Delta and Ji0 Bfik Ri0). Let ff = fik and let dv(Di) = fx1; \Delta \Delta \Delta ; xtg.Take mj = maxfm j Jk j xjh ev1i j \Delta \Delta \Delta j xjh fvmi-- -z "" m times j J0g M = maxfm1; \Delta \Delta \Delta ; mtg : Moreover let edi = dix1; \Delta \Delta \Delta ; dixt, where dixj = dxj if i ^ mj and dixj = d0xj otherwise. Observe that dM+1xj = d0xj and let \Delta k = ed1; \Delta \Delta \Delta ; gdM+1. Now consider the operation lshiftM+1i defined as follows: lshiftM+1i (\Delta k) = d1x1; \Delta \Delta \Delta ; d2xi; \Delta \Delta \Delta ; d1xt; \Delta \Delta \Delta ; dMx1 ; \Delta \Delta \Delta ; dM+1xi ; \Delta \Delta \Delta ; dMxt ; gdM+1 When j 6= k let \Delta j = cjx1 ; cjx1; \Delta \Delta \Delta ; cjxt; cjxt. We define \Delta = \Delta 1; \Delta \Delta \Delta ; \Delta t lshift(\Delta ) = lshift21(\Delta 1); \Delta \Delta \Delta ; lshiftM+1k (\Delta k); \Delta \Delta \Delta ; lshift2t(\Delta t) H[ ] = def x1h ev1i j dh\Delta i B d1x1hx1; ev1i j c1x1hi j \Delta \Delta \Delta j ctx1hi j dhlshift(\Delta )i in. .. def xth evti j dh\Delta i B d1xthxt; evti j c1xthi j \Delta \Delta \Delta j ctxthi j dhlshift(\Delta )i in [ ] j dh\Delta i Moreover, when j 6= k, let Jch1j be the pattern Jj where each atom xih ewi has been replaced by cjxihi; Jch1k be the pattern Jk each atom xih ewi has been replaced by dxihxi; ewi; Jch2j be the pattern Jj where each atom xih ewi has been replaced by d0xihxi; ewi; Dd 0 i bethe definition Di where each Jj has been replaced by Jch2j .Consider H0[ ] = def Jch1k B Rk in def Dd 0 i in def Jch11 B xheui in. .. def Jch1k\Gamma 1 B xheui in def Jch1k+1 B xheui in. .. def Jch1i0 B xheui in xheui in [ ] Finally, let R0 = def D1 in \Delta \Delta \Delta def Di\Gamma 1 in H0[H[def Di+1 in \Delta \Delta \Delta def Dr in J]] : UBLCS-96-4 13 5 The must-testing semantics It is possible to prove that T [P j R0] +M x and T [Q j R0] 6+M x. On T [P j R0] and T [Q j R0] we eventually reiterate the above argument (if Rk is a simple process) or usethe subcase 2 and simplify the complexity of R0. Remark also that the reiteration isused a finite number of times because, by Proposition 5.2, there exist n such that everycomputation of T [P j R0] emits x with at most n transitions. The proof of Proposition 5.7 deserves few comments, in particular the proof of the item 3. Inthis case there is a maximal computation oe of T [Q j R] (which never emits on x) whose first label ff 2 \Psi marks a not simple definition Di of R. There is also a derivation oe0 of T [P j R] whose firstlabel in \Psi is ff. There are two cases: Di is J0 Bff R0 or Di is J1 Bfi1 R1 and \Delta \Delta \Delta and Ji0 Bfii 0 Ri0 (ff = fik). When Di is J0 Bff R0, the number of derivations marked ff before oe0 emits on x isbound by n, where n is given by Proposition 5.2. This means that R0 may be instantiated at most n times. The proof states that this instantiation may be performed once at all without altering themust emission on x. The reader is invited to check that every maximal computation of T [P j R00]eventually emits on x. The case when Di is J1 Bfi1 R1 and \Delta \Delta \Delta and Ji0 Bfii 0 Ri0 (ff = fik) is more subtle. Indeed R0 must be transformed into a "simpler" process R00 by keeping T [P j R00] +M xand T [Q j R00] 6+M x. To this aim the idea is to take the sequence of labels in \Psi along oe and define R00 in such a way that every computation showing up a different sequence of labels in \Psi emits on x. This is the purpose of the Jch1j . The argument by recurrence allows to reiterate the techniqueto transitions of oe after the first labelled ff. Corollary 5.8 P vS P 0 and Q vS Q0 imply P j Q vS P 0 j Q0. With an argument similar to the one used for Proposition 5.7 it is possible to prove: Proposition 5.9 P vS Q implies def D in P vS def D in Q, for every definition D. Proposition 5.10 P vM Q implies def J B P in R vM def J B Q in R and def J B P and D in R vMdef J B Q and D in R, for every definition D and process R. Proof: Let T [ ] be a simple context which discriminates between def DP in R and def DQ in R,where DP and DQ may be J B P and J B Q, respectively, or J B P and D0 and J B Q and D0.Let n be the integer which follows from Proposition 5.2 for T [def DP in R] +M x. Let H[ ] be thesimple context defined in the proof of Proposition 4.6. Now take RP = R j H[P ] j \Delta \Delta \Delta j H[P ]-- -z "" n times RQ = R j H[Q] j \Delta \Delta \Delta j H[Q]-- -z "" n times By Corollary 5.8, RP 6vS RQ implies P 6vS Q. Let us focus on the case when DP be J B P and D0and DQ be J B Q and D0, the other one being simpler.Consider the following context C[ ] where a = k + h + l (see Proposition 4.6 for the definitionsof k; h; l): C[ ] = def cn+1heui B cn+1heui in def cnhd1; \Delta \Delta \Delta ; da; u1; \Delta \Delta \Delta ; uai B d1hu1i j \Delta \Delta \Delta j dahuai in. .. def c1hd1; \Delta \Delta \Delta ; da; u1; \Delta \Delta \Delta ; uai B d1hu1i j \Delta \Delta \Delta j dahuai in def J j dh edi j chc0; eci B c0h ed; exi j chec; c0i and D0 in [ ] j chc1; \Delta \Delta \Delta ; cn+1i If T [def DP in R] +M x and T [def DQ in R] 6+M x then, by construction, T [C[RP ]] +M x and T [C[RQ]] 6+M x. This means that C[RP ] 6vS C[RQ] and, by Proposition 5.9, RP 6vS RQ. Corollary 5.11 The relation vS is a pre-congruence. UBLCS-96-4 14 6 Conclusion Lemma 5.12 (The context lemma for the must-testing) vS coincides with vM . Proof: The containment vM `vS is obvious by definition. Let us prove vS`vM . Let P vS Q and C[P ] +M x, where C[ ] is a (generic) context. Then C[P ] vS C[Q] because vS is a pre-congruence.This implies that C[Q] +M x. Because of the above lemma it is possible to define the may and must-semantics (and theirintersection, the so-called testing semantics [4]) in a uniform way by means of simple contexts. Moreover, as in the may-testing, Lemma 5.12 turns out useful for proving easily semantic relations.The reader is invited to check that 8P: \Omega vM P ; 8P: \Omega j P vM P ; 8P; Q: \Omega j P 'M \Omega j Q.Lemmas 4.8 and 5.12 entail that much of the strength of the join-calculus must be recognized to the elaborate synchronization schema it provides. For instance through join patterns it is possibleto test the alternative presence of a set of actions or the simultaneous presence of a multiset of actions. Precisely, it turns out that elaborate synchronization schema are the unique mechanismfor setting may and must preorders. One should wonder whether even simpler contexts could be used. In [6] it has been proved that the language yielded by stripping away join patternsincluding more than two messages is as much expressive as the full join-calculus. Unfortunately the encoding therein introduces infinite sequences of internal reductions and this invalidates themust-testing preorder, which is sensible to divergence. 6 Conclusion To conclude let us briefly comment on our results with respect to related works and hint to futureresearch. 6.1 Related works The asynchronous version of mobile process algebras has been investigated only recently [2, 9].In particular Honda and Tokoro studied asynchronous bisimulations, whilst Boudol defines may-testing with the purpose of fixing some adequacy results about Milner's encoding of lazy *-calculus into ss-calculus [10]. May-testing has been also used in [3] for determining the discrim-inating power of ss-calculus contexts with respect to the encoding of lazy *-calculus. Howeverboth [2] and [3] miss of any characterization of "canonical" contexts for may-testing, even if some conclusions may be drawn (see below).Switching to synchronous mobile calculi, testing semantics has been studied thoroughly by Boreale and De Nicola in [1] where a proof system and a term model have been provided for ss-calculus. We also recall Hennessy's detailed study of may-testing for an higher order processcalculus with dynamic binding [8]. Also in [1] and in [8] the problem of determining canonical tests has not been addressed. Hennessy is investigating a model for the testing semantics of the ss-calculus. Details of this work are unknown to us. 6.2 The asynchronous ss-calculus Fournet and Gonthier give equivalence result between the core join-calculus and the asynchronous ss-calculus. Therefore it is fair to ask whether the latter also holds a context lemma for testingsemantics. To this aim we foremost observe that there are two kinds of actions that may be observed in asynchronous ss-calculus: inputs and outputs. It turns out that observing inputssuffices, since it is always possible to find a context which firstly consumes all the outputs and then performs an input on a fresh variable. This fits with the may-semantics defined in [2].The results in [3] seem to imply that canonical contexts for may-testing are quite involved. In particular every operator of asynchronous ss-calculus is used (even if we feel that we may ridof replication). This consideration follows by the Separation Lemma, which provides contexts discriminating *-terms with different lazy-trees, and the full-abstraction result (Theorem 7.5). Aprecise characterization of these contexts is still not known. UBLCS-96-4 15 REFERENCES 6.3 The trinity In the terminology of [7], the trinity of a language consists of an operational semantics, a denota-tional one and a proof system, all defining the same congruence over processes. This paper gives only one vertex of the trinity: finding the other twos is an interesting direction of research. Tothis purpose, one soon realizes that the source of problems is the unique, not standard operator: the definition. Let us start with a simple case. The process P = def xheui B R in Q may be modelled in the very same way as let rec x(eu) = R in Q in the usual functional languages. Namely the denotation of P is the least upper bound of the chain of processes Q[R (n) = x], where R(n) is the n-th approximant of the fixpoint of *xeu: R.The problems begin when patterns have at least two messages. In this case the above approach is wrong because in the chain Q[R (n)= x] the patterns which are replaced are those produced by Ror those produced by Q. No chance to replace patterns produced by both R and Q. For instancein the process def xhui j yhvi B xhvi in xhai j yhbi j yhci the second move is caused by a message from R and a message from Q.This issue needs surely further investigation. Perhaps recent progresses on denotational semantics of ss-calculus may help [5, 12]. References [1] M. Boreale and R. De Nicola. Testing equivalence for mobile processes. Information andComputation, 120:279 - 303, 1995. [2] G. Boudol. Asynchrony and the ss-calculus. Technical Report 1702, INRIA Sophia-Antipolis,May 1992. [3] G. Boudol and C. Laneve. Lambda-calculus, multiplicities and the ss-calculus. TechnicalReport 2581, INRIA Sophia-Antipolis, March 1995. [4] R. De Nicola and M. Hennessy. Testing equivalences for processes. Theoretical ComputerScience, 34:83 - 133, 1984. [5] M. Fiore, E. Moggi, and D. Sangiorgi. A fully-abstract model for the ss-calculus. In Proceedings11 th Annual Symposium on Logic in Computer Science, New Brunswick, New Jersey, USA, 1996. [6] C. Fournet and G. Gonthier. The reflexive CHAM and the join-calculus. In Proceedings 23thACM Symposium on Principles of Programmining Languages, 1996. [7] M. Hennessy. Algebraic Theory of Processes. MIT Press, 1988.[8] M. Hennessy. A fully abstract denotational model for higher-order processes. Information and Computation, 112:55 - 95, 1994.[9] K. Honda and M. Tokoro. On asynchronous communication semantics. In Proceeding of ECOOP'91, volume 612 of Lecture Notes in Computer Science, pages 21 - 51. Springer-Verlag,1992. [10] R. Milner. Functions as processes. Mathematical Structures in Computer Science, 2:119 - 141,1992. [11] R. Milner, J. Parrow, and D. Walker. A calculus of mobile processes I and II. Information andComputation, 100:1 - 41, 42 - 78, 1992. [12] I. Stark. A fully-abstract domain model for the ss-calculus. In Proceedings 11th AnnualSymposium on Logic in Computer Science, New Brunswick, New Jersey, USA, 1996. UBLCS-96-4 16