• No results found

Proof of Lemma 4.6 The implication from 1 to 2 is immediate, with A0 = νex.A. The implication from 2 to 3 is also obvious. Let us prove the implication from 3 to 1. Since (ex = fM )ϕ(A), we have {x} ⊆ dom(ϕ(A)) = dom(A), so A ≡ νe n.({e Mf0/

xe} | σ | P ) for someen, Mf0, σ, and P such that the variables of dom(A) do not occur in fM0, the image of σ, nor P . We rename en so that these names do not occur in fM . Since (ex = fM )ϕ(A), we have Mf0= fM {Mf0/

ex}σ = fM {Mf/

ex}σ using that {Mf/

ex} is cycle-free, so A ≡ νen.({Mf/

xe} | σ | P ). Since the namesn do not occur in fe M , A ≡ {Mf/

ex} | νn.(σ | P ) ≡ {e Mf/

ex} | νex.A, which proves 1.

Proof of Lemma 4.8 We prove the implication from left to right by induction on the derivation of A−−−−−−→ Aνex.N hM i 0. Precisely, we prove the result for all z that do not occur in the derivation of A−−−−−−→ Aνex.N hM i 0.

• Case Out-Term. We have A = NhMi.P −−−−→ P = AN hM i 0 and ex is empty. Let z /∈ fv (N hM i.P ). By Out-Var, A = NhMi.P −−−−−→ P | {νz.N hzi M/z} ≡ {M/z} | A0, so by Struct, A−−−−−→ {νz.N hzi M/z} | A0.

• Case Open-Var. The transition A = νex.B−−−−−−→ Aνx.N hM ie 0 is derived from B −−−−→ AN hM i 0 with {x} ⊆ fv (M ) \ fv (N ) ande x solvable in {e M/z0} | A0 for some z0∈ f v(A/ 0) ∪ {ex}. By induction hypothesis, B−−−−−→ {νz.N hzi M/z} | A0for all z that do not occur in the derivation of B −−−−→ AN hM i 0, so z does not occur in A = νex.B−−−−−−→ Aνex.N hM i 0 since {ex} ⊆ fv (M ). By Scope, A = νx.Be −−−−−→ ννz.N hzi ex.({M/z} | A0), since {x} ∩ fv (N ) = ∅.e

• Case Scope. The transition A = νu.B−−−−→ νu.BN hM i 0= A0is derived from B−−−−→ BN hM i 0, where u does not occur in N hM i. (The restriction of the rule Scope guarantees that x is empty.) By induction hypothesis, Be −−−−−→ {νz.N hzi M/z} | B0 for all z that do not occur in the derivation of B −−−−→ BN hM i 0. Let z be a variable that does not occur in the derivation of A = νu.B −−−−→ νu.BN hM i 0 = A0. Since the derivation of A = νu.B −−−−→ νu.BN hM i 0 = A0 includes the derivation of B −−−−→ BN hM i 0, z does not occur in the derivation of B −−−−→ BN hM i 0. Hence, we have B −−−−−→ {νz.N hzi M/z} | B0, so by Scope, A = νu.B −−−−−→ νu.({νz.N hzi M/z} | B0), since u does not occur in νz.N hzi. Moreover, νu.({M/z} | B0) ≡ {M/z} | νu.B0 = {M/z} | A0 since u does not occur in {M/z}. So by Struct, A−−−−−→ {νz.N hzi M/z} | A0.

• Case Par. The transition A = B | C −−−−−−→ Bνex.N hM i 0| C = A0is derived from B−−−−−−→νex.N hM i B0, with {x} ∩ fv (C) = ∅.e By induction hypothesis, B −−−−−→ ννz.N hzi ex.({M/z} | B0), {ex} ⊆ fv (M ) \ fv (N ), and the variables ex are solvable in {M/z} | B0, for all z that do not occur in the derivation of B −−−−→ BN hM i 0. Let z be a variable that does not occur in the derivation of A = B | C −−−−−−→ Bνx.N hM ie 0| C = A0. Since the derivation of A = B | C −−−−−−→ Bνx.N hM ie 0| C = A0 includes the derivation of B −−−−→ BN hM i 0, z does not occur in the derivation of B −−−−→ BN hM i 0. Hence, we have B −−−−−→ ννz.N hzi ex.({M/z} | B0), so by Par, B | C −−−−−→ ννz.N hzi ex.({M/z} | B0) | C, since z /∈ fv (C). Moreover, νx.({e M/z} | B0) | C ≡ νx.({e M/z} | (B0| C)) = νx.({e M/z} | A0) since {ex} ∩ fv (C) = ∅, so by Struct, A −−−−−→ ννz.N hzi ex.({M/z} | A0). Moreover, the variables ex are solvable in {M/z} | A0: assuming that the variablesx resolve to fe M in {M/z} | B0, we have

