Quick viewing(Text Mode)

An Algebraic Process Calculus

An Algebraic Process Calculus

An algebraic process calculus

Emmanuel Beffara∗ Institut de Mathématiques de Luminy CNRS & Université Aix-Marseille II E-mail: [email protected]

Abstract consider the most straightforward case of non-determinism: p := (νa)(a.p1 |a.p2 |a¯). This process obviously has two pos- We present an extension of the πI-calculus with formal sible reductions: p → p1 and p → p2, assuming a does not sums of terms. The study of the properties of this sum occur in p1 or p2. We cannot say that the value of p is that reveals that its neutral element can be used to make as- of p1 or p2, since this would either lose information about sumptions about the behaviour of the environment of a pro- p or imply that p1 and p2 have the same value; the most we cess. Furthermore, the formal sum appears as a fundamen- can say is that the value of p is “either that of p1 or that of tal construct that can be used to decompose both internal p2”. This cannot be expressed in general in the language of and external choice. From these observations, we derive an processes, therefore we introduce in the language a formal enriched calculus that enjoys a confluent reduction which sum, so that we can formally get the equation p = p1 + p2. preserves the testing semantics of processes. This system is This sum has pleasant properties like bilinearity of par- shown to be strongly normalising for terms without repli- allel composition (i.e. (p + q) | r = p | r + q | r) and linearity cation, and the study of its normal forms provides a fully of hiding and even prefixes. However, the real gain in ex- abstract trace semantics for testing of πI processes. pressiveness comes when considering the neutral element of this sum, that we will write 0. This element has to satisfy the equation p | 0 = 0, which is unusual in a process cal- 1. Introduction culus. As we will see, it has a meaningful interpretation in terms of testing semantics, where an occurrence of 0 at top level means success. Moreover, a study of the properties of The point of this paper is to define a meaningful notion 0 shows that standard actions are not actually linear, since of normalisation for process calculi. Normalisation is not α.0 , 0, but rather affine, and we can extract a notion of an obvious idea in the context of concurrency because of purely linear action that does satisfy the ruleα. ˆ 0 = 0. The the non-determinism that is present in most process calculi, introduction of 0 and linear actions provides enough expres- and it makes it crucial to distinguish two related notions for siveness so that we can define for our calculus a system of term languages: execution, which is a relation that describes reduction rules that is normalising and preserves the testing the intended dynamics of a term considered as a program in semantics. a given model of computation, and evaluation, which is a relation that preserves the computational meaning of terms while simplifying them (in some sense). Contributions After recalling the syntax and operational In the λ-calculus, the standard notion of evaluation is β- semantics of the πI-calculus, in section 3 we define the al- reduction, which is confluent and strongly normalising for gebraic πI-calculus and provide intuition on the meaning of typed terms, while execution refers to particular evaluation the new constructs. Execution is presented in two equiva- strategies, or particular abstract machines. In the π-calculus, lent forms, namely as a reduction up to structural congru- the dynamics of terms is usually given either as a labelled ence, and as a labelled transition system, and the definition transition system or as a reduction relation up to some struc- of fair testing is deduced. In section 4, we introduce the tural congruence; we refer to the latter form as execution, system of evaluation rules over processes and we prove its since it represents the way a process actually runs. soundness with respect to the fair testing semantics. Exam- A problem in the search for semantics for processes is ples show that these rules can be used to effectively compute that there is no related notion of evaluation. For instance, process equivalences. In section 5 we prove that this sys- tem is locally confluent and that it is strongly normalising ∗Work supported by the French ANR project “Choco”. for terms without replication, and in section 6 we study the

1 normal forms of processes for this reduction. It appears that than a formal construction. On the other hand, the sum and normal forms are sums of traces augmented with inaction zero were justified by the study of behaviours in testing se- information, i.e. an extended trace is a sequence of actions mantics, as shown in particular in the author’s work on con- followed by the information that some actions could have current realisability [1, 2]. been performed but will not. This provides a simple trace Giving proper status to 0 is necessary if the formal sum semantics that is proved to be fully abstract for finite terms. needs to have the actual structure of a sum; its interpretation Deciding the observational preorder over traces is straight- as a testing token and the fact that it greatly improves the forward, and this provides an effective way to decide the theory of the calculus should not come as a surprise, for in- testing preorder over finite terms. In section 7, we discuss stance a similar approach lead to the definition of ludics [8] how our approach can be extended to handle a wider class from the sequent calculus of linear logic. of processes and different forms of equivalence. The trace semantics we derive from the evaluation rules has a simple formulation, and the interpretation of “inac- Related work The relevance of linearity in the study of tions” that make it fully abstract for fair and must testing processes has been known and studied for some time. It is new, as far as the author knows. However, several forms was first stressed by Kobayashi, Pierce and Turner [10] who of extended trace semantics exist in the literature. Among showed that linear typing of processes leads to significant those presented in van Glabbeek’s survey [15] of process improvements in the theory of the calculus, in particular by semantics, our semantics, when restricted to standard terms providing a form of partial confluence. Yoshida, Berger and (as of definition 4) is equivalent to the so-called readiness Honda [17] propose a type system for strong normalisation semantics of Olderog and Hoare [11]: a readiness trace is a that uses linearity information to guarantee normalisation sequence of actions followed by the set of actions that can using an “extended reduction” that allows processes to be be performed next, and inactions do provide this informa- reduced in a more liberal way than by standard execution. tion, at least when considering standard processes. The use of linear actions, i.e. actions that will be performed Other axiomatisations of various equivalences over the exactly once, is a crucial element in these studies, as in the π-calculus have been proposed in previous works (see [14] present paper. In a sense, our approach allows to keep the for instance). In particular, Hennessy’s fully abstract deno- refinement of linearity without the need for typing. tational semantics of the π-calculus [9] contains an axioma- Using a formal sum to express non-determinism without tisation of testing equivalences that is comparable to the losing information is a natural idea. It is used for instance in present work. Indeed, many of the equations in Hennessy’s Ehrhard and Regnier’s differential λ-calculus [6]: in order axiomatisation of the testing preorder can be deduced from to get a framework in which differential operators can be de- equivalence or reduction rules in our system. His approach fined, the λ-calculus is extended with linear combinations of is based on the distinction between internal choice (which terms, which appear as a natural and semantically justified is much like our algebraic sum) and external choice; we be- way of representing non-determinism without renouncing lieve our system to be more fundamental since our sum and to . This idea is further justified by its neutral element enjoy simpler algebraic properties while the possibility of embedding a finitary π-calculus in differ- being expressive enough to represent both kinds of choices, ential interaction nets [5]. Our algebraic process calculus as discussed in section 7.1. A supporting argument in this should provide insight on the relationships between this use respect is the fact that we need less axioms because we do of differential nets and process calculi. One can also expect not have to distinguish two sums. that extant work on the links between the λ-calculus and π-calculi could be extended to the differential case in our formalism. The study of such connections is deferred to further Note on notation The notations used here are in conflict works, since the focus of this paper is the study of the for- with the tradition of process calculi, but we believe this con- mal sum itself in the context of process calculi. Moreover, flict to be justified. The algebraic sum that we introduce is establishing a formal link with the differential λ-calculus written p+q, because + is the only sensible symbol for this. requires the introduction of linear coefficients in our pro- It is significantly different from the external choice opera- cesses. Vaux’s study of linear combinations of λ-terms [16] tor usually written +; this choice operator will be written & shows that one should be careful even in the very regular here by analogy with linear logic. The neutral element of setting of the λ-calculus, so extra complications are to be the sum, or “null process” is naturally written 0 for coher- expected here, notably when seeking confluence. Besides, ence. The process that does nothing is called “neutral pro- the meaning of coefficients is unclear from the point of view cess” and is written 1, since it is the neutral element of par- of semantics of concurrency, hence no reference semantics allel composition, which is a multiplicative operation (that is there yet to guide us in making linear combinations more distributes over the sum, in particular).

2 2. The πI-calculus 3. Introducing the sum

We start from Sangiorgi’s polyadic π-calculus with in- We now redefine the calculus, with its operational se- ternal mobility, or πI-calculus [13], without choice, and we mantics and testing, extending it with sum and zero. use fair testing as the observational equivalence over pro- Definition 4. Let N be the infinite set of names. Let P = cesses. We briefly recall the definitions of this calculus here { , } be the set of polarities, let ε range over P. Terms are for reference. The decision not to include choice in the main generatedˆ ´ by the following grammar: part of our study is for simplicity; as shown in section 7.1, ε including it would be harmless. p, q := u (x1 ... xn).p affine action ε Definition 1. Let N be an infinite set of names. Let P = !u (x1 ... xn).p replicated action { , } be the set of polarities, let ε range over P. Terms are ε uˆ (x1 ... xn).p linear action generated´ ˆ by the following grammar: (νx)p hiding ε p, q := u (x1 ... xn).p action 1 p | q parallel composition ε !u (x1 ... xn).p replicated action 0 p + q formal sum

(νx)p hiding ε ε In u (x1 ... xn) andu ˆ (x1 ... xn) we have u, x1,..., xn ∈ N 1 p | q parallel composition and these names are pairwise distinct. (νx)p is a binder for ε x u∗ε x ... x .p x ,..., x In u (x1 ... xn) we have u, x1,..., xn ∈ N and these names , ( 1 n) is a binder for 1 n, terms are con- ε are pairwise distinct. (νx)p is a binder for x, u (x1 ... xn).p sidered up to injective renaming of bound names. We write p p is a binder for x1,..., xn, and terms are considered up to fn( ) for the set of free names of the term . injective renaming of bound names. A term is quasi-standard if it has no occurrence of + or linear actions, it is standard if has no occurrence of 0 either. We often write (νx1 ... xn)p for (νx1) ... (νxn)p, and ~x for x1 ... xn. The ε in actions is the polarity, by conven- The same notations as above are used for actions and tion is positive and corresponds to input, is negative and name sequences. We use Greek letters α, β, γ . . . to repre- corresponds´ to output. Subsequently u(~x)ˆ stands for u (~x) sent actions. For cases where linearity is ignored,α ˚ stands ´ andu ¯(~x) stands for u (~x). If α is an action,α ¯ stands for the for either α orα ˆ. ˆ action with opposite polarity. 3.1. Execution and observation Definition 2. Structural congruence is generated by the fol- lowing rules, where z does not occur free in p: Definition 5. Structural congruence is that of definition 2 p | q ≡ q | p p | (q | r) ≡ (p | q) | r p | 1 ≡ p extended with the following rules: (νxy)p ≡ (νyx)p (νz)(p | q) ≡ p | (νz)q (νx)1 ≡ 1 p | (q + r) ≡ p | q + p | r (νx)(p + q) ≡ (νx)p + (νx)q !α.p ≡ α.(p | !α.p) Note that these structural equivalence rules do not pro- Terms up to structural congruence are called processes. Ex- vide the structure one could expect from a sum: it is neither ecution is the smallest relation over processes that is stable associative nor commutative, and 0 is neither neutral for the under parallel composition and hiding and contains the rule sum nor absorbing for composition, since there is no rule u¯(~x).p | u(~x).q → (ν~x)(p | q) that involves it. Indeed, structural congruence contains the minimum required for defining the execution relation. The rule above is written with the same sequence of names ~x in both actions; this is not a restriction, since terms Definition 6. Execution is the smallest relation over pro- are considered up to renaming of bound names. cesses that is stable under sum, parallel composition and hiding and contains the rule Definition 3. Assume N contains an element ω that is al- ways used as the action ω (), writtenω ¯ . A term p is accept- u¯˚(~x).p | u˚(~x).q → (ν~x)(p | q) ˆ ing if there is a p0 such that p ≡ ω¯ | p0. For terms p and q, Non-standard processes are not considered as proper p passes the test q if for any execution p | q →∗ r there is computational objects, i.e. their execution is not intended an execution r →∗ s with s accepting. The testing preorder to be seen as computation in any realistic model. However, is defined as p v q if for all r, if p passes the test r then q I it does make sense to interpret each term in a sum as a pos- passes the test r. sible state of a given system, this way an execution step of This preorder is written vI to distinguish it from the pre- the sum is an execution step of one of its possible states. order v defined below. Their equivalence is theorem 4. These “possible states” are formally called slices:

