On B ohm Trees and L evy-Longo Trees in -calculus Xian Xu East - - PowerPoint PPT Presentation

on b ohm trees and l evy longo trees in calculus
SMART_READER_LITE
LIVE PREVIEW

On B ohm Trees and L evy-Longo Trees in -calculus Xian Xu East - - PowerPoint PPT Presentation

On B ohm Trees and L evy-Longo Trees in -calculus Xian Xu East China University of Science and Technology (from ongoing work with Davide Sangiorgi) April, 2013 1 Subject Encodings from -calculus (sequential programming) to


slide-1
SLIDE 1

On B¨

  • hm Trees and L´

evy-Longo Trees in π-calculus

Xian Xu East China University of Science and Technology (from ongoing work with Davide Sangiorgi)

April, 2013

slide-2
SLIDE 2

1

Subject Encodings from λ-calculus (sequential programming) to π-calculus (concurrent programming)

  • r variants of name-passing process models.

2013

slide-3
SLIDE 3

2

Benefit λ in π 1. expressiveness exhibition 2. λ-model in process models 3. full abstraction Known encodings: [Milner, 1990] [Sangiorgi, 1993,1994,1995] [Merro and Sangiorgi, 2004] [Cai and Fu, 2011] [Hirschkoff, Madiot, and Sangiorgi, 2012] ...

2013

slide-4
SLIDE 4

3

M = N iff [ [M] ] ≍ [ [N] ]

2013

slide-5
SLIDE 5

3-a

Aim of our work To find general conditions that ensure desired full abstraction of an encoding. M = N iff [ [M] ] ≍ [ [N] ]

2013

slide-6
SLIDE 6

3-b

Aim of our work To find general conditions that ensure desired full abstraction of an encoding. full abstraction w.r.t. L´ evy-Longo tree (LT) equality

  • r

  • hm tree (BT) equality

M = N iff [ [M] ] ≍ [ [N] ]

2013

slide-7
SLIDE 7

3-c

Aim of our work To find general conditions that ensure desired full abstraction of an encoding. full abstraction w.r.t. L´ evy-Longo tree (LT) equality

  • r

  • hm tree (BT) equality

M = N iff [ [M] ] ≍ [ [N] ]

= is L´ evy-Longo tree or B¨

  • hm tree equality;

≍ is a behavioral equivalence in the target model.

2013

slide-8
SLIDE 8

4

Motivation 1. Importance of BT and LT: (1) Operational semantics of λ-terms (2) Observational theory in λ (LT and BT equalities) (3) The local structure of some of influential models of the λ-calculus is the BT equality

(E.g. [Scott & Plotkin’s Pω 1976] [Plotkin’s T ω,1978] [Plotkin & Engeler’s DA, 1981])

2. Proof methods for full abstraction are often tedious: (1) Operational correspondence (2) Validity of β rule (3) Proof technique: B¨

  • hm-out, up-to.

(E.g. [Sangiorgi, 1995], [Boudol & Laneve, 1995])

2013

slide-9
SLIDE 9

5

Motivation 1. Importance of BT and LT: (1) Operational semantics of λ-terms (2) Observational theory in λ (LT and BT equalities) (3) The local structure of some of influential models of the λ-calculus is the BT equality

(E.g. [Scott & Plotkin’s Pω 1976] [Plotkin’s T ω,1978] [Plotkin & Engeler’s DA, 1981])

2. Proof methods for full abstraction are often tedious: (1) Operational correspondence (2) Validity of β rule (3) Proof technique: B¨

  • hm-out, up-to.

(E.g. [Sangiorgi, 1995], [Boudol & Laneve, 1995])

2013

slide-10
SLIDE 10

6

Organization of this talk

  • DEFINITIONS
  • THE CONDITIONS
  • EXAMPLES
  • EXTENSION

2013

slide-11
SLIDE 11

7

Definitions

2013

slide-12
SLIDE 12

8