{Mf/

ex} | νex.({M/z} | A0) ≡ {Mf/

ex} | νx.({e M/z} | (B0| C))

≡ {Mf/

ex} | νx.({e M/z} | B0) | C since {ex} ∩ fv (C) = ∅

≡ {M/z} | B0| C sinceex resolve to fM in {M/z} | B0

≡ {M/z} | A0

• Case Struct. The transition A−−−−−−→ Aνex.N hM i 0 is derived from B −−−−−−→ Bνex.N hM i 0, A ≡ B and A0 ≡ B0. By induction hypothesis, B −−−−−→ ννz.N hzi x.({e M/z} | B0), {ex} ⊆ fv (M ) \ fv (N ), and the variablesx are solvable in {e M/z} | B0, for all z that do not occur in the derivation of B −−−−→ BN hM i 0. Let z be a variable that does not occur in the derivation of A −−−−−−→ Aνex.N hM i 0. Since the derivation of A−−−−−−→ Aνex.N hM i 0 includes the derivation of B −−−−→ BN hM i 0, z does not occur in the derivation of B −−−−→ BN hM i 0. Hence, we have B −−−−−→ ννz.N hzi x.({e M/z} | B0) and νex.({M/z} | B0) ≡ νex.({M/z} | A0), so by Struct, A −−−−−→ ννz.N hzi x.({e M/z} | A0). Moreover, the variablesx are solvable in {e M/z} | B0 and {M/z} | B0≡ {M/z} | A0, so by Definition 4.5, the variablesex are solvable in {M/z} | A0. Let us now prove the implication from right to left. For this proof, we use the notion of partial normal form introduced in Appendix B. We have A−−−−−→ ννz.N hzi ex.({M/z} | A0) where

the variables ex are solvable in {M/z} | A0, {x} ⊆ fv (M ) \ fv (N ), and z does not occur ine A, A0,x, N , M . By Lemma B.12, we have pnf(A)e −−−−−→νz.N hzi νx.({e M/z} | A0). By definition of −−−−−→νz.N hzi , we have pnf(A) ≡ νen.(σ | P ), P νz.N

0hzi