3 Definition 7. A slice is a term where any sum occurs under Lemma 1. Inconsistency is preserved by structural congru- an action. The set s(p) of the slices of a term p is defined ence, execution and slicing execution. inductively as Consistency is what we need to get a meaningful opera- s(p):= {p} if p is a constant or an action tional interpretation of terms with sums: an execution in the s((νx)p):= { (νx)s | s ∈ s(p) } standard sense corresponds to a consistent run. Of course this is not computationally realistic, since it amounts to hav- s(p + q):= s(p) ∪ s(q) ing an oracle that could decide if a given process is con- s(p | q):= { (s | t) | s ∈ s(p), t ∈ s(q) } sistent. This is not really a problem since standard terms, which are the actual object of study, are always consistent Interpreting the sum as pure non-deterministic choice is and execution of standard terms leads to standard terms. adequate. The meaning of 0 and linear actions requires ∗ 0 more explanation. A sum of terms p1 + ... + pn can be Definition 10. A slice s is successful if for any run s ⇒ s , understood as the fact that, after some execution steps of there is a run s0 ⇒∗ s00 with s00 inconsistent. Slices s and t a process p, this process may have reached either of the are orthogonal, written s ⊥ t, if s | t is successful. Processes states p1,..., pn, depending on non-deterministic choices p and q are orthogonal if all slices of p | q are successful. that have occurred. In this context, 0 and the linearity an- For a set A of processes, let A⊥ = { q | ∀p ∈ A, p ⊥ q }. notations are used to make such choices ahead of time, by A behaviour is a set of processes A such that A⊥⊥ = A. The making assumptions on what will happen: testing preorder is defined as p v q if {p}⊥ ⊆ {q}⊥. The associated testing equivalence is written p ' q. • a linear actionα. ˆ p is the action α.p with the assump- tion that it will actually be consumed at some point of The term “successful” might seem in contradiction with the execution, the definition that requires inconsistency. We consider it as success because it corresponds to the case where a pair of • 0 at top level in a term means that contradicting as- processes are in the orthogonality relation. It can also be sumptions were made. considered as success on the part of the environment, i.e. This interpretation is the key of the present study, and we the opponent, in game semantics terms. This is all a matter will see that it allows to decompose standard actions as of conventions, anyway. α.p ' α.ˆ p+α.0. In words, this simply means that a standard This definition of testing by orthogonality is not funda- action either will be consumed at some point, or will never mentally new, we use it because it provides a good structure be consumed. From a formal point of view, this justifies that to the set of processes. The power of this simple technique standard actions are affine,α. ˆ p being the linear part and α.0 was used for instance in the functional framework in Kriv- being the constant. ine’s realisability [3, 4], it was also employed in a different The definition of slices does not consider sums that oc- way by Rathke, Sassone and Sobocinski´ [12] as a way of cur under an action, because these are non-deterministic defining observables in process algebra. choices that will be made when the action is consumed. Lemma 2. Let p and q be two terms. p v q if and only if Therefore the execution of a slice does not in general lead for all slices s, if s ⊥ p then s ⊥ q. to a slice, for this reason we define slicing execution: Definition 8. Slicing execution is the relation ⇒ over slices 3.2. Labelled transition system such that s ⇒ t if there is a p such that s → p and t ∈ s(p). A run is a sequence of slicing executions. A maximal run We now redefine the operational semantics of slices as a of s is either a finite sequence (s0,..., sn) such that s0 = s, labelled transition system, strictly defined on terms without si ⇒ si+1 for all i < n, and sn is irreducible, or an infinite structural congruence. This will simplify proofs of obser- sequence (si)i∈N such that s0 = p and si ⇒ pi+1 for all i. vational equivalence by allowing us to reason only on se- quences of transitions, without worrying about the precise As mentioned above, linear actions and 0 are used to ex- syntax of terms. press assumptions on the execution of a process. This is formalised as the following notion of consistency: Definition 11. The set L of labels consists of τ and actions ε u (x1 ... xn), with u, x1,..., xn pairwise distinct. Define: Definition 9. A slice s is null if there is an s0 such that 0 ε s ≡ 0 | s . A run (si) is consistent if none of the si is null names: n(τ) = ∅ n(u (~x)) = {u, x1,..., xn} and for any linear action occurring at top level in some si ε bound names: bn(τ) = ∅ bn(u (~x)) = {x1,..., xn} there is an execution step s j ⇒ s j+1 where it is consumed. A slice is consistent if it has a consistent maximal run. A The labelled transition relation is the relation between slices term or process p is consistent if it has a consistent slice. and terms, labelled over L, defined by the rules of table 1

4 • Either the action α.q is consumed, then there is a se- u¯ε(~x) uε(~x) τ∗ α¯ p −−−→ p0 q −−−→ q0 quence of transitions s =⇒ s0 ⇒= s00 such that the run is α α τ ∗ 0 0 00 ∗ α.˚ p −→ p !α.p −→ p | !α.p p | q −→ (ν~x)(p0 | q0) decomposed as α.q | s ⇒ α.q | s ⇒ (ν~x)(q | s ) ⇒ r with q0 ∈ s(q). For any slice p0 ∈ s(p) The run ` ` p −→ p0 bn(`) ∩ fn(q) = ∅ p −→ p0 x < n(`) α.p | s ⇒∗ α.p | s0 ⇒ (ν~x)(p0 | s00) holds too, and by 00 ` ` hypothesis α.p | s is successful, so p | s is successful, | −→ 0 | −→ 0 p q p q (νx)p (νx)p and since p v q the term q | s00 is successful, so q0 | s00 is successful and r has an inconsistent reduct. Table 1. Transition rules for slices • Or the action is not consumed, and the run can be writ- ten α.q|s ⇒∗ α.q|s0 with s ⇒∗ s0. If there is a sequence τ∗ α¯ (and the symmetric rule for parallel composition). The slic- of transitions s0 =⇒ s00 ⇒= t then we can extend the con- a ing transition relation over slices is defined as s ⇒= t if there sidered run into one that does consume the action and a 0 is a term p such that s −→ p and t ∈ s(p). we are back to the previous case. Otherwise α.p| s has an inconsistent reduct of the form α.p | s00, and α.q | s00 is inconsistent too. Definition 12. Affine contexts are defined by the grammar Hence α.q|s is successful, from which we deduce α.p v α.q. C ::= [], C | p, p | C, C + p, p + C, (νx)C, α.C, α.ˆ C We proveα. ˆ p v α.ˆ q by the same argument, except that in the second case, if s0 has no transition labelledα ¯, thenα. ˆ q|s0 Execution contexts are contexts made of parallel composi- is inconsistent becauseα ˆ can never be consumed.  tions and hidings. Replacing [ ] by p in C is written C[p]. 4. Reduction rules Proposition 1. For any slices s and t, there is a slicing execution s ⇒ t if and only if there is a slice t0 such that τ In the following sections, we focus mainly on the finite ≡ 0 ⇒ 0 t t and the transition s = t holds. fragment of the calculus, in particular the reduction defined below says nothing about replicated actions. Nevertheless, The proof can be found in the appendix. Thanks to this the formulated results hold for terms with replications, un- proposition, we can consider interchangeably slicing execu- less stated. We implicitly consider replicated terms up to tion steps or slicing τ transitions. structural congruence, i.e. !α.p is the infinite term q such Proposition 2. The testing preorder is preserved by affine that q = α.(p | q). The question of extending this work to contexts. handle replication explicitly is discussed in section 7.2. Definition 13. The equivalence relation over terms and Proof. Let p and q be two terms such that p v q, i.e. such  the relation over terms up to are defined by the rules of that for any term s, if p|s is successful then q|s is successful.  table 2, in any affine context, except that no reduction rule Let r be a term. Let s be a term such that (p + r) | s is applies in a subterm p such that p 0. successful. Then for all slices t ∈ s(p) ∪ s(r) and s0 ∈ s(s),  0 0 t | s is successful. This implies that p | s is successful, so The congruence  allows every term to be written either 0 0 q| s is successful, i.e. for all slice t ∈ s(q), t| s is successful. as 0 or as a sum of slices with no 0 in active position. Such Therefore (q + r) | s is successful, so p + r v q + r. a presentation of a term is called an expanded form. The Let r be a term, then for any term s, if (p|r)| s is success- side conditions are easy to check on these forms. ful, then p | (r | s) is successful (since success is preserved In definition 13 and rules A and L2, the clumsy treatment by structural congruence), so q | (r | s) is successful (by hy- of 0 is needed to avoid trivial loops like 0  0 | p 0 | p0  pothesis), so (q | r) | s is successful. Hence p | r v q | r. 0 (whenever p p0) or α.0 α.ˆ 0 + α.0 0 + α.0  Let x be a name. Let s be a term. Let y be a fresh name, α.0 orα. ˆ p  α.ˆ (p + 0) α.ˆ p + α.ˆ 0 α.ˆ p + 0  α.ˆ p. that does not occur in p, q or s. Assume (νx)p | s is success- Another possibility would be to turn the related structural ful, then by structural congruence (νy)(p[y/x]| s) is success- equivalence rules for 0 into reduction rules, but this would ful. By the definition of success it is clear that p[y/x] | s is make the system heavier. The condition in N3 reflects the successful. From p v q we can deduce p[y/x] v q[y/x], fact that actions of different arities cannot interact. If the so q[y/x] | s is successful, and so are (νy)(q[y/x] | s), and terms were typed so that each name is used with a fixed (νx)q | s. Therefore (νx)p v (νx)q. arity, the rule could be simplified into (νu)uε(~x).0 1. Let α be an action. Let s be a slice such that α.p | s is It is clear that if a reduction p q holds, then a similar successful. Consider a run α.q|s ⇒∗ r. There are two cases: reduction holds in the expanded form, possibly duplicated