M ∈ POn: M has proper order n, i.e. like λx1 . . . xn. Ω. Definition 1 (L´ evy-Longo trees). The L´ evy–Longo Tree of M, LT(M), is: (1) LT(M) = ⊤ if M ∈ POω; (2) LT(M) = λx1 . . . xn. ⊥ if M ∈ POn, 0 n < ω; (3) LT(M) = λ

  • x. y

LT(M1) · · · · · · LT(Mn) if M − →∗

h λ

  • x. yM1 . . . Mn, n 0.

LT equality: LT(M) = LT(N) , i.e. they have the same LTs.

2013

slide-13
SLIDE 13

9

  • hm trees

  • hm trees (BTs):

BT(M) = ⊥ if M ∈ POn, 0 n ω plus (3) of LT. BT equality: BT(M) = BT(N) , i.e. they have the same BTs.

2013

slide-14
SLIDE 14

10

Examples M ≡ λz. xΩ(yΞ)(λx. Ω) (Ξ = (λxz. xx)(λxz. xx)) LT(M) = λz. x ⊥ y ⊤ λx. ⊥ BT(M) = λz. x ⊥ y ⊥ ⊥

2013

slide-15
SLIDE 15

11

Definition 2 (encoding of the λ-calculus). A mapping from λ-terms to π-agents, and is compositional. i.e., [ [λx. M] ]

def

= Cx

λ[ [

[M] ] ] [ [MN] ]

def

= Capp[ [ [M] ], [ [N] ] ]

2013

slide-16
SLIDE 16

11-a

Definition 2 (encoding of the λ-calculus). A mapping from λ-terms to π-agents, and is compositional. i.e., [ [λx. M] ]

def

= Cx

λ[ [

[M] ] ] [ [MN] ]

def

= Capp[ [ [M] ], [ [N] ] ] Two kinds of contexts:

  • Abstraction context: Cx

λ def

= [ [λx. [·]] ]

  • Variable context: Cx,n

var def

= [ [x[·]1 · · · [·]n] ]

2013

slide-17
SLIDE 17

12

Conventions:

  • [

[ ] ] is an encoding of the λ-calculus into π-calculus

  • Var ⊆ N, where N is the set of π-names
  • σ stands for name substitution, i.e. mapping on π names
  • C is a set of contexts for π
  • ≤ is a precongruence and ≍ is a congruence on the agents of π-calculus

2013

slide-18
SLIDE 18

13

Definition 3. [ [ ] ] and ≍ are:

  • complete if

LT(M) = LT(N) (or BT(M) = BT(N)) implies [ [M] ] ≍ [ [N] ] .

  • sound if

[ [M] ] ≍ [ [N] ] implies LT(M) = LT(N) (or BT(M) = BT(N)). Full abstraction: soundness & completeness.

2013

slide-19
SLIDE 19

14

Auxiliary definitions (Def.4-6) Definition 4. [ [ ] ] and relation R:

  • validate rule β

if [ [(λx. M)N] ] R [ [M{N/

x}]

].

  • validate rule α if [

[λx. M] ] R [ [λy. (M{y/

x})]

]. Definition 5. C is closed under context composition if ∀C ∈ C . ∀D (unary context). D[C] ∈ C.

2013

slide-20
SLIDE 20

15

Definition 6. ≍ has unique solution of equations up to ≤ and the contexts C if ∀R, it holds that

  • If P R Q implies
  • 1. P ≍ Q, or
  • 2. ∃C ∈ C with (1 i n)

P ≥ C[P1, . . . , Pn] Q ≥ C[Q1, . . . , Qn] Pi R Qi Piσ R Qiσ for all σ, if [·]i occurs under an input in C then R ⊆≍. Intuitively, this definition comes from the proof technique of up-to context and expansion.

2013

slide-21
SLIDE 21

15-a

Definition 6. ≍ has unique solution of equations up to ≤ and the contexts C if ∀R, it holds that

  • If P R Q implies
  • 1. P ≍ Q, or
  • 2. ∃C ∈ C with (1 i n)

P ≥ C[P1, . . . , Pn] Q ≥ C[Q1, . . . , Qn] Pi R Qi Piσ R Qiσ for all σ, if [·]i occurs under an input in C then R ⊆≍.

  • Moreover, R should also be closed under substitution, if the

