aa r X i v : . [ c s . L O ] J u l Functions as proofs as processes
Emmanuel Beffara
Institut de Mathématiques de LuminyUMR6206, Université Aix-Marseille II & CNRS
January 5, 2007
Abstract.
This paper presents a logical approach to the translation of functional calculi intoconcurrent process calculi. The starting point is a type system for the π -calculus closely relatedto linear logic. Decompositions of intuitionistic and classical logics into this system providetype-preserving translations of the λ - and λµ -calculus, both for call-by-name and call-by-valueevaluation strategies. Previously known encodings of the λ -calculus are shown to correspondto particular cases of this logical embedding. The realisability interpretation of types in the π -calculus provides systematic soundness arguments for these translations and allows for thedefinition of type-safe extensions of functional calculi. The π -calculus was introduced in the late 1980’s as a core model of concurrent computation,in the same way as the λ -calculus is a core model of functional computation. Soon afterwards,Milner showed in the seminal paper Functions as processes [14] that the λ -calculus could beprecisely encoded into the π -calculus. Around the same time, Girard introduced linear logic asa logic to study fine properties of denotational models of intuitionistic logic. Indeed the ideasbehind it led to significant insights on the structure and semantics of the λ -calculus and functionalcomputation, along the lines of the functions as proofs slogan. It might not be a coincidencethat these two contributions appeared at the same time, and intuitions from one have been seenin the other from the beginning. Formal connections appeared some years later, giving formalground to the proofs as processes idea, in particular in work by Abramsky [1, 2] and in a notablecontribution by Bellin and Scott as an encoding of proof nets in the π -calculus [5].The purpose of this paper is to present a formal way to make these pieces fit together. Weuse a recent version of the proofs-as-processes approach [4, 3] as a way to make a link between aform of π -calculus (with more symmetry and expressiveness) and a form of linear logic (with thesignificant difference that formulas have arities). In this framework, we adapt previous work byDanos, Joinet and Schellinx on the translation of classical logic into linear logic [8, 9]. We showthat, when considering each logic as a type system, we can extract a family of typed translationsof the λ - and λµ -calculi into the π -calculus. The now familiar duality [7] between call-by-nameand call-by-value appears clearly in our system, moreover several previously known translationsare shown to fit in as particular instances of the general technique.Our type system for the π -calculus was developed by realisability as a logic of behaviours ofconcurrent processes. We show that this realisability construction can be used to prove propertiesof the considered execution models of the λ -calculus. We also argue that realisability provides away to introduce new constructs in functional calculi while keeping the type system semanticallycorrect. 1arallel composition and scoping: p | q ≡ q | p ( p | q ) | r ≡ p | ( q | r ) p | ≡ p ( ν x )( ν y ) p ≡ ( ν y )( ν x ) p ( ν x )( p | q ) ≡ p | ( ν x ) q if x / ∈ fv( p ) ( ν x )1 ≡ ≡ x = x x = y ≡ y = x x = y | p [ x/z ] ≡ x = y | p [ y/z ]Replication and reduction:! α.p ≡ α. ( p | ! α.p ) u ( ~x ) .p | ¯ u ( ~x ) .q → ( ν ~x )( p | q )Table 1: Structural congruence and reduction. The concurrent calculus we use, hereafter named π = -calculus, is a formulation of π -calculus withexplicit fusions (à la Gardner and Wischik [11]) with binding input and output. We assume aninfinite set N of names, ranged over by the letters u, v, x, y, z . The calculus is generated by thefollowing grammar:actions: α ::= u ( x . . . x n ) input¯ u ( x . . . x n ) binding outputprocesses: p, q ::= α.p, ! α.p linear action, guarded replication1 , p | q, ( ν x ) p inaction, parallel composition, hiding x = y name unificationThe operational semantics of the calculus is defined as a reduction relation up to structuralcongruence, with the rules in table 1. The reduction relation is the smallest relation → that isclosed under structural congruence, parallel composition and hiding and that contains u ( ~x ) .p | ¯ u ( ~x ) .q → ( ν ~x )( p | q ). We consider a strong bisimilarity relation ∼ = whose precise definition(that can be found in the appendix) uses a labelled transition system. The point is that ∼ = is acongruent equivalence such that p ∼ = q implies that for each reduction p → p ′ there is a reduction q → q ′ with p ′ ∼ = q ′ .We use this calculus instead of a more standard form of π -calculus because it provides a cleardistinction between synchronisation and name substitution. It also allows a cleaner type system.By combining binding actions and equators, we get usual non-binding actions with their usualsemantics, by defining ¯ u h x . . . x n i := ¯ u ( y . . . y n ) . ( x = y | . . . | x n = y n ) We assume a set V of type variables, ranged over by X or Y . The language of formulas isgenerated by the following grammar: A, B ::= X | X ⊥ | A ⊗ B | A ` B | ´ A | ˆ A | ! A | ? A | ∃ X.A | ∀
X.A V → N , the arity ofa formula is defined as ar( † A ) := 1 with † ∈ { ˆ , ´ , ? , ! } ar( ∃ X.A ) := ar( ∀ X.A ) := ar( A )ar( A ⊗ B ) := ar( A ` B ) := ar( A ) + ar( B )The dual (or linear negation) is the involution ( · ) ⊥ defined as X ⊥⊥ := X and( A ⊗ B ) ⊥ := A ⊥ ` B ⊥ ( ´ A ) ⊥ := ˆ ( A ⊥ )( ∀ X.A ) ⊥ := ∃ X. ( A ⊥ ) (! A ) ⊥ := ?( A ⊥ )A type Γ is a sequence ~x : A , . . . , ~x n : A n where each A i is a formula and each ~x i is asequence of names of length ar( A i ). All the names occurring in all the ~x i must be distinct. ˆ Γdenotes a sequent where all formulas have the form ˆ A or ? A , and ?Γ denotes a sequent whereall formulas have the form ? A . A typing judgement is written p ⊢ Γ, where p is a process and Γis a type. A process p has type Γ if p ⊢ Γ is derivable by the rules of table 2.We call LLa (for linear logic with arities) this logical system. The inference rules are those ofmultiplicative-exponential linear logic (MELL), extended with the linear modalities ˆ and ´ . Themain difference is in the rule for the existential quantifier: ∃ X.A can be deduced from A [ B/X ]only when X and B have the same arity. As a consequence, although the language of MELLis a subset of our language of types, provability of a sequent Γ in MELL is not equivalent toprovability of Γ in LLa. λµ -calculus Our model of functional computation is the λµ -calculus [15]. We assume an infinite set of λ -variables ranged over by x, y and an infinite set of µ -variables ranged over by α, β . Terms aregenerated by the following grammar: M, N ::= x | λx.M | ( M ) N | µα [ β ] M Thus we consider the version of the calculus where µα and [ β ] cannot appear separately. Thelanguage of types is minimal second-order logic, i.e. A, B ::= X | A → B | ∀ X.A
A typing judgement has the form Γ ⊢ M : A | ∆ where Γ is a sequence of type assignments x : A for distinct λ -variables and ∆ is a sequence of type assignments α : A for distinct µ -variables.The typing rules are given in table 3. The intuitionistic fragment, i.e. system F, is the fragmentof this calculus where µα [ β ] is never used and where the ∆ part is always empty. λ -calculus and head linear reduction The basis of linear logic is the decomposition of intuitionistic implication A → B into an linearimplication and an exponential modality, as ! A ⊸ B . The idea is that linear implication A ⊸ B = A ⊥ ` B is the actual implication, while the modalities ! A and ? A control weakening andcontraction. In this section, we describe the operational meaning of this embedding.3xiom and cut: u = v | . . . | u k = v k ⊢ ~u : X ⊥ , ~v : X p ⊢ Γ , ~x : A q ⊢ ~x : A ⊥ , ∆( ν ~x )( p | q ) ⊢ Γ , ∆Multiplicatives: p ⊢ Γ , ~x : A q ⊢ ∆ , ~y : Bp | q ⊢ Γ , ∆ , ~x~y : A ⊗ B p ⊢ Γ , ~x : A, ~y : Bp ⊢ Γ , ~x~y : A ` B Actions: p ⊢ Γ , ~x : A ¯ u ( ~x ) .p ⊢ Γ , u : ˆ A p ⊢ Γ , ~x : A ¯ u ( ~x ) .p ⊢ Γ , u : ? A p ⊢ ˆ Γ , ~x : Au ( ~x ) .p ⊢ ˆ Γ , u : ´ A p ⊢ ?Γ , ~x : A ! u ( ~x ) .p ⊢ ?Γ , u : ! A Exchange, contraction and weakening: p ⊢ Γ , ~x : A, ~y : B, ∆ p ⊢ Γ , ~y : B, ~x : A, ∆ p ⊢ Γ , u : ? A, v : ? Ap [ w/u, v ] ⊢ Γ , w : ? A p ⊢ Γ p ⊢ Γ , u : ? A Quantifiers: p ⊢ Γ , ~x : A X / ∈ fv(Γ) p ⊢ Γ , ~x : ∀ X.A p ⊢ Γ , ~x : A [ B/X ] ar( B ) = ar( X ) p ⊢ Γ , ~x : ∃ X.A
Table 2: Typing rules for the π = -calculus.Intuitionistic rules: Γ , x : A ⊢ x : A | ∆ Γ , x : A ⊢ M : B | ∆Γ ⊢ λx.M : A → B | ∆Γ ⊢ M : A → B | ∆ Γ ⊢ N : A | ∆Γ ⊢ ( M ) N : B | ∆Quantifiers: Γ ⊢ M : A | ∆ X / ∈ fv(Γ , ∆)Γ ⊢ M : ∀ X.A | ∆ Γ ⊢ M : ∀ X.A | ∆Γ ⊢ M : A [ B/X ] | ∆Control: Γ ⊢ M : B | α : A, β : B, ∆Γ ⊢ µα [ β ] M : A | β : B, ∆Table 3: Typing rules for the λµ -calculus.4 Definition.
Let LJ be the language of formulas generated by variables and → as the onlyconnective. The translation A of a formula A is defined as X := X ( A → B ) := ! A ⊸ B where each variable of LJ is mapped to a variable of arity 1 in LLa.Here propositional variables are considered as base types of arity 1. A functional type A →· · · → A n → X is thus translated into a formula of arity n + 1. The translation of formulasnaturally induces a translation of type derivations.2 Definition.
The translation of a simply typed λ -term M at type A on channels ~y (with | ~y | =ar( A )) is the process J M K A ~y defined as J x K A ~y := ¯ x h ~y i J λx.M K A → B x~y := J M K B ~y J ( M ) N K B ~y := ( ν x )( J M K A → B x~y | ! x ( ~z ) . J N K A ~z )The soundness and faithfulness of this translation are easily checked:3 Proposition.
A judgement x : A , . . . , x n : A n ⊢ M : B is derivable in LJ if and only if J M K B ~y ⊢ x : ?( A ) ⊥ , . . . , x n : ?( A n ) ⊥ , ~y : B is derivable in LLa . Let us now study the operational meaning of the translation. Remark that, up to structuralcongruence, redexes can be permuted without affecting the translation, i.e. the translation cap-tures σ -equivalence [16]. Subsequently, we get that τ -transitions in the translations correspondto what is known as head linear reduction [10]. We briefly recall the definition of these twonotions:4 Definition. σ -equivalence is the congruence over λ -terms generated by( λx.M ) N P = σ ( λx. ( M ) P ) N ( λxy.M ) N = σ λy. ( λx.M ) N with x / ∈ fv( P ) and y / ∈ fv( N ). Any λ -term M can be normalised as M = σ λx . . . x k ( λy . . . y n . ( x ) M . . . M p ) N . . . N n Head linear reduction is the relation over σ -equivalence classes generated by λx . . . x k . ( λy . . . y n . ( y i ) M . . . M p ) N . . . N n → λx . . . x k . ( λy . . . y n . ( N i ) M . . . M p ) N . . . N n Proposition.
For any simply typed λ -term Γ ⊢ M : A , J M K A ~y is bisimilar to M for head linearreduction.Proof. First note that for M and N of type A , if M = σ N then J M K A ~y ≡ J N K A ~y , so we canconsider terms up to σ -equivalence. Consider a typed term Γ ⊢ M : A . By σ -equivalence weassume that M is written λ~x. ( λ~y. ( x ) ~M ) ~N with | ~y | = | ~N | . Call A i the type of each x i , B i thetype of each y i and N i (these are the same since M is well typed), and call C i the type of each M i . Thus we have A = A . . . A k → B and x has type C . . . C p → B . Then we have J M K A ~x~z = ( ν ~y~u ) (cid:0) ¯ x h ~u~z i (cid:12)(cid:12) Q pi =1 J u i = M i K C i (cid:12)(cid:12) Q nj =1 J y j = N j K B j (cid:1) with J x = T K A := ! x ( ~y ) . J T K A ~y . The only possible reduction in this process is ¯ x h ~u~z i interactingwith one of the J u i = M i K C i or J y j = N j K B j . By construction x cannot be one of the u i , so5 M K A ~x~z has a τ -transition if and only if x = y j for some j . In this case, we can remark that thefollowing reduction holds:¯ y j h ~u~z i | J y j = N j K B j → J N j K B j ~u~z | J y j = N j K B j Putting this reduction in context, we get that the reduct of J M K A ~x~z , up to structural congruence,is J λ~x. ( λ~y. ( N j ) ~M ) ~N K A ~x~z . Therefore, τ -transitions in translations of λ -terms strictly correspondto head linear reductions in the terms.Interestingly, this translation was first described by Hyland and Ong as a syntax for strategiesin a game semantics of PCF [13], thus with different (but clearly related) arguments. The translation presented above is remarkably light. However, the arity of the translation of aterm depends on its type, and as a consequence polymorphism in the style of system F does nothold. Modal translations [8] are a generalisation of the standard embedding of intuitionistic logicinto linear logic, which allow full polymorphism by providing a type-independent (and type-safe)translation.6
Definition.
A generalised modality is a word γ over { ˆ , ´ , ? , ! } . The dual of γ is the modality¯ γ such that ( γX ) ⊥ = ¯ γX ⊥ . A modal translation of LK into LLa is defined by a pair ( γ, δ ) ofgeneralised modalities. The translation A ∗ of a formula A is defined as X ∗ := X ( A → B ) ∗ := γ ( A ∗ ) ⊸ δ ( B ∗ ) ( ∀ X.A ) ∗ := ∀ X. ( A ∗ )where each variable of LK is mapped to a variable of arity 2 in LLa. For Γ = { x i : A i } i n ,define Γ ∗ := { x i : A ∗ i } i and Γ ∗⊥ := { x i : ( A ∗ i ) ⊥ } i . For a generalised modality γ , define γ Γ := { x i : γA i } i . A type Γ ⊢ A | ∆ is translated at a channel u into the type ¯ γ Γ ∗⊥ , u : δA ∗ , δ ∆ ∗ . Amodal translation ( γ, δ ) is valid if Γ ⊢ A | ∆ holds if and only if ⊢ LLa ¯ γ Γ ∗⊥ , δA ∗ , δ ∆ ∗ holds.An important fact needs to be stressed: in the source language LK, any variable can besubstituted by any formula. On the other hand, in the target language LLa, a variable canonly be substituted by a formula of the same arity. Note that a translation commutes withsubstitution, i.e. ( A [ B/X ]) ∗ = A ∗ [ B ∗ /X ], if and only if variables are preserved, therefore anytranslation must assign sensible arities to variables. For this substitution to be correct in anycase, we must ensure that the arity of A ∗ is independent from A . This condition is satisfied ifand only if neither γ nor δ is empty, and then ar( A ∗ ) = 2 for any A . Definition.
Given a non-empty generalised modality γ and names u and ~x , define the proto-col γu ( ~x ) .p as ´ u ( ~x ) .p := u ( ~x ) .p , ˆ u ( ~x ) .p := ? u ( ~x ) .p := ¯ u ( ~x ) .p , and inductively γ † u ( ~x ) .p := γu ( v ) . † v ( ~x ) .p for a fresh name v . In the case of the empty modality ε , let εu ( x ) .p := p [ u/x ], and εu ( ~x ) .p is undefined for | ~x | 6 = 1.Note that protocols are typed in the expected way: p ⊢ Γ , ~x : A implies γu ( ~x ) .p ⊢ Γ , u : γA .If γ contains ! then the context must be ?Γ, else if γ contains ´ then the context must be ˆ Γ. Fora modal translation ( γ, δ ) to be valid for classical logic, essentially two conditions are required: • It must be possible to apply weakening and contraction to formulas ¯ γA and δA , i.e. γ muststart with ! and δ must start with ?. 6 For the application rule, it must be possible to deduce a common modality ζ from γ and δ , in a context of ¯ γ and δ modalities, which essentially implies that one of γ, δ must be asuffix of the other.For a pair ( γ, δ ) to be valid for intuitionistic logic, contraction and weakening of δ formulas isnot required, and contexts only contain ¯ γ formulas.Let ( γ, δ ) be a modal translation for which these conditions are satisfied. Let Γ and ∆ betypes where all formulas start with the modalities ¯ γ or δ . We can deduce the translation of therules for λ and µ independently of the modalities: p ⊢ Γ , x : ¯ γA ⊥ , v : δBp ⊢ Γ , xv : γA ⊸ δBδu ( xv ) .p ⊢ Γ , u : δ ( γA ⊸ δB ) p ⊢ Γ , u : δB, α : δA, β : δBp [ β/u ] ⊢ Γ , α : δA, β : δB Hence we get J λx.M K u := δu ( xv ) . J M K v J µα [ β ] M K α := J M K β The formulation of the translation of µα [ β ] M is valid since α -conversion can be applied to thevariable bound by µ . The fact that µα [ β ] does not modify the process in any other way stressesthe fact that the µ binder is nothing more than a way to name conclusions of a proof in thesequentialised syntax of λ -calculus.It is clear that the introduction rule for ∀ is not affected by the translation. There is aslight difference for the elimination rule: the λ -calculus is a syntax for natural deduction withintro/elim, while our type system for the π -calculus is a sequent calculus with only introductionrules and an actual cut rule. We can translate the elimination rule for ∀ by using an extra cutand axiom: p ⊢ Γ , u : ∀ X.A u = v ⊢ u : A [ B/X ] ⊥ , v : A [ B/X ] u = v ⊢ u : ∃ X.A ⊥ , v : A [ B/X ]( ν u )( p | u = v ) ⊢ Γ , v : A [ B/X ]By structural congruence we have ( ν u )( p | u = v ) ≡ p [ v/u ], hence we can also accept the eliminationrule itself in our type system. For the application rule, assume there is a generalised modality ζ of which γ and δ are suffixes, and set γ ′ and δ ′ such that ζ = γ ′ γ = δ ′ δ . Then the translation ofapplication is: p ⊢ Γ , v : δ ( γA ⊸ δB ) ¯ δv h xu i ⊢ v : ¯ δ ( γA ⊗ ( δB ) ⊥ ) , x : ( γA ) ⊥ , u : δB ( ν v )( p | ¯ δv h xu i ) ⊢ Γ , x : ( γA ) ⊥ , u : δB ¯ γ ′ z ( x ) . ( ν v )( p | ¯ δv h xu i ) ⊢ Γ , z : ( ζA ) ⊥ , u : δB q ⊢ ∆ , w : δAδ ′ z ( w ) .q ⊢ ∆ , z : ζA ( ν z )(¯ γ ′ z ( x ) . ( ν v )( p | ¯ δv h xu i ) | δ ′ z ( w ) .q ) ⊢ Γ , ∆ , u : δB As explained above, one of γ, δ must be a suffix of the other, so one of γ ′ , δ ′ must be empty. Wethus have two cases for the axiom, depending on which one it is: u ′ = u ⊢ u ′ : ( δA ) ⊥ , u : δA ¯ δ ′ x h u i ⊢ x : ( γA ) ⊥ , u : δA x = x ′ ⊢ x : ( γA ) ⊥ , x ′ : γAγ ′ u h x i ⊢ x : ( γA ) ⊥ , u : δA When both γ ′ and δ ′ are empty, these cases collapse into u = x ⊢ x : ( γA ) ⊥ , u : δA .7 and δ are given, γ ′ , δ ′ are such that γ ′ γ = δ ′ δ . J x K γδ u := u = x if γ = δ ¯ δ ′ x h u i if γ = δ ′ δγ ′ u h x i if δ = γ ′ γ J λx.M K γδ u := δu ( xv ) . J M K γδ v J ( M ) N K γδ u := ( ν z ) (cid:16) ¯ γ ′ z ( x ) . ( ν v ) (cid:0) J M K γδ v | ¯ δv h xu i (cid:1) | δ ′ z ( w ) . J N K γδ w (cid:17) J µα [ β ] M K γδ α := J M K γδ β Table 4: General case translation of λµ into π .8 Definition.
Let ( γ, δ ) be pair of non-empty generalised modalities. The translation J M K γδ u ofa λ -term M is defined inductively by the rules of table 4.9 Theorem.
Let ( γ, δ ) be a valid modal translation. For any λµ -term M , Γ ⊢ M : A | ∆ isderivable if and only if J M K γδ u ⊢ ¯ γ Γ ∗⊥ , u : δA ∗ , δ ∆ ∗ is derivable. Actions in the π -calculus, in particular replications, are blocking. As a consequence, in thestandard semantics, there is no reduction inside replications, so the execution of J M K does notrepresent the full β -reduction. In the following sections, we give a detailed description of thisexecution. As explained above, there are two cases, depending on which of γ, δ is a suffix of theother:10 Definition.
A pair of generalised modalities ( γ, δ ) is called left-handed if δ is a suffix of γ . It iscalled right-handed if γ is a suffix of δ . Here we consider the left-handed case, i.e. with γ = δ ′ δ for some non-empty δ ′ . As a simplificationwe consider the case where δ and δ ′ are simple modalities, one easily checks that the other casesare not significantly different. The validity constraints impose δ ′ = !, and δ has to be ? for theclassical case.To describe precisely the operation of translated terms, we introduce a new form of term ♯M and define a continuation K as M . . . M k α where α is a µ -variable and the M i are terms. Anexecutable is a pair M ∗ K , equivalence ≡ and execution → of executables are defined as( M ) N ∗ K ≡ M ∗ N K ♯M ∗ K → M ∗ Kµα [ β ] M ∗ K ≡ M [ K/α ] ∗ β λx.M ∗ N K → M [ ♯N/x ] ∗ K The substitution M [ M . . . M n α/β ] is the substitution of every subterm of the form [ β ] N of M by [ α ]( N ) M . . . M n . The translation of terms is extended to executables as J α K u := α = u J x = M K := δ ′ x ( u ) . J M K u J M K K u := ( ν vz )(¯ δu h zv i | J z = M K | J K K v ) J α = K K := J K K α J ♯M K u := ( ν x )( J x K u | J x = M K ) J M ∗ K K := ( ν u )( J M K u | J K K u )11 Proposition.
For any call-by-name executables e and e , e ≡ e implies J e K ∼ = J e K and e → e if and only if J e K → J e K . γ = !?, δ = ?): J x K u = ¯ x h u i J λx.M K u = ¯ u ( xv ) . J M K v J ( M ) N K u = ( ν v ) (cid:0) J M K v | ! v ( xy ) . (! x ( w ) . J N K w | y = u ) (cid:1) Intuitionistic call-by-name ( γ = ! ´ , δ = ´ ): J x K u = ¯ x h u i J λx.M K u = u ( xv ) . J M K v J ( M ) N K u = ( ν vx ) (cid:0) J M K v | ! x ( w ) . J N K w | ¯ v h xu i (cid:1) Classical call-by-value ( γ = !, δ = ?!): J x K u = ¯ u h x i J λx.M K u = ¯ u ( y ) . ! y ( xv ) . J M K v J ( M ) N K u = ( ν w ) (cid:16) ! w ( x ) . ( ν v ) (cid:0) J M K v | ! v ( w ) . ¯ w h xu i (cid:1) (cid:12)(cid:12)(cid:12) J N K w (cid:17) Intuitionistic call-by-value ( γ = !, δ = !): J x K u = u = x J λx.M K u = ! u ( xv ) . J M K v J ( M ) N K u = ( ν vw ) (cid:0) J M K v | J N K w | ¯ v h wu i (cid:1) Table 5: Particular cases of translations.9 roof.
Remark that the translation J M K u of a variable or an abstraction has exactly one transi-tion, labelled by an action on u or on a variable. Similarly, the translation J K K u of a continuationeither is an equator u = α or has a unique transition labelled by an action on u . J ♯M K u has asingle transition to a process bisimilar to J M K u . Then the key of the proof is the remark thatbindings correctly implement substitution up to bisimilarity, i.e. ( ν α )( J e K | J α = K K ) ∼ = J e [ K/α ] K for any fresh name α , and ( ν x )( J e K | J x = M K ) ∼ = J e [ ♯M/x K for any fresh name x . The rule for µα [ β ] applies only in the classical case, then ¯ δ starts with ! and continuations are replicable.Details can be found in the appendix.Executing a λµ -term simply means executing it on a continuation α for a fresh variable α ,since J M K α ≡ J M ∗ α K . Hence we can summarise this result as:12 Theorem.
Left-handed translations implement call-by-name execution.
The case for γ = ! ´ and δ = ´ is an adaptation of the standard ! A ⊸ B decomposition thatallows polymorphism. Operationally, it exactly corresponds to Milner’s translation [14]. The casefor γ = !? and δ = ? corresponds to the system known as LKT in Danos-Joinet-Schellinx. As faras we know, its operational counterpart in the π -calculus is new. These particular translationsare shown in table 5. In the classical case, the application uses an equator y = u which is notstandard π -calculus, however it can be argued that replacing it by a forwarder ! y ( ab ) . ¯ u h ab i doesnot affect the validity of the translation, although the step-by-step operational description is abit heavier to formulate. We now consider the right-handed case, i.e. with δ = γ ′ γ . As in the previous section, weassume without loss of generality that γ is a single modality, necessarily ! because of the validityconstraints. We now have two main choices for γ ′ , namely ? for the classical case and ˆ for theintuitionistic case. We now have to distinguish values, terms and continuations:values V, W := x | λx.V terms M, N := V | ( M ) N | µα [ K ] M | V · W continuations K, L := α | KM f | KV a An executable is a pair K ∗ M . Equivalence and execution are defined as KM f ∗ V → KV a ∗ MK ∗ ( M ) N ≡ KM f ∗ N KW a ∗ V → K ∗ V · WK ∗ µα [ L ] M ≡ L ∗ M [ K/α ] K ∗ λx.M · V → K ∗ M [ V /x ]A continuation contains functions as unevaluated terms M f and arguments as values V a , soarguments are evaluated first. The terms V · W and µα [ K ] M are introduced to get a precise10isimulation. Translations are extended as J V K u := γ ′ u ( x ) . J x = V KJ ( M ) N K u := ( ν v )( J v = uM f K | J N K v ) J V · W K u := ( ν xy )( J x = V K | J y = W K | ¯ γx h yu i ) J x = y K := x = y J x = λy.M K := γx ( yu ) . J M K u J α = β K := α = β J α = KM f K := ( ν v )( ¯ γ ′ α ( x ) . ( ν u )( J M K u | ¯ δu h xv i ) | J v = K K ) J α = KV a K := ( ν vx )( J x = V K | ¯ δα h xv i | J v = K K ) J µα [ K ] M K α := ( ν β )( J β = K K | J M K β ) J K ∗ M K := ( ν u )( J u = K K | J M K u )13 Proposition.
For any call-by-value executables e and e , e ≡ e implies J e K ∼ = J e K and e → e if and only if J e K → J e K .Proof. The proof follows the same principle as in call-by-name. The substitution lemma nowstates ( ν x )( J e K | J x = V K ) ∼ = J e [ V /x ] K ) where e is an executable, V is a value and x is a λ -variable;the same lemma for µ -variables and continuations also holds. We then remark that translationsof terms and continuations always have at most one transition, and the correspondence with theoperational semantics above is easily checked. Details can be found in the appendix.Given a fresh µ -variable α , once again we get J M K α = J α ∗ M K , hence the semantics aboveprecisely describes the execution of translations of λµ -terms in right-handed translations, whichcan be summarised as follows:14 Theorem.
Right-handed translations implement call-by-value execution.
The case for γ = ! and δ = ?! corresponds to the system called LKQ in Danos-Joinet-Schellinx.Operationally, we get exactly Honda, Yoshida and Berger’s translation [6, 12]. The case for γ = !and δ = ˆ ! is a version of this translation linearised with respect to conclusions. It is actuallyvery close to Milner’s encoding of call-by-value λ -calculus [14], which corresponds to the slightlymore expensive decomposition ( A → B ) ∗ = ´ (! A ∗ ⊸ ˆ ! B ∗ ).The simplest intuitionistic version is obtained by taking γ = δ = !, which is both left- andright-handed. It is easy to check that the operational meaning of this translation is an extensionof the call-by-value strategy where functions and arguments can be executed in parallel. Thesetranslations are shown in table 5. The previous sections define a family of type-preserving translations of the λµ -calculus intothe π = -calculus, and provide a detailed description of the operational semantics induced bythe translations. Since the operational translations are deduced from simple embeddings ofintuitionistic and classical logics into linear logic, we can expect more semantic interpretations.The soundness of the type system we use for processes is formulated using realisability, asdescribed in the following section. 11 .1 Soundness of LLa
For a finite set of names I , a process p has interface I if fv( P ) ⊆ I .15 Definition.
An observation is a set ⊥ of processes of empty interface. Given an observation ⊥ , two processes p and q of interface I are orthogonal, written p ⊥ q , if ( ν I )( p | q ) ∈ ⊥ . Anobservation ⊥ is valid if • ⊥ is closed under bisimilarity, • if p has a unique labelled transition p τ −→ p ′ and p ′ ⊥ q then p ⊥ q .If A is a set of processes of interface I , its orthogonal is the set A ⊥ := { p : I | ∀ q ∈ A , p ⊥ q } .A behaviour is a set A such that A = A ⊥⊥ . The complete lattice of behaviours of interface I isnoted B I .Let ( u i ) i ∈ N be an infinite sequence of pairwise distinct names. Let B k := B u ...u k . Avaluation of propositional variables is a function ρ that associates, to each variable X of arity k ,a behaviour ρ ( X ) ∈ B k . Given a valuation ρ , the interpretation of a type A localised at ~x , with | ~x | = ar( A ), is the behaviour J ~x : A K ρ of interface ~x defined inductively by J x . . . x n : X K ρ := v ( X )[ x /u , . . . , x n /u n ] J ~x~y : A ⊗ B K ρ := { ( p | q ) | p ∈ J ~x : A K ρ, q ∈ J ~y : B K ρ } ⊥⊥ J u : ´ A K ρ := { u ( ~x ) .p | p ∈ J ~x : A K ρ } ⊥⊥ J ~x : ∃ X k .A K ρ := (cid:0)S X ∈ B k J ~x : A K ( ρ [ X := X ]) (cid:1) ⊥⊥ and J ~x : A ⊥ K ρ := ( J ~x : A K ρ ) ⊥ . Exponential modalities require a more subtle definition: for eachname u , define the contraction δ u over behaviours of interface { u } as δ u ( A ) := { p [ u/v, w ] | p ∈ A [ v/u ] ` A [ w/u ] } ⊥⊥ where v and w are fresh names. Then, for a behaviour B of interface { x . . . x n } , define F u ( B , X ) := (cid:0) J u : ˆ B K ∪ { u } ⊥ ∪ δ u ( X ) (cid:1) ⊥⊥ . This operator is obviously monotonic in X ,and the interpretation of exponential modalities is defined as a fixed point of it: J u : ? A K ρ := lfp( X 7→ F u ( J ~x : A K ρ, X )) J u : ! A K ρ := ( J u : ?( A ⊥ ) K ρ ) ⊥ Finally, a type Γ = ~x : A , . . . , ~x n : A n is interpreted as J Γ K ρ := (cid:8) ( p | . . . | p n ) (cid:12)(cid:12) p ∈ J ~x : A K ρ ⊥ , . . . , p n ∈ J ~x n : A n K ρ ⊥ (cid:9) ⊥ Definition.
Given an observation, a process p realises a type Γ if p ∈ J Γ K ρ for any valuation ρ .This fact is written p (cid:13) Γ.From the definition of observations and the interpretation of formulas, we easily deduce theadequacy theorem (we do not expose the proof here, a detailed study on this technique can befound in other works by the author [3, 4]):17
Theorem. If p ⊢ Γ is derivable, then p (cid:13) Γ for any observation ⊥ . The usual notions of testing fit in our notion of observation, for instance:18
Proposition.
Let ω be a channel, assume ω is not taken into account in interfaces. Define themust-testing observation as { p | ∀ p → ∗ q, ∃ q → ∗ ω | r } . Must-testing is a valid observation. Proposition.
Let p ⊢ Γ be a typed process such that any propositional variable occurring in Γ is under a modality. For any reduction p → ∗ p ′ there is a reduction p ′ → ∗ p ′′ such that p ′′ has avisible action.Proof. We use the must-testing observation with a channel ω that does not occur in p . Notethat ω ∈ J ~x : A K for any formula A , hence u ( ~x ) .ω ∈ J u : ´ A K . By similar arguments we get u ( ~x ) .ω ∈ J u : ! A K , ¯ u ( ~x ) .ω ∈ J u : ˆ A K and ¯ u ( ~x ) .ω ∈ J u : ? A K . Moreover it is clear that, for q ∈ J A K and r ∈ J B K , ( q | r ) ∈ J A ⊗ B K and ( q | r ) ∈ J A ` B K . Each name u i occurring in Γoccurs with a polarity ε i (depending on the modality that introduces it) and a particular arity.Let t := Q i ¯ u ε i i ( ~x ) .ω , by the above remarks we know that t ∈ ( J Γ K ρ ) ⊥ for any valuation ρ . Thisimplies that, for any reduction p | t → ∗ p ′ | t there is a reduction p ′ | t → ∗ ω | q . Since ω onlyoccurs in t , this implies that an action in t must be triggered during this reduction. By inductionon the typing rules, on proves that if all type variables occur under modalities, no equator in p can relate free names, hence triggering an action in t must be done by an action in a reduct of p ′ .20 Corollary.
The execution of a typed λµ -term in call-by-name or call-by-value always ends witha λ - or µ -variable in active position.Proof. Let Γ ⊢ M : A | ∆ be a typed λµ -term. Using non-divergence as the observation we canprove that J M K α has no infinite reduction. Consider a reduction J M K α → ∗ p with p irreducible.By proposition 19 we deduce that p must have a visible action, and this action can only be on α or a name that occurs in Γ or ∆. Conclude by reasoning on the shape of translations of terms:in call-by-name, executables with visible actions are x ∗ K or λx.M ∗ α ; in call-by-value they are K ∗ x · V or α ∗ λx.M . λµ -calculus Realisability presents the type system LLa as an axiomatisation of the algebra of process be-haviours. This allows for the introduction of new logical connectives and new rules: by semanticmeans (i.e. by reasoning on the reductions of processes) we can define the interpretation of aconnective as an operation on sets of processes. If we prove the adequacy of a new logical rule,we can then use it as a typing rule for processes with the guarantee that any property that isproved by realisability is preserved; this includes termination and deadlock-freeness.This technique can be used to extend the typed λµ -calculus. As soon as a connective canbe translated into LLa (possibly extended as explained above), a translation of the underlyingsyntax is deduced the same way as for the core calculus, which induces an evaluation strategy.This provides a framework for extending our type-preserving translations, without loosing anyof the properties of the translations. We now provide some examples of these ideas. Product types
Products can be added to the λµ -calculus by means of a pair of constructs forintroduction and elimination:Γ ⊢ M : A | ∆ Γ ⊢ N : B | ∆Γ ⊢ ( M, N ) : A × B | ∆ Γ ⊢ M : A × B | ∆ Γ , x : A, y : B ⊢ N : C | ∆Γ ⊢ let x, y = M in N : C | ∆Given a pair ( γ, δ ), we extend the translation of types by ( A × B ) ∗ = γA ∗ ⊗ γB ∗ . Note that,when γ and δ are not empty, the arity of ( A ⊗ B ) ∗ is 2, hence polymorphism is preserved. The13ranslation of terms is extended as follows: J ( M, N ) K γδ u := δu ( xy ) . ( δ ′ x ( v ) . J M K γδ v | δ ′ y ( w ) . J N K γδ w ) J let x, y = M in N K γδ u := ( ν v )( J M K γδ v | ¯ δv ( xy ) . J N K γδ u )In both strategies, let x, y = M in N must reduce M into a pair before evaluating N . Theevaluation of the parts of a pair in call-by-value is done in parallel since δ ′ is empty. We leaveto the reader the formulation of precise evaluation rules. Sum types
Sum types in λµ can be defined as follows (with i ∈ { , } ):Γ ⊢ M : A i | ∆Γ ⊢ inj i M : A + A | ∆ Γ ⊢ M : A + A | ∆ Γ , x i : A i ⊢ N i : C | ∆Γ ⊢ case M of { inj i x i → N i } : C | ∆Decomposing this in linear logic requires the additives ⊕ and &. The general rules in LLa arecomplicated, but here we only need simplified versions: p ⊢ Γ , u : ˆ Ap ⊢ Γ , uv : ˆ A ⊕ ˆ B p ⊢ Γ , ~x : A q ⊢ Γ , ~y : Bu ( ~x ) .p + v ( ~y ) .q ⊢ Γ , uv : ´ A & ´ B assuming the underlying π -calculus has guarded choice. We get adequacy by defining J uv : A ⊕ B K ρ := ( J u : A K ρ ∪ J v : B K ρ ) ⊥⊥ and interpreting A & B by duality. The sum type of λµ is translated as ( A + B ) ∗ = ˆ γA ∗ ⊕ ˆ γB ∗ (which preserves polymorphism). The translation ofterms follows: J inj i M K u := δu ( a a ) . ˆ δ ′ a i ( v ) . J M K v J case M of { inj i x i → N i } K u := ( ν v ) (cid:0) J M K v (cid:12)(cid:12) ¯ δv ( ab ) . P i a i ( x i ) . J N i K u (cid:1) Obviously, in any strategy, the evaluation of case M of { inj i x i → N i } must always reduce M into an inj i before proceeding. Subtyping
Behaviours of a given interface form a complete lattice, with intersection as thelower bound and bi-orthogonal of the union as the upper bound. Write ∧ and ∨ these dualconnectives with ar( A ∧ B ) = ar( A ) = ar( B ). This induces subtyping over types, defined as A B if J A K ⊆ J B K , and the rules: p ⊢ Γ , ~x : A p ⊢ Γ , ~x : Bp ⊢ Γ , ~x : A ∧ B p ⊢ Γ , ~x : Ap ⊢ Γ , ~x : A ∨ B p ⊢ Γ , ~x : A A Bp ⊢ Γ , ~x : B It is clear that all connectives except negation are increasing for this relation, and that A B if and only if B ⊥ A ⊥ . By the interpretation of modalities we also get ! A ´ A and ˆ A ? A .Subtyping rules in λµ can be written asΓ ⊢ M : A | ∆ Γ ⊢ M : B | ∆Γ ⊢ M : A ∩ B | ∆ Γ ⊢ M : A | ∆ A B Γ ⊢ M : B | ∆Translations are extended as ( A ∩ B ) ∗ = A ∗ ∧ B ∗ . The usual subtyping rules, like ( A → B ) ( A ′ → B ′ ) if A ′ A and B B ′ , hold through translation.14 ix points The fact that behaviours form complete lattices also guarantees that any increasingfunction over behaviours of a fixed interface have (least and greatest) fix points. We can thusextend LLa with dual constructs µX.A and νX.A , with the constraints that ar( X ) = ar( A )and that X does not occur as X ⊥ in A . The typing rules for fix points are rather technicalto formulate, mainly because the proper rule for νX.A requires the introduction of a recursionoperator in the π -calculus. Fix points in the types for λµ -calculus would be simply translated as( µX.A ) ∗ = µX. ( A ∗ ). The constraint that permits polymorphism à la system F also allows thisfix point to be used for any A where X only occurs positively.These various extensions to the type system can be freely combined. Other extensions, no-tably with concurrent primitives, could be studied in a similar way. However, for this purpose, itseems necessary to enforce serious linearity in the calculus. This fits naturally in our type systemfor the π -calculus but it is incompatible with full control in the style we get from translations offull classical logic. Precise studies of this idea are deferred to further work. References [1] Samson
Abramsky . Computational interpretations of linear logic . Theoretical ComputerScience, 111(1–2):3–57, 1993.[2] Samson
Abramsky . Proofs as processes . Theoretical Computer Science, 135(1):5–9, 1994.[3] Emmanuel
Beffara . Logique, réalisabilité et concurrence . PhD thesis, Université Paris 7,dec 2005.[4] Emmanuel
Beffara . A concurrent model for linear logic . In 21st International Conferenceon Mathematical Foundations of Programming Semantics (MFPS), volume 155, pages 147–168, may 2006.[5] Gianluigi
Bellin and Philip J.
Scott . On the π -calculus and linear logic . TheoreticalComputer Science, 135(1):11–65, 1994.[6] Martin Berger , Kohei
Honda and Nobuko
Yoshida . Genericity and the π -calculus . In 6thInternational Conference on Foundations of Software Science and Computational Structures(FoSSaCS), volume 2620, pages 103–119. Springer Verlag, apr 2003.[7] Pierre-Louis Curien and Hugo
Herbelin . The duality of computation . In 5th ACM In-ternational Conference on Functional Programming (ICFP), pages 233–243. ACM Press,2000.[8] Vincent
Danos , Jean-Baptiste
Joinet and Harold
Schellinx . Lkq and lkt: Sequent calculifor second order logic based upon linear decomposition of classical implication . In Jean-Yves
Girard , Yves
Lafont and Laurent
Regnier , editors, Advances in Linear Logic, pages211–224. Cambridge University Press, 1995.[9] Vincent
Danos , Jean-Baptiste
Joinet and Harold
Schellinx . A new deconstructive logic:linear logic . Journal of Symbolic Logic, 62:755–807, 1996.[10] Vincent
Danos and Laurent
Regnier . How abstract machines implement head linear re-duction . Submitted, 2003. 1511] Philippa
Gardner and Lucian
Wischik . Explicit fusions . In Mogens
Nielsen andBranislav
Rovan , editors, 25th International Symposium on Mathematical Foundationsof Computer Science (MFCS), volume 1893, pages 373–382. Springer Verlag, 2000.[12] Kohei
Honda , Nobuko
Yoshida and Martin
Berger . Control in the π -calculus . In 4thACM-SIGPLAN Continuation Workshop, 2004.[13] J. Martin E. Hyland and Chih-Hao Luke
Ong . Pi-calculus, dialogue games and pcf . In7th ACM Conference on Functional Programming Languages and Computer Architecture,pages 96–107, 1995.[14] Robin
Milner . Functions as processes . In 17th International Colloquium on Automata,Languages and Programming (ICALP), pages 167–180. Springer Verlag, 1990.[15] Michel
Parigot . λµ -calculus: an algorithmic interpretation of classical natural deduction .In 3rd International Conference on Logic Programming and Automated Reasoning (LPAR),volume 624, chapter Lecture Notes in Computer Science, pages 190–201. Springer Verlag,1992.[16] Laurent Regnier . Une équivalence sur les λ -termes . Theoretical Computer Science,126(2):281–292, 1994. 16xioms and context rules for unification: x = y (cid:15) x = y p (cid:15) x = yp | q (cid:15) x = y p (cid:15) x = yq | p (cid:15) x = y p (cid:15) x = y z / ∈ { x, y } ( ν z ) p (cid:15) x = y Reflexivity, symmetry and transitivity of equators: p (cid:15) x = y p (cid:15) x = yp (cid:15) y = x p (cid:15) x = y p (cid:15) y = zp (cid:15) x = z Renaming of transition labels: p (cid:15) u = v u, v / ∈ { x . . . x n } p (cid:15) u ε ( x . . . x n ) = v ε ( x . . . x n ) p (cid:15) u = u ′ p (cid:15) v = v ′ p (cid:15) [ u = v ] = [ u ′ = v ′ ]Table 6: Rules for name unification. A Technical details
A.1 Bisimulation in π = A polarity ε is an element of { ´ , ˆ } . ´ is called positive and ˆ is called negative. The notation u ε ( ~x ) stands for u ( ~x ) if ε = ´ and for ¯ u ( ~x ) if ε = ˆ .Two names x and y are unified by a process p if p (cid:15) x = y is derivable using the rules oftable 6. Note that an action like u ( x ) .y = z does not unify y and z , i.e. the equator y = z is inactiveas long as the action u ( x ) has not been consumed. A transition can have one of three kinds oflabels: e ::= u ε ( x . . . x n ) visible action (with the x i fresh and distinct)[ u = v ] conditional internal reduction τ internal reductionThe notation p (cid:15) a = b is extended to transition labels as detailed in table 6. For a label e , n( e )is the set of names that occur in e , i.e. n( u ( x . . . x n )) = { u, x . . . x n } , n([ u = v ]) = { u, v } andn( τ ) = ∅ . The labelled transition system of the calculus is defined in table 7.A simulation is a relation S over processes such that p S q implies that • for any x, y ∈ N , p (cid:15) x = y implies q (cid:15) x = y , • for each transition p e −→ p ′ there is a transition q e −→ q ′ such that p ′ S q ′ .A bisimulation is a relation S such that both S and S − are simulations. Two processes p and q are bisimilar if there is a bisimulation S such that p S q .17ctions (with α = u ε ( x . . . x n )) and composition: α.p α −→ p ! α.p α −→ p | ! α.p p ¯ u ( x ...x n ) −−−−−−→ p ′ q v ( x ...x n ) −−−−−−→ q ′ p | q [ u = v ] −−−→ ( ν x . . . x n )( p ′ | q ′ )Renaming: p e −→ p ′ p (cid:15) e = e ′ p e ′ −→ p ′ p [ u = v ] −−−→ p ′ p (cid:15) u = vp τ −→ p ′ Context: p e −→ p ′ p | q e −→ p ′ | q p e −→ p ′ q | p e −→ q | p ′ p e −→ p ′ x / ∈ n( e )( ν x ) p e −→ ( ν x ) p ′ Table 7: Labelled transition system.
A.2 Simulation in call-by-name
For the “push” rule, we have: J ( M ) N ∗ K K = ( ν u ) (cid:16) ( ν z ) (cid:0) ( ν v )( J M K v | ¯ δv h zu i ) (cid:12)(cid:12) J z = N K (cid:1) (cid:12)(cid:12)(cid:12) J K K u (cid:17) ≡ ( ν uvz ) (cid:0) J M K v (cid:12)(cid:12) ¯ δv h zu i (cid:12)(cid:12) J z = N K (cid:12)(cid:12) J K K u (cid:1) ≡ ( ν v ) (cid:16) J M K v (cid:12)(cid:12)(cid:12) ( ν u ) (cid:0) ( ν z )(¯ δv h zu i | J z = N K ) (cid:12)(cid:12) J K K u (cid:1)(cid:17) ≡ ( ν v ) (cid:0) J M K v (cid:12)(cid:12) ( ν uz )( J v = N u K | J K K u ) (cid:1) = J M ∗ N K K For the substitution rule for continuations, consider a process ( ν α )( J M K u | J K K α ), with K = M . . . M k β . When δ starts with ?, each J K K α is a guarded replication on channel α . Byconstruction there is no other input on α so each output on α can only interact with J K K α .Hence, up to bisimilarity, we can distribute J K K α in J M K u by substituting each action ¯ α ( ~x ) .p by ( ν α ′ )(¯ α ′ ( ~x ) .p | J K K α ′ ) for a fresh α ′ . All output occurrences of α occur in processes of theform J µθ [ α ] N K θ = J N K α , but ( ν α ′ )( J N K α ′ | J K K α ′ ) = J N ∗ K K and by the previous rule we have J N ∗ K K ≡ J ( N ) M . . . M k ∗ β K = J µθ [ β ]( N ) M . . . M k K θ . By this rule we can deduce the validityof the rule for µα [ β ]: J µα [ β ] M ∗ K K = ( ν α ) (cid:0) J M K β (cid:12)(cid:12) J K K α (cid:1) ∼ = J M [ K/α ] K β ≡ J M [ K/α ] ∗ β K In the intuitionistic case the rule is not applicable, but it would hold too under the conditionthat each µ -variable is used linearly. For the ♯M rule, we have: J ♯M ∗ K K = ( ν ux ) (cid:0) ¯ δ ′ x h u i (cid:12)(cid:12) δ ′ x ( v ) . J M K v (cid:12)(cid:12) J K K u (cid:1) → ( ν ux ) (cid:0) J M K u (cid:12)(cid:12) J K K u (cid:12)(cid:12) δ ′ x ( v ) . J M K v (cid:1) ∼ = ( ν u ) (cid:0) J M K u (cid:12)(cid:12) J K K u (cid:1) = J M ∗ K K where → contains one transition for each modality in the word δ ′ . Since J K K u and E are blockedon actions that cannot be on channel x , this reduction is clearly the only one possible. The term δ ′ x ( v ) . J M K v is not consumed since δ ′ must contain !, however there is no other occurrence of x so we can discard it by bisimilarity. 18or the substitution rule for terms, the argument is the same as for continuations. In thiscase, the only outputs on the channel of a λ -variable x are of the form J x K u = ¯ δ ′ x h u i , hence afterdistribution of J x = M K we get ( ν x ′ )( J x ′ K u | J x ′ = M K ) = J ♯M K u for a fresh x ′ . For the “pop”rule, we thus have J λx.M ∗ N K K = ( ν u ) (cid:16) δu ( xv ) . J M K v (cid:12)(cid:12)(cid:12) ( ν w ) (cid:0) ( ν z )(¯ δu h zw i | J z = N K ) (cid:12)(cid:12) J K K w (cid:1)(cid:17) ≡ ( ν uwx ) (cid:0) δu ( xv ) . J M K v (cid:12)(cid:12) ¯ δu h xw i (cid:12)(cid:12) J x = N K (cid:12)(cid:12) J K K w (cid:1) → ( ν uwx ) (cid:0) J M K w (cid:12)(cid:12) ¯ δu h xw i (cid:12)(cid:12) J x = N K (cid:12)(cid:12) J K K w (cid:1) ≡ ( ν wx ) (cid:0) J M K w (cid:12)(cid:12) ( ν u )¯ δu h xw i (cid:12)(cid:12) J x = N K (cid:12)(cid:12) J K K w (cid:1) ∼ = ( ν wx ) (cid:0) J M K w (cid:12)(cid:12) J x = N K (cid:12)(cid:12) J K K w (cid:1) ∼ = ( ν w ) (cid:0) J M [ ♯N/x ] K w (cid:12)(cid:12) J K K w (cid:1) = J M [ ♯N/x ] ∗ K K where → contains one transition for each modality in the word δ . In the classical case, ¯ δu h xw i is not consumed since ¯ δ contains !, however we know that u does not occur elsewhere since allduplications of continuations are performed by the rule for µα [ β ], so this action becomes inactiveand it is bisimilar to the empty process. As above, this reduction is the only one possible. A.3 Simulation in call-by-value
The substitution rule for continuations and the equivalence rule for µα [ β ] hold by the samearguments as in the case of call-by-name.For the first equivalence, we have J K ∗ ( M ) N K = ( ν u ) (cid:0) J u = K K (cid:12)(cid:12) ( ν v )( J v = uM f K | J N K v ) (cid:1) ≡ ( ν v ) (cid:0) ( ν u )( J u = K K | J v = uM f K ) (cid:12)(cid:12) J N K v (cid:1) = J KM f ∗ N K For the first reduction rule, we have J KM f ∗ V K = ( ν u ) (cid:16) ( ν v ) (cid:0) ¯ γ ′ u ( x ) . ( ν w )( J M K w | ¯ δw h xv i ) (cid:12)(cid:12) J v = K K (cid:1) (cid:12)(cid:12)(cid:12) γ ′ u ( x ) . J x = V K (cid:17) ≡ ( ν uv ) (cid:0) ¯ γ ′ u ( x ) . ( ν w )( J M K w | ¯ δw h xv i ) (cid:12)(cid:12) J v = K K (cid:12)(cid:12) γ ′ u ( x ) . J x = V K (cid:1) → ( ν uvx ) (cid:0) ¯ γ ′ u ( x ) . ( ν w )( J M K w | ¯ δw h xv i ) (cid:12)(cid:12) ( ν w )( J M K w | ¯ δw h xv i ) (cid:12)(cid:12) J v = K K (cid:12)(cid:12) J x = V K (cid:1) ≡ ( ν w ) (cid:0) ( ν u )¯ γ ′ u ( x ) . ( ν w )( J M K w | ¯ δw h xv i ) (cid:12)(cid:12) J M K w (cid:12)(cid:12) ( ν vx )( J x = V K | ¯ δw h xv i | J v = K K ) (cid:1) ∼ = J KV a ∗ M K where → contains one transition for each modality in the word γ ′ . In the classical case ¯ γ ′ contains! so the continuation at u is not consumed, however we know that u has no other occurrencesince continuations are duplicated by the rule for µ , so we can erase the residual term on u bybisimilarity. This is the only possible reduction as soon as γ ′ is not empty. The second reduction19ule is deduced as J KW a ∗ V K = ( ν u ) (cid:0) ( ν vx )( J x = W K | ¯ δu h xv i | J v = K K ) (cid:12)(cid:12) γ ′ u ( z ) . J z = V K (cid:1) ≡ ( ν uvx ) (cid:0) J x = W K (cid:12)(cid:12) ¯ δu h xv i (cid:12)(cid:12) J v = K K (cid:12)(cid:12) γ ′ u ( z ) . J z = V K (cid:1) → ( ν uvx ) (cid:0) J x = W K (cid:12)(cid:12) ¯ γz h xv i (cid:12)(cid:12) J v = K K (cid:12)(cid:12) J z = V K (cid:1) ≡ J K ∗ V · W K where → contains one transition for each modality in the word γ ′ , since δ = γ ′ γ . As above, thisis the only reduction. For the substitution rule, we have J K ∗ λx.M · V K = ( ν u ) (cid:0) J u = K K (cid:12)(cid:12) ( ν vz )( γv ( xw ) . J M K w | J z = V K | ¯ γv h zu i ) (cid:1) → ( ν u ) (cid:0) J u = K K (cid:12)(cid:12) ( ν x )( J M K u | J x = V K ) (cid:1) ∼ = ( ν u ) (cid:0) J u = K K (cid:12)(cid:12) J M [ V /x ] K u (cid:1) = J K ∗ M [ V /x ] K where there is one transition for each modality in γ . The step after the reduction is an instanceof the substitution lemma ( ν x )( J M K u | J x = V K ) ∼ = J M [ V /x ] K . This lemma holds by the sameargument as in the case of call-by-name: the binding J x = V K can be distributed to all occurrencesof x , but any occurrence of x occurs in a binding J y = x K so we have( ν x )( J y = x K | J x = M K ) = ( ν x )( y = x | J x = M K ) ≡ ( ν x )( y = x ) | J y = M K ∼ = J y = M K using the obvious bisimilarity ( ν x )( x = y ) ∼∼