• Aucun résultat trouvé

Reductions and Causality (III)

N/A
N/A
Protected

Academic year: 2022

Partager "Reductions and Causality (III)"

Copied!
27
0
0

Texte intégral

(1)

Reductions and Causality (III)

[email protected] Tsinghua University,

November 7, 2011

http://pauillac.inria.fr/~levy/courses/tsinghua/reductions

(2)

Plan

properties of equivalence by permutations

beyond lambda-calculus

prefix ordering

properties of prefix ordering

the lattice of reductions

canonical reductions

(3)

Equivalence by

permutations

(4)

Equivalence by permutations

Definition:

F1

F2

Gn

Fm

G2

G1

σ

σ/ρ ρ/σ

ρ

⇢/ = ;

m

and /⇢ = ;

n

Let ⇢ and be 2 coinitial reductions. Then ⇢ is equivalent to by permutations, ⇢ ' , i↵:

Notice that

⇢ ' means that ⇢ and are cofinal

(5)

Equivalence by permutations

In this case, all coinitial&cofinal reductions are equivalent

























(6)

Equivalence by permutations

In this case, all coinitial&cofinal reductions are not equivalent

mid int ext

int

ext mid ext mid

?? mid

(7)

Equivalence by permutations

New reduction graph with equivalent reductions

( x .x )(( y .( x .x )a)b )

( y .( x .x )a)b ( x .x )(( y .a)b)

( x .x )(( x .x )a)

( x .x )a ( y .a)b

a

( x .x )a

mid int ext

(8)

Proposition

Proof

⇢ ' i↵ 8 ⌧ , ⌧ /⇢ = ⌧ /

⇢ ' i↵ ⌧ ; ⇢ ' ⌧ ;

⇢ t ' t ⇢

⇢ ' implies ⇢/⌧ ' /⌧

⇢ ' implies ⇢; ⌧ ' ; ⌧

(a) (b) (c) (d) (e)

(a)

⇢ ' means /⇢ = ;

n

. Therefore ⌧ /⇢ = (⌧ /⇢)/( /⇢).

That is ⌧ /⇢ = ⌧ /(⇢ t ). Similarly ⌧ / = ⌧ /( t ⇢).

But cube lemma says ⌧ /(⇢ t ) = ⌧ /( t ⇢). Therefore

⌧ /⇢ = ⌧ / .

Conversely take ⌧ = ⇢ and ⌧ = .

Properties of perm. equivalence (1/3)

(9)

Proof

(b) (d) (e)

Obvious by definition of residual.

(c)

(⇢/⌧ )/( /⌧ ) = ⇢/(⌧ t ) = ⇢/( t ⌧ )

= (⇢/ )/(⌧ / ) = ;

m

by (a) and (b).

Properties of perm. equivalence (2/3)

Proposition

⇢ ' i↵ 8 ⌧ , ⌧ /⇢ = ⌧ /

⇢ ' i↵ ⌧ ; ⇢ ' ⌧ ;

⇢ t ' t ⇢

⇢ ' implies ⇢/⌧ ' /⌧

⇢ ' implies ⇢; ⌧ ' ; ⌧

(a) (b) (c) (d) (e)

(10)

Properties of perm. equivalence (3/3)

Proposition

' is the smallest congruence containing F ; ( G / F ) ' G ; ( F / G )

0 ' ;

F G σ G/F F/G

1

2

'

1

2

'

1

2

σ

(11)

Beyond λ-calculus

(12)

Context-free languages

permutations of derivations in contex-free languages

S ! SS S ! a

S

a S S

a S a

S

S

S

a S a

a S S

each parse tree corresponds to an equivalence class of derivations

(13)

Term rewriting

permutations of derivations are defined with critical pairs

critical pairs make conflicts

only 2nd definition of equivalence works for linear TRS [Boudol, 1982]

Process algebras

similar to TRS [Boudol-Castellani, 1988]

Weak memory models

speculative computations [Boudol-Petri, 2009]

(14)

Prefix ordering

(15)

Prefix ordering (1/4)

Definition:

F1

F2

Gn

Fm

G2

G1

σ

σ/ρ ρ/σ

ρ

Notice that

⇢ v means that ⇢ t '

Let ⇢ and be 2 coinitial reductions. Then ⇢ is prefix

of by permutations, ⇢ v , i↵ ⇢/ = ;

m

(16)

Properties of prefix ordering

Proposition

v is an ordering relation

⇢ v iff 9 ⌧ , ⇢; ⌧ '

⇢ v iff ⇢ t '

⇢ ' ⇢

0

v

0

' implies ⇢ v

⇢ v v ⇢ iff ⇢ '