synchronous π-calculus is used. Intuitively, this definition comes from the proof technique of up-to context and expansion.

2013

slide-22
SLIDE 22

16

The conditions

2013

slide-23
SLIDE 23

17

The conditions for completeness

2013

slide-24
SLIDE 24

18

Theorem 7 ( completeness for LT ). [ [ ] ] and ≍ are complete for LTs, if ∃ ≤, C, the conditions below are met.

  • 1. the variable contexts of [

[ ] ] are contained in C;

  • 2. either

(a) the abstraction contexts of [ [ ] ] are contained in C;

  • 3. ≍⊇≥;
  • 4. ≍ has unique solution of equations up to ≤ and the contexts C;
  • 5. [

[ ] ], ≥ validate rules α and β;

  • 6. [

[ ] ] respects substitution, i.e. [ [Mσ] ] ≡ [ [M] ]σ;

  • 7. whenever M ∈ PO0 then [

[M] ] ≍ [ [Ω] ].

2013

slide-25
SLIDE 25

18-a

Theorem 7 ( completeness for LT ). [ [ ] ] and ≍ are complete for LTs, if ∃ ≤, C, the conditions below are met.

  • 1. the variable contexts of [

[ ] ] are contained in C;

  • 2. either

(a) the abstraction contexts of [ [ ] ] are contained in C;

  • r

(b) C is closed under composition and (c) M, N ∈ POω imlpies [ [M] ] ≍ [ [N] ];

  • 3. ≍⊇≥;
  • 4. ≍ has unique solution of equations up to ≤ and the contexts C;
  • 5. [

[ ] ], ≥ validate rules α and β;

  • 6. [

[ ] ] respects substitution, i.e. [ [Mσ] ] ≡ [ [M] ]σ;

  • 7. whenever M ∈ PO0 then [

[M] ] ≍ [ [Ω] ].

2013

slide-26
SLIDE 26

19

Theorem 8 ( completeness for BT ). [ [ ] ] and ≍ are complete for BTs, if ∃ ≤, C, the conditions below are met.

  • 1. the variable contexts of [

[ ] ] are contained in C;

  • 2. either

(a) the abstraction contexts of [ [ ] ] are contained in C and (b) [ [λx. Ω] ] ≤ [ [Ω] ];

  • 3. ≍⊇≥;
  • 4. ≍ has unique solution of equations up to ≤ and the contexts C;
  • 5. [

[ ] ], ≥ validate rules α and β;

  • 6. [

[ ] ] respects substitution, i.e. [ [Mσ] ] ≡ [ [M] ]σ;

  • 7. whenever M ∈ PO0 then [

[M] ] ≍ [ [Ω] ].

2013

slide-27
SLIDE 27

19-a

Theorem 8 ( completeness for BT ). [ [ ] ] and ≍ are complete for BTs, if ∃ ≤, C, the conditions below are met.

  • 1. the variable contexts of [

[ ] ] are contained in C;

  • 2. either

(a) the abstraction contexts of [ [ ] ] are contained in C and (b) [ [λx. Ω] ] ≤ [ [Ω] ];

  • r

(c) C is closed under composition and (d) M ∈ POω imlpies [ [M] ] ≍ [ [Ω] ];

  • 3. ≍⊇≥;
  • 4. ≍ has unique solution of equations up to ≤ and the contexts C;
  • 5. [

[ ] ], ≥ validate rules α and β;

  • 6. [

[ ] ] respects substitution, i.e. [ [Mσ] ] ≡ [ [M] ]σ;

  • 7. whenever M ∈ PO0 then [

[M] ] ≍ [ [Ω] ].

2013

slide-28
SLIDE 28

20

The conditions for soundness

2013

slide-29
SLIDE 29

21

Definition 9. C: n-hole context. C has inverse w.r.t. ≥, if ∀i = 1, . . . , n ∃Di s.t. ∀A1, . . . , An, it holds that Di[C[ A]] ≥ Ai

2013