5 Structural equivalence, with z < fn(p): into a run that does, then there is a run ofα. ˆ p | q that leads to r by the same reduction steps, by hypothesisα. ˆ p | q is (νxy)p (νyx)p (νx)1 1   successful so r has an inconsistent reduct. Otherwise we (νz)(p | q)  p | (νz)q (νx)(p + q)  (νx)p + (νx)q have r = α.p | q0, and the run α.0 | q ⇒∗ α.0 | q0 holds, and 0 00 p | q  q | p p | (q | r)  (p | q) | r p | 1  p α.0 | q reduces to an inconsistent term α.0 | q without ever α. p + q  q + p p + (q + r)  (p + q) + r p + 0  p consuming 0. This proves that the source of inconsistency is q00, and α.p | q00 is inconsistent too, therefore α.p ⊥ q. p | (q + r) p | q + p | r p | 0 0   So we split the runs of α.p | s into those that consume α Normalisation: or may do it, and those that do not. Similar arguments are used for the other rules. For instance, in the case of I1, we S p + p p split the runs ofα. ˆ p | α.¯ˆ q | s according to the first transition A α.p α.ˆ p + α.0 if p  0 ofα. ˆ p | α.¯ˆ q, which can be α,α ¯ or τ. For I2, the same applies L1 α.ˆ 0 0 without the τ transition. The full proof for all rules can be L2 α.ˆ (p + q) α.ˆ p + α.ˆ q if p  0 and q  0 found in the appendix.  I1 α.ˆ p | α.¯ˆ q α.ˆ (p | α.¯ˆ q) + α.¯ˆ (α. ˆ p | q) + (ν~x)(p | q) where ~x = bn(α), if p  0 and q  0 As this proof illustrates, the combined use of linearity and the formal sum allows our calculus to admit many more I2 α.ˆ p | β.ˆ q α.ˆ (p | β.ˆ q) + β.ˆ (α. ˆ p | q) if β , α¯ simplifications than other calculi. This is because the alge- I3 α.ˆ p | β.0 α.ˆ (p | β.0) braic sum enjoys the good properties of both internal choice I4 α.0 | α.0 α.0 (like the distributivity p | (q + r) ' p | q + p | r) and exter- I5 α.0 | α.¯ 0 0 nal choice (like the interleaving rules I1 and I2), together N1 (νv)ˆuε(~x).p uˆ(~x).(νv)p if u , v with other regularity properties, like linearity of actions in N2 (νu)ˆuε(~x).p 0 the ruleα. ˆ (p + q) ' α.ˆ p + aˆ.q. N3 (νu)n 1 if n is a composition of terms of the form uε(~x).0 that contains no dual actions Examples The soundness of our rewrite system shows that it can be used to prove observational equivalence of Table 2. Rules for normalisation processes by purely computational methods. For instance we can formulate the interference between two identical ac- because of the distribution rule. Therefore we can restrict tions in a natural way: to expanded forms without loss of generality. α.p | α.q ' α.ˆ p | α.ˆ q + α.ˆ p | α.0 + α.0 | α.ˆ q + α.0 | α.0 Theorem 1 (soundness). Let p and q be two terms. If p  q ' α.ˆ (p | α.ˆ q + α.ˆ p | q + p | α.0 + α.0 | q) + α.0 or p q then p ' q. ' α.ˆ (p | (α. ˆ q + α.0) + (α. ˆ p | α.0) | q) + α.0 Proof. Let us sketch the soundness proof of rule A. We ' α.(p | α.q + α.p | q) have to show that for any slice q, α.p ⊥ q if and only if Interaction without interference can also be computed: α.0 ⊥ q andα. ˆ p ⊥ q. First assume that α.p ⊥ q. Consider a runα. ˆ p | q ⇒∗ r. We can assume that the action ofα. ˆ p is (νu)(u(~x).p | u¯(~x).q) ∗ consumed, i.e. that the considered run isα. ˆ p|q ⇒ α.ˆ p|q1 ⇒ ' (νu)(ˆu(~x).p | u¯ˆ(~x).q) + (νu)(ˆu(~x).p | u¯(~x).0) ∗ (ν~x)(p | q2) ⇒ r, with ~x = bn(α). Thus there is a run ∗ ∗ + (νu)(u(~x).0 | u¯ˆ(~x).q) + (νu)(u(~x).0 | u¯(~x).0) α.p | q ⇒ α.p | q1 ⇒ (ν~x)(p | q2) ⇒ r and by hypothesis there is a run r ⇒∗ s with s inconsistent. Thereforeα. ˆ p ⊥ q. Now consider a run α.0 | q ⇒∗ r. If this run consumes the ' (νu)ˆu(~x).(p | u¯ˆ(~x).q) + (νu)ˆu(~x).(u¯ˆ(~x).p | q) + (νu~x)(p | q) action α, then the reduct r has 0 in active position and it is + (νu)ˆu(~x).(p | u¯(~x).0) + (νu)u¯ˆ(~x).(u(~x).0 | q) + 0 inconsistent, otherwise the run is α.0 | q ⇒∗ α.0 | q0. If there ' 0 + 0 + (νu~x)(p | q) + 0 + 0 + 0 ' (νu~x)(p | q) is an run of α.0 | q0 that consumes α then the considered run can be extended to an inconsistent state. Otherwise any From this we can show that the formal sum is equivalent to maximal run of α.0|q0 is a maximal run of q0 in parallel with pure internal choice as follows, where u is not free in p or q: a.0. From this we deduce a maximal run of α.p|q0, which is inconsistent by hypothesis. Since α.p is left untouched, the (νu)(u.p | u.q | u¯) ' (νu)(u.(p | u.q + u.p | q) | u¯) 0 0 source of inconsistency in α.p|q also applies in α.0|q , and ' p | (νu)u.q + (νu)u.p | q ' p | 1 + 1 | q ' p + q α.0 | q0 is inconsistent too. Therefore we also have α.0 ⊥ q. Now assume thatα. ˆ p ⊥ q and α.0 ⊥ q, and consider a where (νu)u.p ' 1 is computed as (νu)u.p ' (νu)ˆu.p + run α.p|q ⇒∗ r. If this run consumes α.p or can be extended (νu)u.0 ' 0 + 1 ' 1.

6 The rewrite rules can also be used to detect . easily solved, the most difficult case is that of two interfer- Consider the symptomatic term p = a.b¯ | b.a¯.q. We can ing applications of rule I1, and we detail it here. The term easily show the general formula p0 = α.ˆ p | α.ˆ q | α.¯ˆ r reduces into two terms:

α.p | β.q ' α.0 | β.0 + α.ˆ (p | β.q) + β.ˆ (α.p | q) p1 = α.ˆ (p | α.¯ˆ r) | α.ˆ q + α.¯ˆ (α. ˆ p | r) | α.ˆ q + (ν~x)(p | r) | α.ˆ q

p2 = α.ˆ (q | α.¯ˆ r) | α.ˆ p + α.¯ˆ (α. ˆ q | r) | α.ˆ p + (ν~x)(q | r) | α.ˆ p so we get p ' a.0 | b.0 + aˆ.(b¯ | b.a¯.q) + bˆ.(a.b¯ | a¯.q). There- fore (νab)p is equal to the same sum with (νab) at top level We reduce p1 as follows (the reduced terms are underlined): in each summand, but every summand except the first one starts with a linear action in a or b so we get p1 = α.ˆ (p | α.¯ˆ r) | α.ˆ q + α.¯ˆ (α. ˆ p | r) | α.ˆ q + (ν~x)(p | r) | α.ˆ q 2 α.ˆ (p | α.ˆ q | α.¯ˆ r) + α.ˆ (α. ˆ (p | α.¯ˆ r) | q) (νab)p ' (νab)(a.0 | b.0) ' (νa)a.0 | (νb)b.0 ' 1 | 1 ≡ 1 + α.¯ˆ (α. ˆ p | α.ˆ q | r) + α.ˆ (α.¯ˆ (α. ˆ p | r) | q) which proves purely by computation that (νab)p is a dead- + α.ˆ p | (ν~x)(r | q) + (ν~x)(p | r) | α.ˆ q lock. If we only restrict the name a we also deduce some- 3 α.ˆ (p | α.ˆ (q | α.¯ˆ r)) + α.ˆ (p | α.¯ˆ (α. ˆ q | r)) thing about the process: + α.ˆ (p | (ν~x)(q | r)) + α.ˆ (α. ˆ (p | α.¯ˆ r) | q) (νa)p ' (νa)a.0 | b.0 + (νa)bˆ.(a.b¯ | a¯.q) + α.¯ˆ (α. ˆ p | α.ˆ q | r) + α.ˆ (α.¯ˆ (α. ˆ p | r) | q) ' b.0 + bˆ.(νa)(a.b¯ | a¯.q) + α.ˆ p | (ν~x)(q | r) + α.ˆ q | (ν~x)(p | r) ' b.0 + bˆ.(b¯ | (νa)q) The last step is 3 because it is one step of I1 followed by ' ¯ | b.(b (νa)q) two steps of L2 to expand the sum. If we do the same in p2, we get the same term with p and q swapped. Define 5. Normalisation S = α.ˆ (p | α.ˆ (q | α.¯ˆ r)) + α.ˆ (α. ˆ (p | α.¯ˆ r) | q) + α.¯ˆ (α. ˆ p | α.ˆ q | r) ˆ ˆ The purpose of this section is to prove strong normalisa- + α.ˆ (p | α.¯ (α. ˆ q | r)) + α.ˆ (α.¯ (α. ˆ p | r) | q) tion of the relation over terms without replication. In the then swapping p and q does not change S and we have following developments, an n-ary sum (up to ) is written P n ∗ using the notation, and an -ary parallel composition is p S + α.ˆ q | (ν~x)(p | r) written using the Q notation. 1 + α.ˆ p | (ν~x)(q | r) + α.ˆ (p | (ν~x)(q | r)) ∗ p2 S + α.ˆ p | (ν~x)(q | r) Local confluence The first step of our normalisation | | | | proof is to prove local confluence of the relation . For + α.ˆ q (ν~x)(p r) + α.ˆ (q (ν~x)(p r)) this we need the following lemma: By lemma 3, the termsα. ˆ q | (ν~x)(p | r) andα. ˆ q | (ν~x)(p | r) + | | Lemma 3. For all actions α and all terms p and q, α.ˆ p | q α.ˆ (q (ν~x)(p r)) have a common reduct r1, so and α.ˆ p | q + α.ˆ (p | q) have a common reduct for . ∗ p1 S + r1 + α.ˆ p | (ν~x)(q | r) + α.ˆ (p | (ν~x)(q | r)) ∗ The detailed proof can be found in the appendix. The p2 S + α.ˆ p | (ν~x)(q | r) + r1 idea is that q can be reduced to a parallel composition of and by the same lemmaα. ˆ p | (ν~x)(q | r) + α.ˆ (p | (ν~x)(q | r)) actionsα ˆi.qi or actions αi.0, and using the rules I1, I2 and I3 we reduceα. ˆ p | q to a term that contains a sliceα. ˆ (p | q), andα. ˆ p | (ν~x)(q | r) have a common reduct r2, hence p1 and then we conclude using rule S. p2 both reduce to S + r1 + r2.  This lemma is the reason we introduced the rule S in our system. It also explains why introducing scalar coefficients, Termination We now prove that the relation is well to get linear combinations instead of sums, seems problem- founded on finite terms. For this we make a relationship atic in the current state of things. between evaluation and execution, first by considering re- ductions at top level. Theorem 2. The relation is locally confluent. Definition 14. For a term p, let kpkt be the maximum length Proof. We proceed by studying all possible conflicts be- of the runs of slices of p, or ∞ if it is undefined. Let t be tween the rules. Not counting rule S, there are 22 criti- the top-level reduction, i.e. p t q if p q by applying a cal pairs, all developed in the appendix. Most cases are reduction rule not under an action.

7 Lemma 4. If p t q then kpkt > kqkt. Proposition 4. Normal forms are sums of distinct traces.

Lemma 5. The restriction of t that does not use the rule The proof (in appendix) consists in showing that all I1 is terminating. affine actions, parallel compositions and hidings are elim- inated by reduction. By theorem 3, this shows that each Lemma 4 is a simple case analysis on the rules, and term is equivalent to a sum of traces, and reduction pro- lemma 5 uses a measure that essentially counts the num- vides a way to compute a set of traces equivalent to a given ber of actions in parallel in each slice (details are in the term. Thus we get a trace semantics, and the purpose of this appendix). This shows that the only possible source of in- section is to study some properties of this semantics. finite reductions is rule I1, indeed it is the one that extends the execution relation. By combining the measure used in Definition 17. Let T be the set of all traces. For any set B ⊆ ∗ lemma 5 and the norm kpkt, which strictly decreases along T, define B = { t | t ∈ T, ∀u ∈ B, t ⊥ u }. A trace behaviour execution, we can prove the following equivalence: is a set B ⊆ T such that B = B∗∗. Lemma 6. For all terms p, there is an infinite sequence of Proposition 5. The set of term behaviours and the set t if and only if a slice of p has an infinite run. of trace behaviours, ordered by inclusion, are isomorphic The next step is to generalise this to arbitrary reductions. complete lattices. The isomorphism is the function t defined −1 ⊥⊥ For this we introduce another norm, which takes into ac- as t(A) = A ∩ T, with t (B) = B . count the maximum length of sequences of transitions, in- Proof. Firstly, remark that for any term behaviour A we stead of execution steps: have A⊥ = t(A)⊥: it is obvious that t(A) ⊆ A, so A⊥ ⊆ t(A)⊥. ⊥ t Definition 15. For a slice s, let kska be the maximum length For the reverse inclusion consider a term p (A) and a of sequences of transitions of s, of ∞. For a term p, let term q ∈ A. By theorem 3 and proposition 4, there is a decomposition q ' Pn t where the t are traces, therefore kpka = max { kska | s ∈ s(p) }. Let kpk be the maximum of i=1 i i ⊥ ⊥ k·ka over all subterms of p. p q if and only if p ti for all i. By definition of observa- ⊥⊥ ⊥⊥ tional equivalence we have { ti | 1 6 i 6 n } = {q} ⊆ A Lemma 7. If p q then kpk > kqk. so for each i we have ti ∈ A, so ti ∈ t(A), therefore p ⊥ ti. ⊥ Proposition 3. p has no infinite reduction if kpk is finite. This proves p ⊥ q, and subsequently p ⊥ A so p ∈ A . This implies that for any term behaviour A we have The proof (detailed in appendix) is by induction on kpk. A = t(A)⊥⊥, moreover by definition for any set of traces The idea is that any sequence of reductions can be reordered B we have B∗ = t(B⊥) hence B∗∗ = t(t(B⊥)⊥) = t(B⊥⊥), so t so that all top-level reductions come first, followed by all re- is a bijection. It is clearly increasing, and it also clear that it ductions of subterms prefixed by actions; such subterms are commutes with lower bounds, since lower bounds are inter- strictly smaller than kpk. A proof by induction on the height sections in both sets. For upper bounds, if (Ai)i∈I is a family terms would not work since some rules make the height of W  S ⊥⊥ of term behaviours, we have t i∈I Ai = t i∈I Ai = terms strictly grow. As a direct consequence we finally get S ⊥⊥⊥⊥ S ⊥⊥ S ∗∗ t i∈I t(Ai) = t i∈I t(Ai) = i∈I t(Ai) = the expect result, remarking that terms without replication W i∈I t(Ai). Therefore t is a lattice isomorphism.  always have a finite norm kpk: This proposition implies that the behaviour of a process Theorem 3. The relation is strongly normalising on p is completely described by the set of traces contained in terms without replication. {p}⊥⊥, i.e. by the trace behaviour of p. So it is enough to consider trace behaviours when studying the testing seman- 6. A trace semantics tics of processes. This is especially interesting because or- thogonality of traces is straightforward to characterise syn- The soundness and strong normalisation of relation tactically (the proof can be found in appendix): imply that every term without replication is equivalent to ˆ ˆ an irreducible term. The point of this section is to study the Proposition 6. Let t = αˆ 1 ... αˆ k.m and u = β1 ... β`.n be properties of these normal forms. two traces, then Definition 16. An inaction set n is a finite set of terms α.0 • t ⊥ u unless k = `, βi = α¯ i for all i, and m ∩ n¯ = ∅, that does not contain dual actions, i.e. such that for all α.0 ∈ • t v u if and only if k = `, βi = αi for all i, and m ⊆ n. n and β.0 ∈ n, β , α¯. Inaction sets are identified with the parallel composition of their elements. A trace is a term of In the sequel we write p to represent the trace be- the form t = αˆ 1.αˆ 2 ... αˆ k.n where n is an inaction set. k is haviour of p. This characterisationJ K of the testing preorder called the length of t and is written |t|, the sequenceα ˆ 1 ... αˆ k shows that it is actually an order over traces: syntactically is the action part of t, n is the inaction part of t. distinct traces are always distinguishable. It also implies

8 that the preorder is decidable for terms without replication: Theorem 4. For all standard terms p and q, p v q if and if p and q are normal forms, i.e. finite sets of traces, then only if p vI q if and only if p ⊆ q . p v q if and only if q ⊆ p , if and only if for all traces J K J K Proof. The first step is to remark that every term is observa- t ∈ q there is a traceJ uK ∈ Jp K such that u v t. If we add a tionally equivalent to a quasi-standard term. To prove this reductionJ K rule t + u t if tJandK u are traces and t v u (the we translate each extended syntactic construction using the condition is easy to check), then strong normalisation is ob- equivalences of table 2. In section 4 we have shown that for viously preserved, and normal forms are finite sets of pair- any terms p and q and any fresh name u we have p + q ' wise incomparable traces. Then equivalence of processes (νu)(u.p | u.q | u¯). For linear actions, consider a termα. ˆ p and coincides with the equality of normal forms. a fresh name u. Remark that u.0|u¯ ' u.0|u¯.0+u.0|u¯ˆ ' u¯ˆ.u.0, We thus have an isomorphism between behaviours, i.e. so we have sets of terms closed upwards for the observational preorder, and trace behaviours, i.e. sets of traces closed upwards for (νu)(α.u.p | u.0 | u¯) the inclusion of inaction sets. The trace behaviour of a term ' (νu)((α. ˆ uˆ.p + α.ˆ u.0 + α.0) | u¯ˆ.u.0) can be expressed inductively as follows: ' (νu)(α. ˆ uˆ.p | u¯ˆ.u.0) + (νu)(α. ˆ u.0 | u¯ˆ.u.0) + α.0 | (νu)u¯ˆ.u.0 p + q = p ∪ q 0 = ∅ J K J K J KJ K ' α.ˆ (νu)(p | u.0) + (νu)(α. ˆ (u.0 | u¯ˆ.u.0)) + 0 p | q = S [t | u] 1 = { t | t ∈ T, |t| = 0 } t∈ p ,u∈ q ˆ J K J K J K J K ' α.ˆ (p | (νu)u.0) + α.ˆ (νu)u¯.(u.0 | u.0) α.p  α.t t ∈ p ∪ {α. } = ˆ 0 ' α.ˆ (p | 1) + α.ˆ 0 ' α.ˆ p J K  J K α.ˆ p = α.ˆ t t ∈ p This proves that two standard terms p and q are distinguish- J K ( J K ) αˆ 1 ... αˆ k.n ∈ p able in the algebraic setting if and only if they are distin- (νx)p = αˆ 1 ... αˆ k.(n \ x) J K J K ∀i, x < n(αi) guishable by a quasi-standard term. By lemma 8 this is the where n \ x is the set n without the inactions with x as same as being distinguishable according to definition 3.  the subject name. The notation [t | u] stands for the set Note that this implies that the testing preorder over finite of traces obtained by normalising t | u. We can define terms is decidable by the purely axiomatic system given by a kind of abstract machine to compute it: say a state is the rules of table 2 and the characterisation of proposition 6. a set of names X ⊆ N and a configuration is a triple c ∈ T×P(N)×T. Define three kinds of actions: productions α (t, X, u) −→ (t0, X0, u0), silent steps (t, X, u) → (t0, X0, u0) and 7. Extensions terminations (t, X, u) → n. Define execution as α 7.1. Choice (α. ˆ t, X, u) −→ (t, X ∪ bn(α), u) if n(α) ∩ X = ∅ β When introducing the sum operator, it is natural to ask (t, X, β.ˆ u) −→ (t, X ∪ bn(β), u) if n(β) ∩ X = ∅ which relationship there is between this sum and the tradi- ˆ (α. ˆ t, X, α.¯ u) → (t, X ∪ bn(α), u) tional choice operator of process calculi. Assume we have a (m, X, n) → (m ∪ n) \ X if m ∩ n¯ = ∅ construct &i∈I αi.pi whose operational semantics is defined in the labelled transition system as Then [t | u] is the set of tracesα ˆ 1 ... αˆ k.n such that there is a ∗ α1 ∗ α2 ∗ αk ∗ run (t, ∅, u) → −−→→ −−→→ ··· −−→→ n. αi & αi.pi −→ pi To get back to our starting point, that is the testing pre- i∈I order in the πI-calculus, the final question we have to ask is for each i ∈ I. The argument justifying rule A applies here the relationship between this testing, from definition 3, and as follows: either one of the αi will be consumed, or none of the one we studied in the algebraic setting. This relationship them will. Formally, assuming that the set { αi | i ∈ I } does is easy: the preorders are equal. To prove this, first remark not contain dual actions, we get the equation that using 0 as the testing token is equivalent to using an P Q action on a special channel: &i∈I αi.pi ' i∈I αˆ i.pi + i∈I αi.0 Lemma 8. For any term p, let [p]ω be the term obtained where the product stands for a parallel composition. Thus by replacing each occurrence of 0 by the action ω¯ . If p is a external choice is indeed related to the algebraic sum, and quasi-standard term such that ω < fn(p) then p is successful our extensions already provide enough power to express it, ⇒∗ ⇒∗ | if and only if for any run [p]ω q there is a run q ω¯ r. even mixed choice, the only exception being that of a choice The details of this proof are in the appendix, it consists in between dual actions. remarking that 0 andω ¯ play the same role in testing. From This decomposition does not hold when two dual ac- this we can finally deduce our full abstraction theorem: tions occur in the same choice, because of the rule I5:

9 α.0 | α.¯ 0 ' 0. If we were to extend our formalism to allow This shows that in the second case, there is the possibility this kind of choice, the only extra material needed would be of a , since the final sum contains 1, while in the terms of the form α.0 &α. ¯ 0, which intuitively require that first case there is no such possibility because d is the only the environment will never performα ¯ nor α. One can easily term in the result. check that this simple extension does not compromise the results exposed in this paper. 7.2. Infinity Using the rule above with the rules of table 2, we can easily derive usual laws like the following, where β , α¯: The main developments in this paper focus on terms without replication, and the trace semantics is not valid α.p | β.q ' α.(p | β.q)& β.(α.p | q) anymore in the presence of infinite behaviours. Consider α.p & α.q ' α.(p + q) for instance the term !u. The recursive definition states ≡ Among standard examples used to describe the properties of !u u.!u, so if U is the trace behaviour of !u we must have { } ∪ { | ∈ } process calculi is the comparison of a.(b & c) and a.b & a.c U = u.0 uˆ.t t U . This has one solution, namely { n | ∈ N } n ··· (with our notations). These terms are not bisimilar although U = uˆ .u.0 n , whereu ˆ .t stands for a termu ˆ. .uˆ.t ¯ they have the same traces (in the usual sense), and indeed with n occurrences ofu ˆ. Now if we check if U and U i ⊥ ˆ j they are equivalent for may-testing but not for must-testing. are orthogonal, we have to check thatu ˆ .u.0 u¯ .u¯.0 for The use of inactions in our traces solves this problem: all i and j, an by proposition 6 this always holds, hence U ⊥ U¯ . But clearly !u and !¯u are not orthogonal, since a.(b & c) ' aˆ.(bˆ + cˆ + b.0 | c.0) + a.0 !u | !¯u has exactly one maximal run, namely the infinite run | → | → · · · ' aˆ.bˆ + aˆ.cˆ + aˆ.(b.0 | c.0) + a.0 !u !¯u !u !¯u , which is consistent. This can be solved in several ways, as explained below. ˆ a.b & a.c ' aˆ.(b + b.0) + aˆ.(ˆc + c.0) + a.0 We defer the detailed study of these possible solutions to an ' aˆ.bˆ + aˆ.cˆ + aˆ.(b.0 + c.0) + a.0 extended version of this paper. In the first case there is one traceα. ˆ (b.0 | c.0) while in the Cheating Consider infinite runs as inconsistent. This is second case there are two tracesα. ˆ b.0 anda ˆ.c.0. The first the easiest way but it is an unusual kind of test which case reveals that the process may have two available actions amounts to considering that all the terms we ever consider after performing α (although 0 assumes none of them will terminate. This might be satisfactory in a context where ter- happen) while the second case states that only one action mination is guaranteed, for instance by typing. However, is available. The syntactic characterisation of the observa- restricting to a typed calculus may have important conse- tional preorder also implies a.b & a.c v a.(b & c). quences when defining testing semantics, for instance if Composing these terms with, say,a ¯.b¯.d makes the differ- testing is defined against typed environments only. Besides, ence in behaviours explicit: in the first case we get our motivation here is to study an untyped calculus. (νabc)(a.(b & c) | a¯.b¯.d) Partial traces This approach consists in adapting the con- ' (νabc)(a.(bˆ + cˆ + b.0 | c.0) | a¯.(b¯ˆ.d + b¯.0)) cept of Böhm trees to our calculus. By introducing a new ' (νbc)((bˆ + cˆ + b.0 | c.0) | (b¯ˆ.d + b¯.0)) process constant Ω to represent undefinedness, we can de- fine partial traces, i.e. traces ending with Ω. Then trace ' (νbc)(bˆ | b¯ˆ.d) + (νbc)(ˆc | b¯ˆ.d) + (νbc)(b.0 | c.0 | b¯ˆ.d) behaviours will be sets of traces downwards closed by a + (νbc)(bˆ | b¯.0) + (νbc)(ˆc | b¯.0) + (νbc)(b.0 | c.0 | b¯.0) refinement order. An equivalent formulation is to extend ' d + 0 + 0 + 0 + 0 + 0 ' d the language with infinite traces, as limits of partial traces. Since the reduction rules produce traces in an incremental In the second case we get way, we can even compute approximations of a term. (νabc)(a.b & a.c | a¯.b¯.d) This approach is appropriate if we want to extend our fully abstract trace semantics. On the other hand, it does not ˆ ' (νabc)(a.(bˆ + cˆ + b.0 + c.0) | a¯.(b¯.d + b¯.0)) provide a way to extend our decidability result for the test- ' (νbc)((bˆ + cˆ + b.0 + c.0) | (b¯ˆ.d + b¯.0)) ing preorder to a class of processes with infinite behaviour. ˆ ¯ˆ ¯ˆ ¯ˆ ' (νbc)(b | b.d) + (νbc)(ˆc | b.d) + (νbc)(b.0 | b.d) New rules While these solutions keep the same rewriting + (νbc)(c.0 | b¯ˆ.d) + (νbc)(bˆ | b¯.0) + (νbc)(ˆc | b¯.0) rules, a different approach is to extend the rules with nor- malisation of replicated actions. The extended rules should + (νbc)(b.0 | b¯.0) + (νbc)(c.0 | b¯.0) probably allow special cases like (νu)(!u(x).p | !v(y).q) ∗ ' d + 0 + 0 + 0 + 0 + 0 + 0 + 1 ' d + 1 !v(y).(νu)(!u(x).p | q) (if u does not occur in p).

10 This kind of rule for simplifying replication has al- seems to lose all branching information while branching is ready been proposed in fragments of the π-calculus (an ex- crucial in bisimulations. tended reduction with comparable properties is proposed by Yoshida, Berger and Honda in their typed π-calculus [17]). 7.4. Name passing Because of the undecidability of most equivalences on in- finitary processes, the possibility of defining a reduction The present work studies the introduction of an algebraic that could normalise arbitrary terms is unlikely, but partial sum in the πI-calculus instead of the full π-calculus because solutions could exist, for instance in reasonable restrictions this fragment is simpler and allows us to focus specifically of the calculus. This approach is appropriate in order to on the new elements introduced by algebraicity. The next study embeddings of λ-calculi in process calculi, as it would step in the search for normalisation in process calculi is provide an extension and decomposition of β-reduction. communication of free names, as in standard π-calculus. Adapting our approach to this context does not lead to 7.3. Other forms of tests fundamental changes, but quite a few things have to be ad- justed. First of all, in order to make the testing preorder con- All results here are derived while specifically consider- textual, we have to break the symmetry between processes ing the fair testing semantics, and a similar work could be and tests: now a test is a pair (q, σ) where q is a process done for other forms of testing. Standard must testing is and σ is a name substitution, and a process p passes the test defined as p ⊥ q if every maximal execution of p | q even- (q, σ) if pσ | q is successful. The equivalence rules are kept tually reaches a state where the actionω ¯ is available; in our unchanged except for I1 and I5, which are the ones where algebraic setting it simply means that p | q is inconsistent. interaction may occur. The rule I1 is extended as follows, This is equivalent to fair testing in the finitary calculus, with the side condition that |~x| = |~y|: and the difference appears with divergence. Although the u¯ˆh~xi.p | vˆ(~y).q u¯ˆh~xi.(p | vˆ(~y).q) + vˆ(~y).(u¯ˆh~xi.p | q) definition of orthogonality is simpler than in fair testing, the semantics is a bit more complicated. Now we need a + [u=ˆ v] | p | q[~x/~y] new constant Ω to represent pure divergence, and we also In the reduct, [u=ˆ v] is the linear content of the usual match need a constant τ.0 to represent a process that is not null but operator, which is decomposed as may always reduce to 0. Their respective execution rules are Ω → Ω and τ.0 → 0. Then we get the following rules: [u=v].p ' [u=ˆ v] | p + [u,ˆ v]

Ω | p  Ω if p  0 i.e. using also a linear mismatch operator. The meaning of [u=ˆ v] is intuitively “when I am in head position, u and v I30 α.ˆ p | c α.ˆ (p | c) if c = τ.0 or c = Ω will have been unified by substitution”, while [u,ˆ v] means I5 α.0 | α.¯ 0 τ.0 that they will not. Incidentally, this proves that if the match I6 α.0 | τ.0 τ.0 operator is present, then the mismatch operator will auto- matically be available too. Now traces may end not with an inaction set but with τ.0 or Since tests contain name substitutions, these operators Ω, and the syntactic characterisation of the testing preorder can be simplified only if they are are trivial or under binders: has to be extended. The discussion in section 7.2 about in- finite traces also applies in this case. [u=ˆ u] 1 (νu)[u=ˆ v] 0 Doing the same work for may testing, on the other hand, [u,ˆ u] 0 (νu)[u,ˆ v] 1 requires a radical change in the definition of the observa- tion. While consistency is unchanged, we now define that if u and v are distinct names. s ⊥ t if there is a run s | t ⇒∗ r with r inconsistent. We Normalisation requires other equivalence rules, includ- did not study the precise consequences of this, but the re- ing something like [u=ˆ v] | p ' [u=ˆ v] | p[u/v], which is rem- sulting reduction can be expected to be very different, since iniscent of the structural rule for explicit fusions in Gard- most of the soundness arguments use here become invalid. ner and Wischik’s calculus [7]. After introducing all the re- Nevertheless, carrying the same study for other forms of quired rules, we will finally get normal forms that are sums tests would surely provide insight into the genericity of our of extended traces of the form construction; such a generalisation will be discussed in an c1 | αˆ 1.(c2 | αˆ 2 ... (ck | αˆ k.(ck+1 | n)) ...) extended version of the present work. Finally, it is natural to ask whether a similar approach where the ci are conditions, i.e. parallel compositions of lin- could be used to get axiomatisations of some forms of ear matches and mismatches, the αi are transition labels of bisimulation. The answer to this question is likely to be neg- the form u(~x) or (ν~z)¯uh~yi with ~z ⊆ ~y \{u}, and where n is a ative: the decomposition of processes into sums of traces parallel composition of inactions.

11 References

[1] E. Beffara. Logique, réalisabilité et concurrence. PhD the- sis, Université Paris 7, dec 2005. [2] E. Beffara. A concurrent model for linear logic. In 21st International Conference on Mathematical Foundations of Programming Semantics (MFPS), volume 155, pages 147– 168, may 2006. [3] E. Beffara and V. Danos. Disjunctive normal forms and local exceptions. In 8th ACM International Conference on Func- tional Programming (ICFP), pages 203–211. ACM Press, 2003. [4] V. Danos and J.-L. Krivine. Disjunctive tautologies as syn- chronisation schemes. In P. Clote and H. Schwichtenberg, editors, 14th Annual Conference of the European Associa- tion for Logic (CSL), number 1862, pages 292–301. Springer Verlag, 2000. [5] T. Ehrhard and O. Laurent. Interpreting a finitary π-calculus in differential interaction nets. In L. Caires and V. T. Vas- concelos, editors, 18th International Conference on Concur- rency Theory (Concur), volume 4703 of LNCS, pages 333– 348. Springer, Sept. 2007. [6] T. Ehrhard and L. Regnier. The differential λ-calculus. The- oretical Computer Science, 309(1):1–41, 2003. [7] P. Gardner and L. Wischik. Explicit fusions. In M. Nielsen and B. Rovan, editors, 25th International Symposium on Mathematical Foundations of Computer Science (MFCS), volume 1893, pages 373–382. Springer Verlag, 2000. [8] J.-Y. Girard. Locus solum. Mathematical Structures in Com- puter Science, 11(3):301–506, 2001. [9] M. Hennessy. A fully abstract denotational semantics for the π-calculus. Theoretical computer science, 278:53–89, May 2002. [10] N. Kobayashi, B. C. Pierce, and D. N. Turner. Linearity and the π-calculus. ACM Transactions on Programming Lan- guages and Systems, 21(5):914–947, 1999. [11] E.-R. Olderog and C. A. R. Hoare. Specification-oriented semantics for communicating processes. Acta Informatica, 23(1):9–66, 1986. [12] J. Rathke, V. Sassone, and P. Sobocinski.´ Semantic barbs and biorthogonality. In Proceedings of Foundations of Soft- ware Science and Computation Structures, FOSSACS 2007, volume 4423, pages 302–316, 2007. [13] D. Sangiorgi. π-calculus, internal mobility and agent- passing calculi. Theoretical Computer Science, 167(2):235– 274, 1996. [14] D. Sangiorgi and D. Walker. The π-calculus: a theory of mobile processes. Cambridge University Press, 2001. [15] R. J. van Glabbeek. The linear time - branching time spec- trum. In Proceedings of Concur’90, volume 458 of Lecture Notes in Computer Science, pages 278–297. Springer, 1990. [16] L. Vaux. On linear combinations of λ-terms. In Rewriting Techniques and Applications (RTA), volume 4533 of LNCS, June 2007. [17] N. Yoshida, M. Berger, and K. Honda. Strong normalisa- tion in the π-calculus. In 16th IEEE Symposium on Logic in Computer Science (LICS), pages 311–322, 2001.

12 A. Technicalities s(p) ∪ s(q), so associativity and commutativity of the sum are immediate. A.1. Labelled transition system Any slice that contains 0 at top level is inconsistent, hence 0 | s is inconsistent. Since s(p + 0) = s(p) ∪ {0} and Proof of proposition 1. For the “only if” part, consider a 0 | s is inconsistent, we have p + 0 ⊥ s if and only if p ⊥ s, slicing execution s ⇒ t. By definition, there is a slice hence p + 0 ' 0. s0 = E[u¯˚(~x).p | u˚(~x).q], where E is an execution context, and All slices of (0 | p) | s are inconsistent, as well as all those a slice t0 ∈ s(p | q) such such that s ≡ s0 and t ≡ E[(ν~x)t0]. of 0 | s, therefore 0 | p ' 0.  τ The transition u¯˚(~x).p|u˚(~x).q −→ (ν~x)(p|q) holds by definition τ Lemma 9. A slice α.ˆ p|q is successful if and only if for every of the LTS, hence the transition s0 −→ E[(ν~x)(p | q)] holds. τ∗ τ run α.ˆ p | q =⇒ r that consumes the action αˆ there is a run Since t0 ∈ s(p | q) we have s ≡ s0 ⇒= E[(ν~x)t0] ≡ t. τ∗ τ r =⇒ s such that s is inconsistent. ⇒ For the “if” part, consider a transition s = t. By defini- τ∗ tion of the LTS there is a an action α = uε(~x) and a decom- Proof. Ifα. ˆ p | q is successful, then for any runα. ˆ p | q =⇒ r τ∗ position s = E[E1[α.p] | E2[α. ¯ q]] (where E, E1 and E2 are there is a run r =⇒ s such that s is inconsistent, so this holds execution contexts) such that the transition is derived as in particular for the runs that consume the actionα ˆ. τ∗ α α¯ Now assume that for every runα. ˆ p|q =⇒ r that consumes −→ α.¯˚ q −→ q τ∗ α.˚ p p the actionα ˆ there is a run r =⇒ s such that s is inconsistent. ∗ α α¯ τ 0 E1[α. ˚ p] −→ E1[p] E2[α.¯˚ q] −→ E2[q] Consider an arbitrary runα. ˆ p | q =⇒ r . If this run does 0 τ consumeα ˆ, then r has an inconsistent reduct by hypothesis. E [α. ˚ p] | E [α.¯˚ q] −→ (ν~x)(E [p] | E [q]) τ∗ 1 2 1 2 Otherwise the run isα. ˆ p|q =⇒ α.ˆ p|q0. If there is a sequence τ τ∗ α¯ τ∗ s −→ E[(ν~x)(E1[p] | E[q])] of transitions q0 =⇒ q00 ⇒= t, then there is a runα. ˆ p|q =⇒ α.ˆ p| τ q00 ⇒= (ν~x)(p | t) where ~x is the sequence of bound names of and t ∈ s(E[E1[p] | E[q]]). Thus there are slices t1 ∈ s(p) α. Then this is a run that consumesα ˆ so it can be extended and t2 ∈ s(q) such that t = E[E1[t1] | E2[t2]]. By an easy induction on contexts, one can show that there is a sequence into a run that reaches an inconsistent term, by hypothesis. τ∗ α¯ of names ~y and a term r such that the following holds: Finally, if there is no sequence of transitions q0 =⇒ q00 ⇒= t, then every maximal run ofα. ˆ p | q0 leavesα ˆ untouched, 0 s = E[E1[α. ˚ p] | E[α.¯˚ q]] ≡ (ν~y)(r | (α. ˚ p | α.¯˚ q)) which means thatα. ˆ p | q is inconsistent. Thereforeα ˆ is successful.  → (ν~y)(r | (ν~x)(p | q)) ≡ E[(ν~x)(E1[p] | E2[q])] thus there is a slicing execution s ⇒ t.  Proposition 8. For any action α and any term p, we have α.p ' α.ˆ p + α.0.

A.2. Soundness Proof. Let uε(~x) be the action α. We have to show that for any slice q, α.p ⊥ q if and only if α.0 ⊥ q andα. ˆ p ⊥ q. τ∗ The proof of the soundness theorem is mostly decom- First assume that α.p ⊥ q. Consider a runα. ˆ p | q =⇒ r. posed into the various propositions in this section. The Using lemma 9, we assume that the action ofα. ˆ p is con- soundness of  derives from the fact that testing equiva- sumed in this run by a reduct of q, i.e. there are tran- lence contains the structural equivalence ≡ and from propo- τ∗ α¯ sitions q =⇒ q1 ⇒= q2 such that the considered run is sition 7. The soundness of rule S is obvious since p and τ∗ τ τ∗ p + p have the same slices. Rule A is proposition 8. Rules α.ˆ p | q =⇒ α.ˆ p | q1 ⇒= (ν~x)(p | q2) =⇒ r. Thus there is a τ∗ τ τ∗ L1 and L2 are proposition 9. Rule I1 is proposition 10. Rule run α.p | q =⇒ α.p | q1 ⇒= (ν~x)(p | q2) =⇒ r and by hypothesis τ∗ I2 is proposition 11. Rules I3, I4 and I5 are proposition 12. there is a run r =⇒ s with s inconsistent. Thereforeα. ˆ p ⊥ q. Rules N1, N2 and N3 are proposition 13. τ∗ Now consider a run α.0 | q =⇒ r. Two cases may occur: Proposition 7. For any terms p, q, r, the following holds: • Either the action of α.0 is consumed by a reduct of q, τ∗ α¯ p + q ' q + p p + (q + r) ' (p + q) + r i.e. there are transitions q =⇒ q1 ⇒= q2 such that the τ∗ τ τ∗ p + 0 ' p p | 0 ' 0 considered run is α.0 | q =⇒ α.0 | q1 ⇒= (ν~x)(0 | q2) =⇒ r. Then r is null thus inconsistent. Proof. By definition 10, for terms p and q, p ' q means that for any slice s, all slices of p | s are successful if and only • Or the action is not consumed and the run is actually a τ∗ τ∗ if all slices of q | s are successful. By definition s(p + q) = run of q: α.0|q =⇒ α.0|q1 = r. Then α.p|q =⇒ α.p|q1 is

13 τ∗ a valid run, and by hypothesis there is a run α.p|q1 =⇒ s Let s be a slice orthogonal toα. ˆ (p + q), consider a run τ∗ τ∗ with s inconsistent. If this run consumes the action in α.ˆ p | s =⇒ r that consumesα ˆ. Thus the run it isα. ˆ p | s =⇒ τ τ∗ α.p then there is a run of α.0 | q1 which consumes the α.ˆ p | s0 ⇒= (ν~x)(t | s00) =⇒ r where ~x is the set of bound names action in α.0, and the reduct is null thus inconsistent. α¯ of α, s00 is a term such that s0 ⇒= s00 and t is a slice of p. Otherwise the action is not consumed and the run can τ∗ τ∗ | ⇒ | | Then t is a slice of p + q thus the executionα. ˆ (p + q) | s =⇒ be written α.p q1 = α.p q2 with α.p q2 inconsistent. ∗ 0 τ 00 τ This means that α.p|q2 has no consistent maximal run. α.ˆ (p + q) | s ⇒= (ν~x)(t | s ) =⇒ r holds, and by hypothesis r Consider a maximal run of α.0 | q2: if it consumes the has an inconsistent reduct. Thusα. ˆ p ⊥ s, and by the same action of α.0, then it is inconsistent since it reaches a argument we getα. ˆ q ⊥ s, soα. ˆ p + α.ˆ q ⊥ s. null state. Otherwise α.0 is left untouched and the run Now let s be a slice orthogonal toα. ˆ p andα. ˆ q, consider τ∗ is a maximal run of q2, from which we can deduce a a runα. ˆ (p + q) | s =⇒ r that consumesα ˆ. Then the run | τ∗ τ τ∗ maximal run of α.p q2, which is inconsistent by hy- isα. ˆ (p + q) | s =⇒ α.ˆ (p + q) | s0 ⇒= (ν~x)(t | s0) =⇒ r with pothesis. This means that either it reaches a null state, α¯ s0 ⇒= s00 and t ∈ s(p + q) = s(p) ∪ s(q). If t ∈ s(p) then then it is also the case for the run α.0 | q2, or it leaves ∗ ∗ τ 0 τ 00 τ some active linear action untouched, then this action the runα. ˆ p | s =⇒ α.ˆ p | s ⇒= (ν~x)(t | s ) =⇒ r holds, and is produced by a reduct of q2, and the same action is by hypothesis r has an inconsistent reduct. If t ∈ s(q), we never consumed in the run of α.0 | q2. Therefore any conclude by a similar argument, thereforeα. ˆ (p+q) ⊥ s.  maximal run of α.0 | q is inconsistent, and α.0 | q is 2 2 Proposition 10. For all actions α = uε(~x) and terms p inconsistent. and q, Therefore α.0 ⊥ q. α.ˆ p | α.¯ˆ q ' α.ˆ (p | α.¯ˆ q) + α.¯ˆ (α. ˆ p | q) + (ν~x)(p | q) Now assume thatα. ˆ p ⊥ q and α.0 ⊥ q. Consider a run τ∗ α.p | q =⇒ r. Proof. Let s be a slice that is orthogonal toα. ˆ (p | α.¯ˆ q), τ∗ α.¯ˆ (α. ˆ p | q) and (ν~x)(p | q). Consider a runα. ˆ p | α.¯ˆ q | s =⇒ r. • If this run consumes α.p then there is a run ofα. ˆ p|q that leads to r by the same reduction steps. By hypothesis • If the first transition ofα. ˆ p|α.¯ˆ q is labelled α, then there α.p | q r τ∗ α¯ ˆ is successful so has an inconsistent reduct. is a sequence of transitions s =⇒ s0 ⇒= t such that the τ∗ τ τ∗ • If this run does not consume α.p, then we have r = run isα. ˆ p | α.¯ˆ q | s =⇒ α.ˆ p | α.¯ˆ q | s0 ⇒= (ν~x)(p | α.¯ˆ q | t) =⇒ r. τ∗ τ∗ α.p|q0 with q =⇒ q0. By hypothesisα. ˆ p|q and α.0|q are From this we can deduce the executionα. ˆ (p|α.¯ˆ q)| s =⇒ τ τ∗ successful, and soα. ˆ p | q0 and α.0 | q0 have inconsistent α.ˆ (p | α.¯ˆ q) | s0 ⇒= (ν~x)(p | α.¯ˆ q | t) =⇒ r, so by hypothesis reducts. r has an inconsistent reduct. – If r has a run that consumes α.p, then this run is • The case where the first transition ofα. ˆ p|α.¯ˆ q is labelled τ∗ τ α.p | q0 =⇒ α.p | q00 ⇒= (ν~x)(p | t), and (ν~x)(p | t) is α¯ is similar. also a reduct ofα. ˆ p | q0, hence it has an inconsis- • If the first transition ofα. ˆ p|α.¯ˆ q is labelled τ, then there tent reduct. τ∗ is a sequence of transitions s =⇒ s0 such that the run is ∗ ∗ – If there is no run of r that consumes α.p, then τ 0 τ 0 τ 0 α.ˆ p|α.¯ˆ q|s =⇒ α.ˆ p|α.¯ˆ q|s ⇒= (ν~x)(p|q)|s =⇒ r. From this we consider α.0 | q : by hypothesis there is a run τ ∗ 0 τ 00 00 we can deduce the execution (ν~x)(p|q)| s ⇒= (ν~x)(p|q)| α.0 | q =⇒ α.0 | q where α.0 | q is inconsistent. τ∗ 0 ⇒ This does not depend on the 0 that is prefixed s = r, so by hypothesis r has an inconsistent reduct. 00 with α since this α is never consumed, so α.p | q • If the considered run does not contain any transition of is inconsistent too. α.ˆ p | α.¯ˆ q then the run can be extended by one step that reducesα. ˆ p | α.¯ˆ q into (ν~x)(p | q) and we get back to the Therefore r has an inconsistent reduct, and α.p ⊥ q.  previous case. Proposition 9. For all actions α and terms p and q, Therefore s is orthogonal toα. ˆ p | α.¯ˆ q. Now let s be a slice orthogonal toα. ˆ p | α.¯ˆ q. Using α.ˆ 0 ' 0α. ˆ (p + q) ' α.ˆ p + α.ˆ q τ∗ lemma 9, consider a runα. ˆ (p | α.¯ˆ q) | s =⇒ r that consumesα ˆ, Proof. In order to proveα. ˆ 0 ' 0 it suffices to prove that, for then r is a reduct ofα. ˆ p|α.¯ˆ q|s so it has an inconsistent reduct, any slice s,α. ˆ 0 ⊥ s. Let s be an arbitrary slice, consider a therefore we haveα. ˆ (p | α.¯ˆ q) ⊥ s. By a similar argument we τ∗ τ∗ runα. ˆ 0 | s =⇒ r. By lemma 9, assume this run consumesα ˆ, getα. ˆ (p|α.¯ˆ q) ⊥ s. Finally, consider a run (ν~x)(p|q)| s =⇒ r: τ τ∗ then 0 occurs at top level in r so r is inconsistent. the executionα. ˆ p | α.¯ˆ q | s ⇒= (ν~x)(p | q) | s =⇒ r is valid so

14 r has an inconsistent reduct by hypothesis. Therefore s is A.3. Confluence orthogonal toα. ˆ (p | α.¯ˆ q) + α.¯ˆ (α. ˆ p | q) + (ν~x)(p | q).  Proof of lemma 3. We first prove, by induction, that if a Proposition 11. For any non dual actions α and β and slice q has no occurrence of 0 or actions β.q0 with q0  0 at terms p and q, top level, then for allα. ˆ p there is an r such thatα. ˆ p | q ∗ ˆ ˆ ˆ α.ˆ p | β.ˆ q ' α.ˆ (p | β.ˆ q) + β.ˆ (α. ˆ p | q) α.ˆ (p|q)+r. If q = a¯.q1, rule I1 givesα. ˆ p|β.q1 α.ˆ (p|β.q1)+ a¯ˆ.(α. ˆ p | q1) + (ν~x)(p | q1) where ~x = bn(α), so we can choose Proof. The proof is essentially the same as that of proposi- r = α.¯ˆ (α. ˆ p | q1) + (ν~x)(p | q1). If q = β.ˆ q1 with β , α¯, rule I2 tion 10 except that the cases for the interaction between α givesα. ˆ p | β.ˆ q1 α.ˆ (p | β.ˆ q1) + β.ˆ (α. ˆ p | q1), so we can choose ˆ andα ¯ are irrelevant here.  r = β.(α. ˆ p|q1). If q = β.0, rule I3 givesα. ˆ p|β.0 α.ˆ (p|β.0) so we can choose r = 0. If q = q1 | q2, then by induc- ∗ Proposition 12. For any actions α and β and any term p, tion hypothesis on q1 we getα. ˆ p | q1 α.ˆ (p | q1) + r1, so | ' | | ' | ' ∗ we have α.ˆ p β.0 α.ˆ (p β.0), α.0 α.0 α.0 and α.0 α.¯ 0 0. α.ˆ p | q α.ˆ (p | q1) | q2 + r1 | q2. By induction hypothesis ∗ ε on q2 we getα. ˆ (p | q1) | q2 α.ˆ (p | q1 | q2) + r2, hence Proof. Assume α = u (~x). Let s be a slice orthogonal to ∗ 0 τ∗ α.ˆ p | q α.ˆ (p | q) + r1 | q2 + r2. If q = (νx)q , the induc- α.ˆ p|β.0. Using lemma 9, consider a runα. ˆ (p|β.0)|s =⇒ α.ˆ (p| | 0 ∗ | 0 0 ∗ tion hypothesis givesα. ˆ p q α.ˆ (p q ) + r , hence we 0 τ 00 τ 00 0 α¯ 00 β.0) | s ⇒= (ν~x)(p | β.0 | s ) =⇒ r with s such that s ⇒= s , haveα. ˆ p | (νx)q0  (νx)(α. ˆ p | q0) ∗ (νx)α. ˆ (p | q0) + (νx)r0 τ∗ τ τ∗ then the runα. ˆ p|β.0| s =⇒ α.ˆ p|β.0| s0 ⇒= (ν~x)(p|β.0| s00) =⇒ r α.ˆ (p | (νx)q0) by rule N1. The case of 1 is trivial and com- holds, and r has an inconsistent reduct. pletes this proof. Now let s be a slice orthogonal toα. ˆ (p | β.0). Consider Now consider an arbitrary term q. By applications of τ∗ ∗ 0 0 α.p | β. | s ⇒ r rule A we get q q , where q only has actions of the a run ˆ 0 = , and using lemma 9 assume that this 0 run consumesα ˆ. The transition that consumesα ˆ is either formα. ˆ p or α.0 at top level. Up to , q is 0 or a sum of produced by β.0, which may happen if β = α¯, or by a reduct terms of the form used in the first part of the proof. For 0 s r we getα. ˆ p | 0  0 andα. ˆ p | 0 + α.ˆ (p | 0)  0 + α.ˆ 0 0 of . In the first case, 0 occurs at top level in , which is 0 then inconsistent. In the second case, r is a reduct ofα. ˆ (p | by rule L1, hence 0 is a common reduct. If q is a sum 0 P ∗ P β.0) | s so it has an inconsistent reduct by hypothesis. Thus q = i∈I qi, we haveα. ˆ p | q i∈I α.ˆ p | qi, and by rule L2 ∗ P ∗ we getα. ˆ (p | q) α.ˆ (p | qi), soα. ˆ p | q + α.ˆ (p | q) α.ˆ p | β.0 ⊥ s. P i∈I α. α. | α. i∈I α.ˆ p | qi + α.ˆ (p | qi) . For each i, by the first part of the The equivalence of 0 and 0 0 comes from the fact ∗ α proof, there is an ri such thatα. ˆ p | qi α.ˆ (p | qi) + ri, so we that both terms have exactly one transition labelled , lead- ∗ ing to a null term, 0 in one case and 0 | α.0 in the other. haveα. ˆ p | qi + α.ˆ (p | qi) α.ˆ (p | qi) + ri + α.ˆ (p | qi), which For the equivalence of α.0 | α.¯ 0 and 0, consider an arbi- reduces toα. ˆ (p | qi) + ri by rule S. So we finally get that τ∗ α.ˆ p | q andα. ˆ p | q + α.ˆ (p | q) have a common reduct.  trary slice s and run α.0 | α.¯ 0 | s =⇒ r. If this run contains a transition of α.0 | α.¯ 0, then 0 necessarily occurs at top For the proof of theorem 2, let us examine all possible level in r, which is thus inconsistent. Otherwise we have τ∗ critical pairs: r = α.0 | α.¯ 0 | s0 for some run s =⇒ s0, and the transition τ 0 α.0 | α.¯ 0 | s0 ⇒= 0 | 0 | s0 holds. Therefore α.0 | α.¯ 0 ⊥ s for any • A conflict on S is a reduction p + p p + p, versus a 0 s, so α.0 | α.¯ 0 ' 0.  reduction p+ p p, and p is a reduct of both, through p0 + p p0 + p0 p0 in the first case. Proposition 13. For any action uε(~x), any term p and ε ε • any name v , u, we have (νv)ˆu (~x).p ' uˆ (~x).(νv)p, Rules A and L1 have no conflict (because of the side- (νu)ˆuε(~x).p ' 0 and (νu)uε(~x).0 ' 1. conditions). Proof. The first equivalence derives from the fact that • L2/I1: (νv)ˆuε(~x).p andu ˆε(~x).(νv)p both have exactly one transition, | ˆ | ˆ labelled uε(~x), that leads to the same term (νv)p (assuming α.ˆ (p + q) α.¯ r (α. ˆ p + α.ˆ q) α.¯ r without loss of generality that v < ~x). α.ˆ (p + q) | α.¯ˆ r For the second equality, let s be an arbitrary slice. Any α.ˆ ((p + q) | α.¯ˆ r) + α.¯ˆ (α. ˆ (p + q) | r) + (ν~x)((p + q) | r) τ∗ run (νu)ˆuε(~x).p | s =⇒ r leavesu ˆε(~x) untouched, since no occurrence of u may occur in s, therefore (νu)ˆuε(~x) is in- Then the first reduct is structurally equivalent toα. ˆ p | consistent, thus r is inconsistent. α.¯ˆ r + α.ˆ q | α.¯ˆ r, and the following reductions hold: The third equality derives from the fact that (νu)uε(~x).0 | ˆ | ˆ ˆ | | has no free name, no transition, and no linear action or 0 at α.ˆ p α.¯ r α.ˆ (p α.¯ r) + α.¯ (α.p r) + (ν~x)(p r) top level that could produce inconsistencies.  α.ˆ q | α.¯ˆ r α.ˆ (q | α.¯ˆ r) + α.¯ˆ (α.q | r) + (ν~x)(q | r)

15 The summands of the second reduct can be reduced as then by several applications of the R2 and L2 rules we can reduce both terms to α.ˆ ((p + q) | α.¯ˆ r)  α.ˆ (p | α.¯ˆ r + q | α.¯ˆ r) α.ˆ (p | α.¯ˆ r) + α.ˆ (q | α.¯ˆ r) α.ˆ (p | β.ˆ q | γ.ˆ r) + β.ˆ (α. ˆ (p | γ.ˆ r) | q) + β.ˆ (ˆγ.(α. ˆ p | r) | q) α.¯ˆ (α. ˆ (p + q) | r) α.¯ˆ ((α. ˆ p + α.ˆ q) | r) + γ.ˆ (α. ˆ (p | β.ˆ q) | r) + γ.ˆ (β.ˆ (α. ˆ p | q) | r) α.¯ˆ (α. ˆ p | r) + α.¯ˆ (α. ˆ q | r) (ν~x)((p + q) | r)  (ν~x)(p | r) + (ν~x)(p | r) • I2/I3 is resolved like I1/I3. The sums in both cases are equal. • I2/N1 is resolved like I1/N1. • The L2/I2 and L2/I3 conflicts are solved the same way. • I2/N2: if u is the subject name of α, • L2/N1: (νu)α. ˆ p | β.ˆ q (νu)α. ˆ (p | β.ˆ q) + (νu)β.ˆ (α. ˆ p | q) 2 0 + β.ˆ ((νu)α. ˆ p | q) β.ˆ (0 | q) 0 (νv)ˆuε(~x).(p + q) (νv)ˆuε(~x).p + (νv)ˆuε(~x).q (νu)α. ˆ p | β.ˆ q 0 | β.ˆ q 0 2 uˆε(~x).(νv)p + uˆε(~x).(νv)q  (νv)ˆuε(~x).(p + q) uˆε(~x).((νv)p + (νv)q) • I3/I3 can be of two kinds: either the linear action is ε ε uˆ (~x).(νv)p + uˆ (~x).(νv)q involved in two reductions, or it is the inaction. For the first case, we have • L2/N2: α.ˆ p | β.0 | γ.0 α.ˆ (p | β.0) | γ.0 α.ˆ (p | β.0 | γ.0) (νu)ˆuε(~x).(p + q) (νu)ˆuε(~x).p + (νv)ˆuε(~x).q 2 0 + 0 0  α.ˆ p | β.0 | γ.0 α.ˆ (p | γ.0) | β.0 α.ˆ (p | β.0 | γ.0) (νv)ˆuε(~x).(p + q) 0 For the second case we have • I1/I1: This rule is solved in the main part of the text. α.ˆ p | β.ˆ q | γ.0 α.ˆ (p | γ.0) | β.ˆ q • The I1/I2 conflict is resolved in a similar manner. α.ˆ (p | β.ˆ q | γ.0) + β.ˆ (α. ˆ (p | γ.0) | q) • I1/I3: α.ˆ (p | β.ˆ (q | γ.0)) + β.ˆ (α. ˆ (p | γ.0) | q) α.ˆ p | α.¯ˆ q | β.0 α.ˆ p | β.ˆ q | γ.0 β.ˆ (q | γ.0) | α.ˆ p α.ˆ (p | β.0) | α.¯ˆ q α.ˆ (p | β.ˆ (q | γ.0)) + β.ˆ (α. ˆ p | q | γ.0) α.ˆ (p | α.¯ˆ q | β.0) + α.¯ˆ (α. ˆ (p | β.0) | q) + (ν~x)(p | q) | β.0 α.ˆ (p | β.ˆ (q | γ.0)) + β.ˆ (α. ˆ (p | γ.0) | q) α.ˆ p | α.¯ˆ q | β.0 This assumes β , α¯, but the case β = α¯ is similar with ˆ ˆ aˆ.(p | α.¯ q) | β.0 + α.¯ (α. ˆ p | q) | β.0 + (ν~x)(p | q) | β.0 an extra (ν~x)(p | q) | γ.0 in each reduction. 2 aˆ.(p | α.¯ˆ q | β.0) + α.¯ˆ (α. ˆ p | q | β.0) + (ν~x)(p | q) | β.0 • I3/I4: aˆ.(p | α.¯ˆ q | β.0) + α.¯ˆ (α. ˆ (p | β.0) | q) + (ν~x)(p | q) | β.0 α.ˆ p | β.0 | β.0 α.ˆ (p | β.0) | β.0 • / I1 N1: if u < n(α), α.ˆ (p | β.0 | β.0) α.ˆ (p | β.0) (νu)α. ˆ p | α.¯ˆ q α.ˆ p | β.0 | β.0 α.ˆ p | β.0 α.ˆ (p | β.0) (νu)α. ˆ (p | α.¯ˆ q) + (νu)α.¯ˆ (α. ˆ p | q) + (νu~x)(p | q) • I3/I5: 3 α.ˆ ((νu)p | α.¯ˆ q) + α.¯ˆ (α. ˆ (νu)p | q) + (ν~x)((νu)p | q) (νu)α. ˆ p | α.¯ˆ q α.ˆ p | β.0 | β.¯ 0 α.ˆ (p | β.0) | β.¯ 0 α.ˆ (νu)p | α.¯ˆ q α.ˆ (p | β.0 | β.¯ 0) α.ˆ (p | 0) 0 α.ˆ ((νu)p | α.¯ˆ q) + α.¯ˆ (α. ˆ (νu)p | q) + (ν~x)((νu)p | q) α.ˆ p | β.0 | β.¯ 0 α.ˆ p | 0  0

• For I2/I2, assume we have two reductions • I3/N1: if u < n(α):

α.ˆ p | β.ˆ q | γ.ˆ r α.ˆ (p | β.ˆ q) | γ.ˆ r + β.ˆ (α. ˆ p | q) | γ.ˆ r (νu)α. ˆ p | β.0 (νu)α. ˆ (p | β.0) α.ˆ ((νu)p | β.0) α.ˆ p | β.ˆ q | γ.ˆ r α.ˆ (p | γ.ˆ r) | β.ˆ q + γ.ˆ (α. ˆ p | r) | β.ˆ q (νu)α. ˆ p | β.0 α.ˆ (νu)p | β.0 α.ˆ ((νu)p | β.0)

16 • I3/N2: if u is the subject name of α, {a + ]s(p) + ]s(q)} with {a + ]s(p), a + ]s(q)}. Rule I2 is α.ˆ p|β.ˆ q t α.ˆ (p|β.ˆ q)+β.ˆ (α. ˆ p|q), it replaces {a+]s(p)+]s(q)} (νu)α. ˆ p | β.0 (νu)α. ˆ (p | β.0) 0 with {a + ]s(p), a + ]s(q)}. Rule I3 isα. ˆ p | β.0 t α.ˆ (p | β.0), (νu)α. ˆ p | β.0 0 | β.0  0 it replaces {a + ]s(p) + 1 with {a + ]s(p)}. Rules I4, N2 and N3 remove an action in a slice so the decrease a value in • I3/N3: if u is the subject name of β, N. Rules S, L1 and I5 removes a term of the sum so they remove an element of N. Rule N1 removes a bound name α.ˆ p | (νu)β.0 (νu)α. ˆ (p | β.0) from the top level of a slice, so it decreases a value in N. α.ˆ (p | (νu)β.0) α.ˆ (p | 1)  α.ˆ p Since the multiset order is well founded, this proves that there is no infinite sequence of without the rule I1. α.ˆ p | (νu)β.0 α.ˆ p | 1  α.ˆ p t  Proof of lemma 6. It is clear that a slice p has a τ transition • I4/I4 and I5/I5 are obvious if and only if the rule I1 can be applied at top level in p, so • I4/I5: if p has an infinite run then there is an infinite sequence of I1 reductions, hence an infinite sequence of t. α.0 | α.0 | α.¯ 0 α.0 | α.¯ 0 0 Now assume p has an infinite sequence of t reductions. α.0 | α.0 | α.¯ 0 α.0 | 0  0 If rule S is used at some point, we can remove it from the reduction and still get a valid infinite reduction, with extra This solves all the possible conflicts between the rules. summands at each step, so we assume the sequence does not use S. Let p0 = p. Let i be an integer, assume pi has an A.4. Termination infinite reduction. Then some slice si of pi has an infinite reduction. Define ri and pi+1 such that pi = si +ri, si t pi+1 and p has an infinite reduction. For all i, let q = p + Proof of lemma 4. We reason by case analysis on the i+1 i i P r , then q q q ... is an infinite reduction of p. rewriting rules. We can assume without loss of generality j > rules in a similar way.  it is enough to prove the result for p t q. This derives from the fact that all sequences of transitions in slices of q Proof of lemma 5. We define a measure N(p) on are also present in some slice of p. The only exception is terms. A term p, up to , can always be written p q P Q when t uses rule I1, in which case for a sequence of i∈I(ν~xi) j∈Ji α˚ i j.pi j, in a unique way up to permutation, transitions of q there is the same sequence in p, possibly assuming ~x is minimal. Then let N(p) be the multiset n i o with an extra τ at the beginning.  | | P s ∈ ~xi + j∈Ji ] (pi j) + ki j i I , where ki j = 1 ifα ˚ i j is affine and pi j  0 and ki j = 0 otherwise. Then each rule Proof of proposition 3. Suppose p has an infinite sequence except I1 makes N decrease strictly, for the multiset order, of reductions. As above, we assume without loss of gener- when applied at top level: Rule A is α.p t α.ˆ p + α.0 ality that rule S is not used. For any reductions p q t r if p  0, so it replaces {a + ]s(p) + 1}, where a is where p q is not at top level, there is a term q0 such that 0 ∗ 0 ∗ the contribution of the context, with {a + ]s(p), a + 1}, p t q r, with no reduction at top level in q r and this is strictly decreasing since ]s(p) > 1 for any (this is proved by case analysis on the reduction q t r, we 0 ∗ 0 term p. Rule L2 isα. ˆ (p + q) t α.ˆ p + α.ˆ q, it replaces have to use q r and not q r because several rules

17 duplicate or erase subterms using sums). Therefore p also If min(|t|, |u|) > 1, then t|u has the formα. ˆ t0|β.ˆ u0. If β , α¯ has an infinite sequence of reductions where all reductions then t | u has no execution, so it is inconsistent since the at top level are done first. Since kpk is finite, kpkt is finite, linear actions at top level cannot be consumed. Therefore and by lemma 6 we know that it has no infinite sequence β = α¯, and every maximal run starts with the execution step ∗ 0 0 0 τ 0 0 of top-level reductions. Therefore we have p t p where α.ˆ t | α.¯ˆ u ⇒= (ν~x)(t | u ), with ~x = bn(α). This implies that 0 p has an infinite sequence of reductions not at top level, t0 and u0 are not orthogonal, and we conclude by induction so there is a slice s ∈ s(p) that has this property. If we Q hypothesis. write s = (ν~x) i∈I α˚ i.pi, since there the considered infinite Reciprocally, it is clear that two traces t = αˆ 1 ... αˆ k.m sequence has no reduction at top level, all reduction steps and u = α¯ˆ 1 ... α¯ˆ k.n with m ∩ n¯ = ∅ are not orthogonal, since occur in one of the pi, and reductions in different pi’s are t|u has a run of length k that leads to m|n which is consistent independent. Therefore there is a pi that has an infinite se- and irreducible. k k k k− k 0k− quence of reductions. We have pi = α˚ i.pi 1 6 p 1, Now let t = αˆ 1 ... αˆ k.m and u = βˆ1 ... βˆ`.n be traces such 0 and by lemma 7 we have kp k 6 kpk, hence kpik < kpk. We that t v u, i.e. {t}⊥ ⊆ {u}⊥. Let γ be an action such that conclude by induction on kpk.  ˆ γ.0 < n. Let v = β¯1 ... βˆ`.γ.¯ 0, then by the characterisation above we get u 6⊥ v, hence t 6⊥ v, so we have |t| = |u¯| = |u|, A.5. Trace semantics α¯ i = β¯i for all i, and γ.0 < m. So t and u have the same action part, and an inaction that is not in n cannot be in m, Proof of proposition 4. Up to structural equivalence, every hence m ⊆ n. Pa Qbi term can be written (ν~xi) si j where the si j have the i=1 j=1 Finally, assume u = αˆ 1 ... αˆ k.n with m ⊆ n. A trace that form α.p,α. ˆ p or 0 (the product stands for parallel composi- ⊥ 0 0 is not in {u} has the form α¯ˆ 1 ... α¯ˆ k.n with n ∩ n¯ = ∅, so by tion). Assume an irreducible term t is a parallel composition inclusion n0 ∩ m¯ = ∅ and this trace is also not orthogonal to Qb j=1 s j of such terms. None of the s j is an affine action with t, hence {t}⊥ ⊆ {u}⊥, i.e. t v u.  a continuation other than 0, otherwise the A rule would ap- ply. If j = 0 then s = 1 and it is the trace of length 0 with Proof of lemma 8. For any term q define [q]0 as the term the empty inaction part. If j > 2, then none of the s j is a obtained by replacing each occurrence of the actionω ¯ in linear action, otherwise one of the I rules could apply. Thus q by 0. First assume p is successful, and consider a run ∗ t is either one linear action with an irreducible continuation [p]ω ⇒ q. By hypothesis ω < fn(p) so an occurrence p, in this case p is not a sum or 0 because of the L rules, ofω ¯ in [p]ω can never be consumed, so we can deduce a ∗ or t is a parallel composition of inactions. This shows that run p ⇒ [q]0. Since p is successful we can deduce a run ∗ irreducible terms are sums of terms of the form (ν~x)t. All [q]0 ⇒ r such that r is inconsistent. Quasi-standard terms terms of the form (νv)ˆuε(~x).p are reducible by one of the are stable under slicing execution, so r is quasi-standard, so N rules, therefore an irreducible term without sums has the the only way for r to be inconsistent is to have an occurrence 0 formα ˆ 1 ... αˆ k.(ν~x)n where n is an irreducible parallel com- of 0 at top level: r ≡ 0 | r . From this we deduce a run ∗ 0 position of inactions. If n contains several occurrences of q ⇒ [r]ω ≡ ω¯ | [r ]ω. ∗ a given α.0 then it is reducible by I4, and if it contains an Now assume that for any run [p]ω ⇒ q there is a run α.0 and the dualα. ¯ 0 then it is reducible by I5, therefore n is q ⇒∗ ω¯ | r, and consider a run p ⇒∗ q. Then the run ∗ ∗ actually an inaction set. If u < fn(n) then (νu)n  n, and if [p]ω ⇒ [q]ω holds, thus there is a run [q]ω ⇒ ω¯ | r. By u ∈ fn(n), then all inactions uε(~x).0 reduce to 0 by N3, after the same argument as above, an occurrence ofω ¯ can never what (νu) can be removed. Therefore ~x is empty if the term be consumed in a run of [q]ω therefore replacingω ¯ by 0 ∗ is irreducible. The fact that S does not apply proves that the preserves the run, and we can deduce a run q ⇒ [ω ¯ | r]0 = terms in an irreducible sum are pairwise distinct.  0 | [r]0. Thus p is successful.  Proof of proposition 6. Assume t and u are two traces that are not orthogonal. We show by induction on min(|t|, |u|) that |t| = |u|. If the minimum length is 0, if t or u has not length 0 (say it is t, without loss of generality), then t | u has the formα. ˆ t0 | n where n is an inaction set. Then a maximal run of t|u either consumesα ˆ using an inaction, which makes 0 appear at top level, or it does not consumeα ˆ and it is inconsistent, so t ⊥ u. Therefore |t| = |u| = 0. By hypothesis t | u has a consistent maximal run, so it has no execution, since consuming any action in it would make 0 appear at top level. Therefore t | u does not contain dual actions, which is the expected property.

18