The Applied Pi Calculus. . . with Proofs Bruno Blanchet INRIA - - PowerPoint PPT Presentation

the applied pi calculus with proofs
SMART_READER_LITE
LIVE PREVIEW

The Applied Pi Calculus. . . with Proofs Bruno Blanchet INRIA - - PowerPoint PPT Presentation

Introduction The language Main theorem Proof Conclusion The Applied Pi Calculus. . . with Proofs Bruno Blanchet INRIA Paris-Rocquencourt joint work with Mart n Abadi and C edric Fournet April 2015 Bruno Blanchet (INRIA) Applied


slide-1
SLIDE 1

Introduction The language Main theorem Proof Conclusion

The Applied Pi Calculus. . . with Proofs

Bruno Blanchet

INRIA Paris-Rocquencourt

joint work with Mart´ ın Abadi and C´ edric Fournet April 2015

Bruno Blanchet (INRIA) Applied pi calculus April 2015 1 / 47

slide-2
SLIDE 2

Introduction The language Main theorem Proof Conclusion

The applied pi calculus

Designed by Abadi and Fournet (Mobile Values, New Names, and Secure Communication, POPL’01). Extension of the pi calculus with terms instead of names for messages. Language for modeling security protocols:

Terms represent protocol messages. Function symbols represent cryptographic primitives. The properties of these primitives are modeled by equations. The input language of ProVerif is a dialect of the applied pi calculus.

The applied pi calculus and ProVerif are widely used.

Interesting to make them converge, with a solid theoretical foundation.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 2 / 47

slide-3
SLIDE 3

Introduction The language Main theorem Proof Conclusion

Our contribution

Minor changes to the language

Closer to ProVerif

Detailed proofs of all results

Minor fixes; some side-conditions were not explicit 74 pages of proofs. . .

Revised examples

New example on indifferentiability

Bruno Blanchet (INRIA) Applied pi calculus April 2015 3 / 47

slide-4
SLIDE 4

Introduction The language Main theorem Proof Conclusion

Related work

Avik Chaudhuri (private communication, 2007)

found a counter-example to “observational equivalence equals labelled bisimilarity”, due to a missing side-condition.

Bengtson et al, LICS’09

mentioned a similar counter-example; proposed a framework for defining various extensions of the pi calculus (psi-calculi), with machine-checked proofs.