slide-30
SLIDE 30

22

Theorem 10 ( soundness for LT ). [ [] ] and ≍ are sound for LTs, if ∃ ≤, the conditions below are satisfied.

  • 1. ≥⊆≍ (also ≤⊆≍);
  • 2. [

[] ] and ≥ validate rules α and β;

  • 3. If M ∈ PO0, then [

[M] ] ≍ [ [Ω] ] ≍ [ [M] ];

  • 4. [

[Ω] ], [ [λx. M] ], [ [xM1 · · · Mm] ], [ [xN1 · · · Nn] ], and [ [y O] ] are pairwise unequal w.r.t. ≍;

  • 5. The abstraction contexts of [

[ ] ] have inverse with respect to ≥;

  • 6. The variable contexts of [

[ ] ] have inverse with respect to ≥.

2013

slide-31
SLIDE 31

23

Theorem 11 ( soundness for BT ). [ [] ] and ≍ are sound for BTs, if ∃ ≤, the conditions below are satisfied.

  • 1. ≥⊆≍ (also ≤⊆≍);
  • 2. [

[] ] and ≥ validate rules α and β;

  • 3. If M ∈ POn (0 n ω), then [

[M] ] ≍ [ [Ω] ] ≍ [ [M] ];

  • 4. [

[Ω] ], [ [yM1 · · · Mm] ], [ [yN1 · · · Nn] ], [ [z O] ], and [ [λx. M] ], where M / ∈ POk (∀k. 0 k ω), are pairwise unequal w.r.t. ≍;

  • 5. The abstraction contexts of [

[ ] ] have inverse with respect to ≥;

  • 6. The variable contexts of [

[ ] ] have inverse with respect to ≥.

2013

slide-32
SLIDE 32

24

Examples

2013

slide-33
SLIDE 33

25

Milner’s encoding (lazy): λ Aπ

[ [λx. M] ]

def

= (p) p(x, q). [ [M] ]q [ [x] ]

def

= (p) xp [ [MN] ]

def

= (p) νr, x

  • [

[M] ]r | rx, p | !x(q). [ [N] ]q

  • , x fresh.

where (p) P is abstraction, and Fp is application.

2013

slide-34
SLIDE 34

26

≈ ≈asy ∼may ∼asy

may

∼must completeness

  • LT

soundness

  • completeness
  • BT

soundness

  • Table 1: Results for the encoding

2013

slide-35
SLIDE 35

27

An encoding of strong lazy strategy [HMS12]: λ π

[ [λx. M] ]

def

= (p) νx, q (px, q | [ [M] ]q) [ [x] ]

def

= (p) (x(p′). (p′ ⊲ p)) [ [MN] ]

def

= (p) νq, r ([ [M] ]q | q(x, p′). (p′ ⊲ p | !xr. [ [N] ]r)) x fresh

where r ⊲ q def = !r(y, h). qy, h; ⊲ has the most precedence.

2013

slide-36
SLIDE 36

28

≈c ∼c

may

∼c

must

completeness

  • LT

soundness

  • completeness
  • BT

soundness

  • Table 2: Results for the encoding

2013

slide-37
SLIDE 37

29

Extension

2013

slide-38
SLIDE 38

30

Question How can we tune the observational theory to obtain BT rather than LT?

2013

slide-39
SLIDE 39

30-a

Question How can we tune the observational theory to obtain BT rather than LT? Basic idea: assign only writable type to the access point p of the encoding, so that pairs like [ [Ω] ] and [ [λx. Ω] ] would become equal.

2013

slide-40
SLIDE 40

31

≈t ≈a

t

completeness

  • LT

soundness

  • completeness
  • BT

soundness

  • Table 3: More results for Milner’s encoding under types

2013

slide-41
SLIDE 41

32

Conclusion

What’s done:

  • general conditions for encodings of λ into π
  • case study of the conditions
  • extension using types (obtain BT without ξ rule)

Future directions:

  • other (process) models, e.g. higher-order, ambients.
  • BT with η rule (more technique needed)

2013

slide-42
SLIDE 42

Thank you