• Aucun résultat trouvé

# Labeled λ-calculus

N/A
N/A
Protected

Partager "Labeled λ-calculus"

Copied!
6
0
0

Texte intégral

(1)

### Reductions and Causality (V)

jean-jacques.levy@inria.fr Tsinghua University, November 14, 2011

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

## Labeled λ-calculus

### •

Give names to every redex and try make this naming consistent with permutation equivalence.

### •

Need give names to every subterm:

where

### •

Conversion rule is:

de

bc

and

is name of redex

(2)

### •

3 redex families: red, blue, green.

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

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

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

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

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

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

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







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



p(a( x.b(cxdx))qdiejdkbicuevbkbicuc`3)

pdaeb(cbacqdiejdkbicuevbkbicuc`3

dbacqdiejdkbicuevbkbicuc`3)

pdaeb(cbacqdiej(kbicu( x.vx)`3)

dbacqdiej(kbicu( x.vx)`3))

pdaeb(cbacqdiejdkbicuevbkbicuc`3)

dbacqdiej(kbicu( x.vx)`3))

pdaeb(cbacqdiej(kbicu( x.vx)`3)

dbacqdiejdkbicuevbkbicuc`3))

pdaeb(cbacqdiejdkbicuevbkbicuc`3)

dbacq(i( f.j(kf `3))u( x.vx)))

pdaeb(cbacq(i( f.j(kf `3))u( x.vx)

dbacqdiejdkbicuevbkbicuc`3))

### •

3 families:

pdaeb(cbacq(i( f.j(kf `3))u( x.vx))

dbacq(i( f.j(kf `3))u( x.vx)))

pdaeb(cbacq(i( f.j(kf `3))u( x.vx))

dbacqdiej(kbicu( x.vx)`3))

p(a( x.b(cxdx))q(i( f.j(kf `3))u( x.vx)))

### i

p(a( x.b(cxdx))qdiej(kbicu( x.vx)`3))

pdaeb(cbacqdiej(kbicu( x.vx)`3)

dbacq(i( f.j(kf `3))u( x.vx)))

### •

Definition [created redexes]

### Let h ⇢, R i be historical redex.

We say that ρcreates

0

0

### •

Proposition [residuals of labeled redexes]

### •

Proposition [created labeled redexes]

### If S creates R , then name(S) is strictly contained in name(R ).

(3)

Proof (cont’d) Created redexes contains name of creator

creates

bc

( x.· · ·( x N)· · ·) ( y.M) · · ·( bc( y.M)N0)· · ·

creates

(( x. ( y.M)N)P ( de ( y.M0)P)

de

creates

(( x. x) ( y.M))N de bc( y.M)N

de bc

### •

Labeled parallel moves lemma+ [74]

F

G

G/F

F/G

M

N P

Q

F G

G/F F/G

H

G/H H/G

### •

Parallel moves lemma++ [The Cube Lemma]

still holds.

### •

Finite developments still holds.

### •

Labels do not break Church-Rosser, nor residuals

### •

Labels refine λ-calculus:

- any unlabeled reduction can be performed in the labeled calculus

- but two cofinal unlabeled reductions may no longer be cofinal Take

e

f

g

a

b

c

d

e

f

g

a

b

c

ddeefbecg

### 3)

I(I3) withI= x.x.

### •

Theorem [labeled permutation equivalence, 76]

Let ⇢and be coinitial reductions.

Then ⇢' i↵⇢ and are labeled cofinal.

Proof Let ⇢' . Then obvious because of labeled parallel moves lemma.

Conversely, we apply standardization thm and following lemma.

### •

Lemma [uniqueness of labeled standard reductions]

Proof ...

(4)

### Labels and permutation equiv. (6/7)

Proof [uniqueness of labeled standard Let ⇢and be 2 distinct coinitial standard reductions.

Take first step when they diverge. Call M that term.

We make structural induction on M. Say⇢ is more to the left.

If first step of⇢ contracts an internal redex, we use induction.

If first step of⇢ contracts an external redex, then:

M = (( x.P)Q)

deP{x :=bcQ}

st

st

deN 6= (( x.A)B)

### •

Corollary [lattice of labeled reductions]

Labeled reduction graphs are upwards semi lattices for any labeling.

### •

Corollary [labeled prefix ordering]

Let ⇢:M N and :M P be coinitial labeled reductions.

Then ⇢v i↵ N P.

### •

Exercice Try on ( x.x)(( y.( x.x)a)b) or ( x.xx)( x.xx)

## Redex families

σ

σ

S2R/⇢

(5)

### •

Proposition [same history → same name]

### h ⇢, R i ⇠ h , S i implies name(R ) = name(S)

In the labeled λ-calculus, for any labeling, we have:

### •

The opposite direction is clearly not true for any labeling (For instance, take all labels equal)

### •

But it is true when all labels are distinct atomic letters in the initial term.

### •

Definition [all labels distinct letters]

INIT(M) =True when all labels in M are distinct letters.

### •

Theorem [same history = same name, 76]

### h ⇢, R i ⇠ h , S i i↵ name(R ) = name(S)

When and reductions INIT(M)

and

start from M :

### •

Corollary [decidability of family relation]

The family relation is decidable (although complexity is proportional to length of standard reduction).

## Strong normalization

### •

Another labeled λ-calculus was considered to study Scott D-infinity model [Hyland-Wadsworth, 74]

### •

D-infinity projection functions on each subterm (n is any integer):

### •

Conversion rule is:

is degree of redex

n

n

n

n+1

p

[n]

[n][p]

n

[n]

where

[m][n]

[p]

(6)

### •

Proposition Hyland-Wadsworth calculus is derivable from labeled calculus by simple homomorphism on labels.

Proof Assign an integer to any atomic letter and take:

### •

Corollary When only a finite set of redex names is contracted, there is strong normalization.

Références

Documents relatifs

I n this usage, the variables of the generating functions are to be regarded as indeterminates or tags whose powers identify the coefficients, and formal

To achieve these results, we describe a succinct representation of unlabeled planar triangulations which supports the rank/select of edges in ccw (counter clockwise) order in

The kind of encoding that we propose here is useful for the ProofCert project [3, 11], where a general proof checker for focused first-order classical (and intuitionistic) logic is

Surprisingly, the known criteria for the representation of the call-by-name λ-calculus (with explicit substitutions) fail to characterize the fragment encoding the

Here a given label is associated to the same pattern, possibly with some variation, and we alter the proportion of labeled letters (5–100%), the variation in the label’s pattern

Unité de recherche INRIA Rennes : IRISA, Campus universitaire de Beaulieu - 35042 Rennes Cedex (France) Unité de recherche INRIA Rocquencourt : Domaine de Voluceau - Rocquencourt -

2. A crucial tool, in this approach, is the notion of storage operator, to be defined later. As is well known, in call-by-name λ-calculus, a function must compute its argument

Definition [Wadsworth, 72] M is totally undefined i↵.. for all C [ ], if C [M] nf , then C [N ] nf for