⇢ v implies ⇢/⌧ v /⌧

⇢ v iff ⌧ ; ⇢ v ⌧ ;

(a) (b) (c) (d) (e) (f) (g)

'

σ

unique

(17)

Properties of prefix ordering

Proposition [lattice of reductions]

⇢ v ⇢ t v ⇢ t

⇢ v ⌧ , v ⌧ implies ⇢ t v ⌧

σ

⌧ /⇢ ⇢/

unique also named a push-out

(18)

Properties of prefix ordering

Proposition [lattice of reductions]

⇢ v ⇢ t v ⇢ t

⇢ v ⌧ , v ⌧ implies ⇢ t v ⌧

Proof First two, already proved.

Let ⇢ v ⌧ , v ⌧ . Then (⇢ t )/⌧

= (⇢/⌧ ); (( /⇢)/(⌧ /⇢))

= ;

m

; /(⇢ t ⌧ )

= ;

m

; /(⌧ t ⇢)

= ;

m

; ( /⌧ )/ ...

= ;

m

; ;

n

/ ... = ;

m

; ;

n

(19)

Standard reductions

(20)

Standard reductions (1/6)

When R is a single redex, we write freely R / F for { R } / F or F /R for F / { R } .

Proposition:

Let R be a redex to the left of F . Then R / F is a singleton.

Definition: The following reduction is standard

⇢ : M = M

0 R1

M

1 R2

M

2

· · ·

Rn

M

n

= N

i↵ for all i and j , i < j , then R

j

is not residual

along ⇢ of some R

j0

to the left of R

i

in M

i 1

.

(21)

Standard reductions (2/6)

























standard

(22)

Standard reductions (3/6)

Standardization thm[Curry 50]

Let M N . Then M

st

N .

Any reduction can be performed outside-in and left-to-right.

st

(23)

Standard reductions (4/6)

Standardization thm +

Any ⇢ has a unique standard equivalent by permutations.

Standard reductions are canonical representatives in their equivalence class by permutations.

8 ⇢, 9 !

st

, ⇢ '

st

'

unique

st

(24)

Standard reductions (5/6)

Lemma (left-to-right creation) [O’Donnell]

Let R be redex to the left of redex S in M . Let M

S

N . If T

0

is redex in N to the left of the residual R

0

of R ,

T

0

is residual of a redex T in M .

One cannot create a new redex across another left one.

R

R

R

M = · · · (( x . · · · S · · · )B ) · · · · · · (( x . · · · S

0

· · · )B ) · · · = N M = · · · (( x .A)( · · · S · · · )) · · · · · · (( x .A)( · · · S

0

· · · )) · · · = N

M = · · · (( x .A)B ) · · · S · · · · · · (( x .A)B ) · · · S

0

· · · = N

(25)

Standard reductions (6/6)

Proof of unicity of standard reduction in each equivalence class

Let ⇢ and be standard and ⇢ ' .

They start with same reduction and di↵er at some point.

Say that ⇢ is more to the left than . Then at that point redex R contracted by ⇢ has (unique) residual by .

Therefore ⇢ 6' .

Proof: application of previous lemma.

Lemma

If R to the left of R

1

and ⇢ is standard reduction

starting with contracting R

1

. Then R /⇢ 6 = ; .

(26)

Exercices

(27)

Exercices

• Show that all reductions to normal form are equivalent.

• Show that there is inf-lattice of reductions in I-calculus.

• Draw lattice of reductions of ( = x .xx ).

• What are standard reductions in derivations of context-free languages ?

• Show all standard reductions in the 2 reduction graphs of beginning of this class.

• Find an example where there is no greatest lower bound of 2 reductions. (Hint: you should use K -terms)

• Show that there is a single standard reduction to

normal form. What is that reduction ?

Références

Documents relatifs

The lambda-calculus is more directly connected to functional languages (Lisp, Scheme, SML, Ocaml, Haskell), but its type theory inspired many other languages (Java, C#, F#, Scala)..

• we replaced occurences by giving names (labels) to

• Similar to parallel moves lemma, but we considered particular inside-out reduction strategy... Parallel steps

• highly exponential in the handling of fans node (not elementary recursive) [Asperti, Mairson 2000]. • nice algorithms unsharing paths to bound variables [Wadsworth

• Need closer look at reduction steps and notice when they can be permuted.. • Show reductions equivalent by permutations in following reduction

• permutations of derivations are defined with critical pairs. • critical pairs

• Exercice 4: Complete all proofs of propositions. • Exercice 5: Show equivalent

• Similar to parallel moves lemma, but we considered particular inside-out reduction strategy... Parallel steps