Jia Liu (http://lcs.ios.ac.cn/~jliu/papers/LiuJia0608.pdf)

made the missing side-condition explicit, and gave a proof of “observational equivalence equals labelled bisimilarity”; closer to the original applied pi calculus paper; extension to a stateful variant (POST’14, with Arapinis, Ritter, and Ryan).

Bruno Blanchet (INRIA) Applied pi calculus April 2015 4 / 47

slide-5
SLIDE 5

Introduction The language Main theorem Proof Conclusion

Syntax: processes

L, M, N, T, U, V ::= terms a, b, c, . . . , k, . . . , m, n, . . . , s name x, y, z variable f (M1, . . . , Ml) function application P, Q, R ::= processes (or plain processes) null process P | Q parallel composition !P replication νn.P name restriction (“new”) if M = N then P else Q conditional u(x).P message input uM.P message output

Bruno Blanchet (INRIA) Applied pi calculus April 2015 5 / 47

slide-6
SLIDE 6

Introduction The language Main theorem Proof Conclusion

Syntax: processes

L, M, N, T, U, V ::= terms a, b, c, . . . , k, . . . , m, n, . . . , s name x, y, z variable f (M1, . . . , Ml) function application P, Q, R ::= processes (or plain processes) null process P | Q parallel composition !P replication νn.P name restriction (“new”) if M = N then P else Q conditional N(x).P message input NM.P message output

Bruno Blanchet (INRIA) Applied pi calculus April 2015 5 / 47

slide-7
SLIDE 7

Introduction The language Main theorem Proof Conclusion

Syntax: extended processes

A, B, C ::= extended processes P plain process A | B parallel composition νn.A name restriction νx.A variable restriction {M/

x}

active substitution Active substitutions model the knowledge of the adversary. {M1/

x1, . . . ,Ml/ xl} for {M1/ x1} | . . . |{Ml/ xl}.

Substitutions are cycle-free. At most one substitution for each variable. Exactly one when the variable is restricted.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 6 / 47

slide-8
SLIDE 8

Introduction The language Main theorem Proof Conclusion

Sorts

Variables, names, and functions come with sorts: u : τ means that u has sort τ.

Examples of sorts: Integer, Key, Data, . . . There are infinite numbers of variables and names of each sort.

f : τ1 × · · · × τl → τ means that f has arguments of sorts τ1, . . . , τl and a result of sort τ.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 7 / 47

slide-9
SLIDE 9

Introduction The language Main theorem Proof Conclusion

Sorts

Special sort Channelτ for channels.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 8 / 47

slide-10
SLIDE 10

Introduction The language Main theorem Proof Conclusion

Sorts

Special sort Channel for channels. The unsorted applied pi is a particular case of the sorted applied pi, using the single sort Channel. The sort system enforces that: Functional applications are well-sorted. M and N are of the same sort in the conditional expression. N has sort Channel in the input and output expressions.

The sort system can enforce that channels are names or variables: choose types of functions so that no function returns sort Channel.

Active substitutions preserve sorts.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 8 / 47

slide-11
SLIDE 11

Introduction The language Main theorem Proof Conclusion

Semantics: equations

The signature Σ is equipped with an equational theory closed under substitutions of terms for variables and names;

intuitively, defined from equations that do not contain names;

respects the sort system; non-trivial, that is, there exist two different terms in each sort.

Example

fst((x, y)) = x snd((x, y)) = y dec(enc(x, y), y) = x check(x, sign(x, sk(y)), pk(y)) =

  • k

Equality modulo the equational theory: Σ ⊢ M = N.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 9 / 47

slide-12
SLIDE 12

Introduction The language Main theorem Proof Conclusion

Semantics: preliminary definitions

Processes are considered equal modulo renaming of bound names and variables. Needed to define P{M/

x}.

A context is a (possibly extended) process with a hole. An evaluation context is a context whose hole is not under a replication, a conditional, an input, or an output. E ::= evaluation context hole A | E parallel composition E | A parallel composition νn.E name restriction νx.E variable restriction

Bruno Blanchet (INRIA) Applied pi calculus April 2015 10 / 47

slide-13
SLIDE 13

Introduction The language Main theorem Proof Conclusion

Semantics: structural equivalence

Structural equivalence ≡ equivalence relation closed by application of evaluation contexts Par-0 A ≡ A | 0 Par-A A |(B | C) ≡ (A | B) | C Par-C A | B ≡ B | A Repl !P ≡ P | !P New-0 νn.0 ≡ New-C νu.νv.A ≡ νv.νu.A New-Par A | νu.B ≡ νu.(A | B) when u ∈ fv(A) ∪ fn(A) Alias νx.{M/

x}

≡ Subst {M/

x} | A

≡ {M/

x} | A{M/ x}

Rewrite {M/

x}

≡ {N/

x}

when Σ ⊢ M = N

Bruno Blanchet (INRIA) Applied pi calculus April 2015 11 / 47

slide-14
SLIDE 14

Introduction The language Main theorem Proof Conclusion

Semantics: internal reduction

Internal reduction → closed by structural equivalence closed by application of evaluation contexts Comm Nx.P | N(x).Q → P | Q Then if M = M then P else Q → P Else if M = N then P else Q → Q for any ground terms M and N such that Σ ⊢ M = N Using structural equivalence: NM.P | N(x).Q ≡ νx.({M/

x} | Nx.P | N(x).Q)

→ νx.({M/

x} | P | Q)

by Comm ≡ P | Q{M/

x}

Bruno Blanchet (INRIA) Applied pi calculus April 2015 12 / 47

slide-15
SLIDE 15

Introduction The language Main theorem Proof Conclusion

Preliminary definitions

dom(A): domain, set of variables that A exports. fv(A): free variables A is closed when its free variables are all defined by an active substitution, that is, dom(A) = fv(A). E[ ] closes A when E[A] is closed. A ⇓a when A →∗≡ E[aM.P] for some evaluation context E[ ] that does not bind a.

A can send a message on channel a.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 13 / 47

slide-16
SLIDE 16

Introduction The language Main theorem Proof Conclusion

Observational equivalence

Definition

An observational bisimulation is a symmetric relation R between closed extended processes with the same domain such that A R B implies:

1 if A ⇓a, then B ⇓a; 2 if A →∗ A′ and A′ is closed, then B →∗ B′ and A′ R B′ for some B′; 3 E[A] R E[B] for all closing evaluation contexts E[ ].

Observational equivalence (≈) is the largest such relation. Intuitively, A ≈ B when an adversary (evaluation context) cannot distinguish A from B. Hard to prove because of the universal quantification over all contexts.

Use a labeled bisimulation.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 14 / 47

slide-17
SLIDE 17

Introduction The language Main theorem Proof Conclusion

Equality in a frame

A frame ϕ is an extended process built up from 0 and active substitutions {M/

x} by parallel composition and restriction.

The frame of A, ϕ(A), is obtained replacing every plain process in A with 0.

Definition

Two terms M and N are equal in the frame ϕ, written (M = N)ϕ, if and

  • nly if

fv(M) ∪ fv(N) ⊆ dom(ϕ), ϕ ≡ ν n.σ, Mσ = Nσ, and { n} ∩ (fn(M) ∪ fn(N)) = ∅ for some names n and substitution σ. Independent of the representative ν n.σ.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 15 / 47

slide-18
SLIDE 18

Introduction The language Main theorem Proof Conclusion

Static equivalence

Definition

Two closed frames ϕ and ψ are statically equivalent, written ϕ ≈s ψ, when dom(ϕ) = dom(ψ) and for all terms M and N, (M = N)ϕ if and only if (M = N)ψ. Two closed extended processes are statically equivalent, written A ≈s B, when their frames are statically equivalent. Static equivalence ϕ ≈s ψ expresses that the frames cannot be distinguished by performing equality tests. A ≈s B expresses that the current knowledge of the adversary in the processes A and B does not allow it to distinguish A from B. The dynamic behavior of A and B is ignored.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 16 / 47

slide-19
SLIDE 19

Introduction The language Main theorem Proof Conclusion

Labels

The labelled semantics defines A α − → A′ where α is a label: N(M): input of M on channel N; νx.Nx: output of x on channel N. x must not occur in N. bv(N(M))

def

= ∅ and bv(νx.Nx)

def

= {x}. fv(N(M))

def

= fv(N) ∪ fv(M) and fv(νx.Nx)

def

= fv(N). The conference paper has labels au and νu.au for outputs. We simplify the semantics by having a single output label. One always needs to create a fresh variable for the output message. A refined semantics allows ν u.NM as label.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 17 / 47

slide-20
SLIDE 20

Introduction The language Main theorem Proof Conclusion

Labeled semantics

In N(x).P

N(M)

− − − → P{M/

x}

Out-Var x / ∈ fv(NM.P) NM.P

νx.Nx

− − − − − → P |{M/

x}

Scope A α − → A′ u does not occur in α νu.A α − → νu.A′ Par A α − → A′ bv(α) ∩ fv(B) = ∅ A | B

α

− → A′ | B Struct A ≡ B B

α

− → B′ B′ ≡ A′ A α − → A′

Bruno Blanchet (INRIA) Applied pi calculus April 2015 18 / 47

slide-21
SLIDE 21

Introduction The language Main theorem Proof Conclusion

Labeled bisimilarity

Definition

A labelled bisimulation is a symmetric relation R on closed extended processes such that A R B implies:

1 A ≈s B; 2 if A → A′ and A′ is closed, then B →∗ B′ and A′ R B′ for some B′; 3 if A α

− → A′, A′ is closed, and fv(α) ⊆ dom(A), then B →∗ α − →→∗ B′ and A′ R B′ for some B′. Labelled bisimilarity (≈l) is the largest such relation. Item 1 guarantees that the adversary cannot distinguish A from B using its current knowledge. Items 2 and 3 guarantee that this property is preserved by reduction.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 19 / 47

slide-22
SLIDE 22

Introduction The language Main theorem Proof Conclusion

Main theorem

Theorem

Observational equivalence is labelled bisimilarity: ≈ = ≈l.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 20 / 47

slide-23
SLIDE 23

Introduction The language Main theorem Proof Conclusion

Bengtson et al’s counter example

A = νa.({a/

x} | x(y).bM.0)

B = νa.({a/

x} | 0)

A and B are not observationally equivalent

The context xN distinguishes them.

According to the POPL’01 paper:

A and B have the same frame and no transitions, so they are labelled bisimilar.

A possible fix is to require that exported variables must not be of channel type. In our semantics,

A has a labelled transition x(N), so A and B are not labelled bisimilar.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 21 / 47

slide-24
SLIDE 24

Introduction The language Main theorem Proof Conclusion

Motivation

Structural equivalence complicates the analysis of possible reductions in a process. In a process A | B,

substitutions in A may influence the possible reductions in B, and conversely, substitutions in B may influence reductions in A.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 22 / 47

slide-25
SLIDE 25

Introduction The language Main theorem Proof Conclusion

Partial normal forms

Partial formal form of an extended process A: pnf(A) = ν n.({

  • M/
  • x} | P)

with (fv(P) ∪ fv( M)) ∩ { x} = ∅. Formally defined by induction on A.

Lemma

A ≡ pnf(A).

Bruno Blanchet (INRIA) Applied pi calculus April 2015 23 / 47

slide-26
SLIDE 26

Introduction The language Main theorem Proof Conclusion

Structural equivalence on plain processes

Structural equivalence

≡ on plain processes equivalence relation closed by application of evaluation contexts Par-0′ P | 0

≡ P Par-A′ P |(Q | R)

≡ (P | Q) | R Par-C′ P | Q

≡ Q | P Repl′ !P

≡ P | !P New-0′ νn.0

≡ New-C′ νn.νn′.P

≡ νn′.νn.P New-Par′ P | νn.Q

≡ νn.(P | Q) when n ∈ fn(P) Rewrite′ P{M/

x} ⋄

≡ P{N/

x}

when Σ ⊢ M = N

Bruno Blanchet (INRIA) Applied pi calculus April 2015 24 / 47

slide-27
SLIDE 27

Introduction The language Main theorem Proof Conclusion

Structural equivalence on partial normal forms

Structural equivalence

  • ≡ on extended processes in partial normal form

equivalence relation P

≡ P′ (fv(P) ∪ fv(P′)) ∩ dom(σ) = ∅ ν n.(σ | P)

  • ≡ ν

n.(σ | P′)

  • n′ is a reordering of

n ν n.(σ | P)

  • ≡ ν

n′.(σ | P) n′ / ∈ fn(σ) ν n.(σ | νn′.P)

  • ≡ ν

n, n′.(σ | P) dom(σ) = dom(σ′) Σ ⊢ xσ = xσ′ for all x ∈ dom(σ) (fv(xσ) ∪ fv(xσ′)) ∩ dom(σ) = ∅ for all x ∈ dom(σ) ν n.(σ | P)

  • ≡ ν

n.(σ′ | P)

Bruno Blanchet (INRIA) Applied pi calculus April 2015 25 / 47

slide-28
SLIDE 28

Introduction The language Main theorem Proof Conclusion

Links between structural equivalences

Lemma

If A ≡ B, then pnf(A)

  • ≡ pnf(B).

If P

≡ Q, then P ≡ Q. If A

  • ≡ B, then A ≡ B.

By induction on the derivations.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 26 / 47

slide-29
SLIDE 29

Introduction The language Main theorem Proof Conclusion

Internal reduction

Internal reduction →⋄ on plain processes closed by

≡ closed by application of evaluation contexts Comm′ NM.P | N(x).Q →⋄ P | Q{M/

x}

Then′ if M = M then P else Q →⋄ P Else′ if M = N then P else Q →⋄ Q for any ground terms M and N such that Σ ⊢ M = N Internal reduction →◦ on extended processes in partial normal form closed by

P →⋄ P′ ν n.(σ | P) →◦ ν n.(σ | P′)

Bruno Blanchet (INRIA) Applied pi calculus April 2015 27 / 47

slide-30
SLIDE 30

Introduction The language Main theorem Proof Conclusion

Link between internal reductions

Lemma

If A → B, then pnf(A) →◦ pnf(B). If P →⋄ Q, then P → Q. If A →◦ B, then A → B. By induction on the derivations.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 28 / 47

slide-31
SLIDE 31

Introduction The language Main theorem Proof Conclusion

Labelled reduction on plain processes

Labelled reduction P

α

− →⋄ A on plain processes In′ N(x).P

N(M)

− − − →⋄ P{M/

x}

Out-Var′ x / ∈ fv(NM.P) NM.P

νx.Nx

− − − − − →⋄ P |{M/

x}

Scope′ P

α

− →⋄ A n does not occur in α νn.P

α

− →⋄ νn.A Par′ P

α

− →⋄ A bv(α) ∩ fv(Q) = ∅ P | Q

α

− →⋄ A | Q Struct′ P

≡ Q Q

α

− →⋄ B B ≡ A P

α

− →⋄ A

Bruno Blanchet (INRIA) Applied pi calculus April 2015 29 / 47

slide-32
SLIDE 32

Introduction The language Main theorem Proof Conclusion

Labelled reduction on partial normal forms

Labelled reduction A α − →◦ B, where A is an extended process in partial normal form and B is an extended process A

  • ≡ ν

n.(σ | P) P

α′

− →⋄ B′ B ≡ ν n.(σ | B′) fv(σ) ∩ bv(α′) = ∅ Σ ⊢ ασ = α′ the elements of n do not occur in α A α − →◦ B

Bruno Blanchet (INRIA) Applied pi calculus April 2015 30 / 47

slide-33
SLIDE 33

Introduction The language Main theorem Proof Conclusion

Links between labelled reductions

Lemma (Characterization of labelled reductions)

P

α

− →⋄ A if and only if for some n, P1, P2, A1, N, M, P′, x, P

≡ ν n.(P1 | P2), A ≡ ν n.(A1 | P2), { n} ∩ fn(α) = ∅, bv(α) ∩ fv(P1 | P2) = ∅, and one of the following two cases holds:

1 α = N(M), P1 = N(x).P′, and A1 = P′{M/

x}; or

2 α = νx.Nx, P1 = NM.P′, and A1 = P′ |{M/

x}.

Lemma

If A α − → B, then pnf(A) α − →◦ B. If P

α

− →⋄ A, then P

α

− → A. If A α − →◦ B, then A α − → B.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 31 / 47

slide-34
SLIDE 34

Introduction The language Main theorem Proof Conclusion

Decomposition of labelled reductions: plain processes

Lemma

Suppose that P0 is closed, α is νx.N′x or N′(M′) for some ground term N′, and P0

α

− →⋄ A. Then one of the following cases holds:

1 P0 = P | Q and either P

α

− →⋄ A′ and A ≡ A′ | Q, or Q

α

− →⋄ A′ and A ≡ P | A′, for some P, Q, and A′;

2 P0 = νn.P, P

α

− →⋄ A′, and A ≡ νn.A′ for some P, A′, and n that does not occur in α;

3 P0 = !P, P

α

− →⋄ A′, and A ≡ A′ | !P for some P and A′;

4 P0 = N(x).P, α = N′(M′), Σ ⊢ N = N′, and A ≡ P{M′/

x} for some

N, x, P, N′, and M′;

5 P0 = NM.P, α = νx.N′x, Σ ⊢ N = N′, x /

∈ fv(P0), and A ≡ P |{M/

x} for some N, M, P, x, and N′.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 32 / 47

slide-35
SLIDE 35

Introduction The language Main theorem Proof Conclusion

Decomposition of labelled reductions: partial normal forms

Lemma

If ν n.(σ | P) is a closed extended process in partial normal form, ν n.(σ | P) α − →◦ A, fv(α) ⊆ dom(σ), and the elements of n do not occur in α, then P

ασ

− − →⋄ A′, A ≡ ν n.(σ | A′), and bv(α) ∩ dom(σ) = ∅ for some A′.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 33 / 47

slide-36
SLIDE 36

Introduction The language Main theorem Proof Conclusion

Composition of labelled reductions

Lemma

If P and Q are closed processes, N is a ground term, P

N(x)

− − − →⋄ A, and Q

νx.Nx

− − − − − →⋄ B, then P | Q →⋄ R and R ≡ νx.(A | B) for some R.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 34 / 47

slide-37
SLIDE 37

Introduction The language Main theorem Proof Conclusion

Decomposition of internal reductions: plain processes

Lemma

Suppose that P0 is a closed process and P0 →⋄ R. Then one of the following cases holds:

1 P0 = P | Q for some P and Q, and one of the following cases holds: 1

P →⋄ P′ and R ≡ P′ | Q for some closed process P′,

2

P

N(x)

− − − →⋄ A, Q

νx.Nx

− − − − − →⋄ B, and R ≡ νx.(A | B) for some A, B, x, and ground term N,

and two symmetric cases obtained by swapping P and Q;

2 P0 = νn.P, P →⋄ Q′, and R ≡ νn.Q′ for some n and some closed

processes P and Q′;

3 P0 = !P, P | P →⋄ Q′, and R ≡ Q′ | !P for some closed processes P

and Q′.

4 P0 = if M = N then P else Q and either Σ ⊢ M = N and R ≡ P, or

Σ ⊢ M = N and R ≡ Q, for some M, N, P, and Q.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 35 / 47

slide-38
SLIDE 38

Introduction The language Main theorem Proof Conclusion

Decomposition of internal reductions: partial normal forms

Lemma

If ν n.(σ | P) is a closed extended process in partial normal form and ν n.(σ | P) →◦ A, then P →⋄ P′ and A ≡ ν n.(σ | P′) for some closed process P′.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 36 / 47

slide-39
SLIDE 39

Introduction The language Main theorem Proof Conclusion

Proof technique

Induction on the derivations. Strenghten the inductive invariant, to be able to apply the current lemma to a derivation built as a result of applying the inductive hypothesis.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 37 / 47

slide-40
SLIDE 40

Introduction The language Main theorem Proof Conclusion

Static equivalence

Lemma

Static equivalence is invariant by structural equivalence and reduction, and closed by application of closing evaluation contexts. For the second point, show that we can restrict ourselves to contexts E = ν u.( | C) such that all subcontexts of E are closing. proceed by structural induction on E.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 38 / 47

slide-41
SLIDE 41

Introduction The language Main theorem Proof Conclusion

Context closure

Lemma

≈l is closed by application of closing evaluation contexts. Restrict attention to contexts of the form ν u.( | C). To every relation R on closed extended processes, we associate R′= {(ν u.(A | C), ν u.(B | C)) | A R B, ν u.( | C) closing for A and B}. We prove that, if R is a labelled bisimulation, then R′ is a labelled bisimulation up to ≡, hence R ⊆ R′ ⊆ ≈l. For R = ≈l, this property entails that ≈l is closed by application of evaluation contexts ν u.( | C).

Bruno Blanchet (INRIA) Applied pi calculus April 2015 39 / 47

slide-42
SLIDE 42

Introduction The language Main theorem Proof Conclusion

Context closure

To every relation R on closed extended processes, we associate R′= {(ν u.(A | C), ν u.(B | C)) | A R B, ν u.( | C) closing for A and B}. We prove that, if R is a labelled bisimulation, then R′ is a labelled bisimulation up to ≡.

Definition

A relation R on closed extended processes is a labelled bisimulation up to ≡ if and only if R is symmetric and A R B implies:

1

A ≈s B;

2

if A → A′ and A′ is closed, then B →∗ B′ and A′ ≡R≡ B′ for some closed B′;

3

if A

α

− → A′, A′ is closed, and fv(α) ⊆ dom(A), then B →∗ α − →→∗ B′ and A′ ≡R≡ B′ for some closed B′.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 39 / 47

slide-43
SLIDE 43

Introduction The language Main theorem Proof Conclusion

Context closure

To every relation R on closed extended processes, we associate R′= {(ν u.(A | C), ν u.(B | C)) | A R B, ν u.( | C) closing for A and B}. We prove that, if R is a labelled bisimulation, then R′ is a labelled bisimulation up to ≡. Assume S R′ T, with S = ν u.(A | C), T = ν u.(B | C), and A R B.

S ≈s T follows from A ≈s B by a previous lemma. For reductions, consider the partial normal forms of A, B, C: pnf(A) = ν n.(σ | P), pnf(B) = ν n′.(σ′ | P′), pnf(C) = ν n′′.(σ′′ | P′′). A reduction on S = ν u.(A | C) implies a reduction on P | P′′σ, so a reduction on P and/or P′′σ (by the decomposition lemmas). A reduction on P implies a reduction A, so the same reduction on B since R is a labelled bisimulation, so a reduction on P′. A reduction on P′′σ implies a reduction on P′′σ′ by static equivalence A ≈s B. Hence we obtain a reduction on P′ | P′′σ′, hence on T = ν u.(B | C).

Bruno Blanchet (INRIA) Applied pi calculus April 2015 39 / 47

slide-44
SLIDE 44

Introduction The language Main theorem Proof Conclusion

Characterizing barbs

Lemma

Let A be a closed extended process. A ⇓a if and only if A →∗ νx.ax − − − − → A′ for some fresh variable x and some A′. A ≡ E[aM.P] for some evaluation context E[ ] that does not bind a if and only if A

νx.ax

− − − − → A′ for some fresh variable x and some A′.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 40 / 47

slide-45
SLIDE 45

Introduction The language Main theorem Proof Conclusion

Labelled bisimilarity implies observational equivalence

Lemma

≈l ⊆ ≈. ≈l satisfies the three properties of observational bisimulations:

1 ≈l preserves barbs, by characterization of barbs and Properties 2

and 3 of a labelled bisimilation.

2 Suppose that A ≈l B, A →∗ A′, and A′ is closed. Close all

intermediate processes in A →∗ A′, then conclude that B →∗ B′ and A′ ≈l B′ for some B′ by Property 2 of a labelled bisimilation.

3 ≈l is closed by application of closing evaluation contexts, as shown

previously. Moreover, ≈l is symmetric. Since ≈ is the largest observational bisimulation, we obtain ≈l ⊆ ≈.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 41 / 47

slide-46
SLIDE 46

Introduction The language Main theorem Proof Conclusion

Observational equivalence implies static equivalence

Lemma

≈ ⊆ ≈s. If A and B are observationally equivalent, then A | C and B | C have the same barb ⇓a for every C = if M = N then as, where a does not occur in A or B and fv(M) ∪ fv(N) ⊆ dom(A). Assuming that A is closed, fv(M) ∪ fv(N) ⊆ dom(A), and a does not

  • ccur in A, we have

(M = N)ϕ(A) if and only if A | if M = N then as ⇓a. (Shown using partial normal forms.)

Bruno Blanchet (INRIA) Applied pi calculus April 2015 42 / 47

slide-47
SLIDE 47

Introduction The language Main theorem Proof Conclusion

Characterizing inputs

Let T p

N(M)

def

= pp | NM.p(x).

Lemma

Let A be a closed extended process. Let N and M be terms such that fv(NM) ⊆ dom(A) and p does not occur in A, M, and N. If A

N(M)

− − − → A′ and p does not occur in A′, then A | T p

N(M) →→ A′ and A′ ⇓p.

If A | T p

N(M) →∗ A′ and A′ ⇓p, then A →∗ N(M)

− − − →→∗ A′. Shown using partial normal forms.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 43 / 47

slide-48
SLIDE 48

Introduction The language Main theorem Proof Conclusion

Characterizing outputs

Let T p,q

νx.Nx

def

= pp | N(x).p(y).qx.

Lemma

Let A be a closed extended process and N such that fv(N) ⊆ dom(A). If A

νx.Nx

− − − − − → A′ and p and q do not occur in A, A′, and N, then A | T p,q

νx.Nx →→ νx.(A′ | qx), νx.(A′ | qx) ⇓p, and

x / ∈ dom(A). If A | T p,q

νx.Nx →∗ A′′, A′′ ⇓p, x /

∈ dom(A), and p and q do not occur in A and N, then A →∗ νx.Nx − − − − − →→∗ A′ and A′′ ≡ νx.(A′ | qx) for some A′. Shown using partial normal forms.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 44 / 47

slide-49
SLIDE 49

Introduction The language Main theorem Proof Conclusion

Extrusion

Lemma (Extrusion)

Let A and B two closed extended processes with a same domain that contains

  • x. Let E

x[ ]

def

= ν x.(

x∈ x nxx | ) using names nx that do not

  • ccur in A or B. If E

x[A] ≈ E x[B], then A ≈ B.

If A is a closed extended process with { x} ⊆ dom(A) and E

x[A] → C ′,

then A → A′ and C ′ ≡ E

x[A′] for some closed extended process A′.

(Proved using partial normal forms.) Let A R B if and only if { x} ⊆ dom(A) = dom(B) and E

x[A] ≈ E x[B], for

some x and some names nx that do not occur in A or B. We show that R is an observational bisimulation.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 45 / 47

slide-50
SLIDE 50

Introduction The language Main theorem Proof Conclusion

Observational equivalence implies labelled bisimilarity

Lemma

≈ ⊆ ≈l. The relation ≈ is symmetric. It satisfies the three properties of labelled bisimulations:

1 If A ≈ B, then A ≈s B, shown previously. 2 If A ≈ B, A → A′, and A′ is closed, then B →∗ B′ and A′ ≈ B′ for

some B′, by Property 2 of the definition of observational bisimulation.

3 If A ≈ B, A α

− → A′, A′ is closed, and fv(α) ⊆ dom(A), then B →∗ α − →→∗ B′ and A′ ≈ B′ for some B′. To prove this property, we rely on characteristic parallel contexts Tα, shown in previous lemmas. In the output case, we obtain a pair νx.(A′ | qx) ≈ νx.(B′ | qx), and conclude by the extrusion lemma. Hence ≈ is a labelled bisimulation, and ≈ ⊆ ≈l, since ≈l is the largest labelled bisimulation.

Bruno Blanchet (INRIA) Applied pi calculus April 2015 46 / 47

slide-51
SLIDE 51

Introduction The language Main theorem Proof Conclusion

Conclusion

Importance of detailed proofs.

Could be interesting to formalize in a theorem prover, e.g. Coq.

Partial normal forms are likely to be useful for proving many other results about the applied pi calculus. With the minor changes we made, one should be able to show that

The plain processes of the applied pi calculus are a subset of the ProVerif input language. The semantics and the notions of observational equivalence match.

Does anybody want to read the draft?

Bruno Blanchet (INRIA) Applied pi calculus April 2015 47 / 47