−−−−−→ B0, νx.({e M/z} | A0) ≡ νen.(σ | B0), z /∈ fv (σ), Σ ` N σ = N0, and the elements of en do not occur in N , for some n, σ, P ,e N0, B0. By Lemma B.10, we have P ≡ ν en0.(N0hM0i.P1| P2), B0 ≡ νen0.(P1| {M0/z} | P2), {ne0} ∩ fn(N0) = ∅, z /∈ fv (P1| P2) for someen0, P1, P2, N0, M0. Hence, we have

A ≡ νn.(σ | νe ne0.(N0hM0i.P1| P2))

νx.({e M/z} | A0) ≡ νn.(σ | νe en0.(P1| {M0/z} | P2)) We rename the names inen0 so that they do not occur in σ nor in N . Then

A ≡ νen,en0.(σ | N0hM0i.P1| P2)

νex.({M/z} | A0) ≡ νn,e en0.(σ | P1| {M0/z} | P2)

We instantiate the variables using σ, so that the variables of dom(σ) do not occur in the image of σ nor in N0, M0, P1, P2. Furthermore, let σ0 be a substitution that maps x toe distinct fresh names. By Lemma B.5,

pnf(νx.({e M/z} | A0))≡ ν en,ne0.((σ | {M0/z}) | (P1| P2))

Moreover, Σ ` pnf(νex.({M/z}|A0)) = pnf(νex.({M/z}|A0))σ0because {ex}∩fv (pnf(νx.({e M/z}|

A0))) = ∅. Therefore, by Lemma B.14, Σ ` νen,en0.((σ|{M0/z})|(P1|P2)) = νen,ne0.((σ|{M0/z})|

(P1| P2))σ0, so Σ ` M0 = M0σ0, Σ ` σ = σσ0, Σ ` P1 = P1σ0, and Σ ` P2 = P2σ0, so by replacing σ with σσ0, M0 with M0σ0, P1 with P1σ0, and P2 with P2σ0, we obtain

A ≡ νen,en0.(σ | N hM0i.P1| P2)

νex.({M/z} | A0) ≡ νn,e en0.(σ | P1| {M0/z} | P2)

and the variablesex are not free in the right-hand sides of these equivalences.

The variablesx resolve to some fe M in {M/z} | A0, so {M/z} | A0 ≡ {Mf/

ex} | νex.({M/z} | A0) ≡ {Mf/

ex} | νen,en0.(σ | P1| {M0/z} | P2) We rename the namesen,ne0 so that they do not occur in fM . Hence

{M/z} | A0 ≡ νen,ne0.(σ | {M0/z} | {Mf/

ex} | P1| P2) A0≡ νz.({M/z} | A0) ≡ νz,en,en0.(σ | {M0/z} | {Mf/

xe} | P1| P2) By Lemma 4.6, (z = M )ϕ({M/z} | A0), so (z = M )νn,e en0.(σ | {M0/z} | {Mf/

xe}). We rename the namesen,ne0 so that they do not occur in M . Therefore,

A ≡ νex, z,en,en0.(σ | {M0/z} | {Mf/

xe} | N hzi.P1| P2)

≡ νex, z,en,en0.(σ | {M0/z} | {Mf/

xe} | N hM i.P1| P2) So we derive

N hM i.P1−−−−→ PN hM i 1 by Out-Term

N hM i.P1| σ | {M0/z} | {Mf/

xe} | P2 N hM i

−−−−→ P1| σ | {M0/z} | {Mf/

ex} | P2 by Par

νz,en,ne0.(N hM i.P1| σ | {M0/z} | {Mf/

ex} | P2)−−−−→ νz,N hM i en,ne0.(P1| σ | {M0/z} | {Mf/

ex} | P2) by Scope, since z,en,ne0 do not occur in N hM i νz,en,ne0.(σ | {M0/z} | {Mf/

ex} | N hM i.P1| P2)−−−−→ AN hM i 0 by Struct νx, z,e en,ne0.(σ | {M0/z} | {Mf/

ex} | N hM i.P1| P2)−−−−−−→ Aνx.N hM ie 0

by Open-Var, since {ex} ⊆ fv (M ) \ fv (N ) and the variablesx are solvable in {e M/z} | A0

A−−−−−−→ Aνex.N hM i 0 by Struct

Proof of Lemma 4.9 Suppose that A−−−−−→ Aνx.N hxi 0in the refined semantics. By Lemma 4.8, for some variable z that does not occur in this transition, we have A−−−−−→ νx.({νz.N hzi x/z} | A0) in the simple semantics. Since x ∈ dom(A0), A0 ≡ νen.({M/x} | A00) for somen and some Me and A00 that do not contain x nor z, so

νx.({x/z} | A0) ≡ νx.({x/z} | νen.({M/x} | A00)) ≡ νen.({M/z} | A00)

Hence by Struct, A−−−−−→ ννz.N hzi n.({e M/z}|A00). By renaming z into x and x into z everywhere in the derivation of this transition, we obtain A−−−−−→ ννx.N hxi n.({e M/x} | A00), since z and x are not free in A, N , A00, M . Since we have νen.({M/x} | A00) ≡ A0, we obtain A−−−−−→ Aνx.N hxi 0 by Struct in the simple semantics.

Conversely, suppose that A −−−−−→ Aνx.N hxi 0 in the simple semantics. Since x ∈ dom(A0), A0 ≡ νen.({M/x} | A00) for somen and some M and Ae 00that do not contain x, so by Struct, A −−−−−→ ννx.N hxi en.({M/x} | A00). By renaming x into a fresh variable z everywhere in the derivation of this transition, A −−−−−→ ννz.N hzi en.({M/z} | A00), since x is not free in A, M , A00. Moreover, νen.({M/z} | A00) ≡ νx.({x/z} | νen.({M/x} | A00)) ≡ νx.({x/z} | A0), so by Struct, we obtain A−−−−−→ νx.({νz.N hzi x/z} | A0).

The variable x resolves to z in {x/z} | A0, because

{z/x} | νx.({x/z} | A0) ≡ {z/x} | νx.({x/z} | νen.({M/x} | A00))

≡ {z/x} | νen.({M/z} | A00)

≡ νen.({z/x} | {M/z} | A00)

≡ νen.({M/x} | {x/z} | A00)

≡ {x/z} | νen.({M/x} | A00)

≡ {x/z} | A0

Therefore, by Lemma 4.8, A−−−−−→ Aνx.N hxi 0 in the refined semantics.

Proof of Theorem 4.2 By Lemma 4.9, ≈L is a simple-labelled bisimulation, and thus

L⊆ ≈l. Conversely, to show that ≈lis a refined-labelled bisimulation, it suffices to prove its bisimulation property for any refined output label.

Assume A ≈l B, A −−−−−−→ Aνex.N hM i 0, A0 is closed, and fv (νex.N hM i) ⊆ dom(A). By Lemma 4.8, we have

A−−−−−→ Aνz.N hzi = νx.({e M/z} | A0)

for some fresh variable z, where {x} ⊆ fv (M ) \ fv (N ) ande x resolves to fe M in {M/z} | A0: {M/z} | A0≡ {Mf/

ex} | νx.({e M/z} | A0) ≡ {Mf/

xe} | A (18)

Let E[ ] = νz.({Mf/

ex} | ). Using the structural equivalence above and structural rearrange-ments, we obtain E[A] ≡ νz.({M/z} | A0) ≡ A0. By labelled bisimulation hypothesis on the simple output transition above, we have B → B1 −−−−−→ Bνz.N hzi 2 B with AlB for some B1, B2, B. By instantiating all variables in fv (B2) \ dom(B2) with fresh names in the derivation of this reduction, we obtain the same property and additionally B2is closed. By Theorem 4.1, labelled bisimilarity is closed by application of closing contexts. Using E[ ], we obtain A0lE[B]. Let B0 = E[B].

Let us first show that B2≡ νex.({M/z}|E[B2]). By Lemma 4.6, we have (z = M )ϕ({M/z}|

A0) and by the structural equivalence (18), (x = fe M )ϕ({M/z}|A0), so (z = M {Mf/

ex})ϕ({M/z}|

A0), so (z = M {Mf/

xe})ϕ(νex.({M/z}|A0)) since the variablesx do not occur in M {e Mf/

xe}. Hence (z = M {Mf/

xe})ϕ(A). Since Al BsB2, we have As B2, so (z = M {Mf/

ex})ϕ(B2).

Since z ∈ dom(B2), we have B2 ≡ νen.({N/z} | B3) for some en, N and B3 such that z is not free in B3. We rename en so that these names do not occur in fM nor in M . Then E[B2] ≡ νn.({e M {f N/z}/

ex} | B3), so

νex.({M/z} | E[B2]) ≡ νen.({M {M {N/z }f /xe}/z} | B3) ≡ νn.({e N/z} | B3) ≡ B2 because (N = M {M {fN/z}/

xe})ϕ(B3) since (z = M {Mf/

xe})ϕ(B2). So we have the desired structural equivalence B2≡ νx.({e M/z} | E[B2]).

Then

B1

νz.N hzi

−−−−−→ νx.({e M/z} | E[B2]) Moreover,ex resolves to fM in {M/z} | A0 and

{M/z} | A0≡ {M/z} | E[A] ≈l{M/z} | E[B] ≈s{M/z} | E[B2]

so {M/z} | A0s{M/z} | E[B2], so by Lemma 4.7,x resolves to fe M in {M/z} | E[B2]. Hence, by Lemma 4.8, B1−−−−−−→ E[Bνex.N hM i 2]. Hence

B →B1−−−−−−→ E[Bνex.N hM i 2] →E[B] = B0

so we have A0lB0 and B →∗ ν e−−−−−−→→x.N hM i B0, which concludes the proof.