jan willem klop roel de vrijer

40
1 jan willem klop roel de vrijer infinitary normalization TeR, 1 y 8 junio 2007

Upload: dwight

Post on 12-Feb-2016

52 views

Category:

Documents


0 download

DESCRIPTION

infinitary normalization. TeR, 1 y 8 junio 2007. jan willem klop roel de vrijer. Finite and infinite reductions TRS: f(x,y)  f(y,x) f(a,b)  f(b, a)  f(a,b)  f(b, a)  … f(a,a)  f(a, a)  f(a,a)  f(a, a)  … TRS: c  g(c) - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: jan willem klop roel de vrijer

1

jan willem klop

roel de vrijer

infinitarynormalization

TeR, 1 y 8 junio 2007

Page 2: jan willem klop roel de vrijer

Finite and infinite reductions

TRS: f(x,y) f(y,x)

f(a,b) f(b, a) f(a,b) f(b, a) …

f(a,a) f(a, a) f(a,a) f(a, a) …

TRS: c g(c)

c g(c) g(g(c)) g(g(g(c)))) …

Page 3: jan willem klop roel de vrijer

3

Cauchy converging reduction sequence: activity may occur everywhere

Strongly converging reduction sequence, with descendant relations

Page 4: jan willem klop roel de vrijer

Transfinite reductions

TRS: c g(c)

c g(c) g(g(c)) g(g(g(c)))) … g

The last “step” is a limit transition

We have:

c g

gg

gg

Page 5: jan willem klop roel de vrijer

5

F(0) P

0 F

S

0

P

P

P

P

0

S

0 S

S

0

.....

Limit: infinite sequence of natural numbers

TRS: F(x) → P(x, F(S(x)))

Page 6: jan willem klop roel de vrijer

Finite and infinite terms

term = term tree = set of labeled positions

1 the set of positions is closed under prefixes2 each position is labeled by a function

symbol or a variable3 the arity of the function symbol at a position

equals the number of outgoing edges

Page 7: jan willem klop roel de vrijer

Streams

x : y infix notation for P(x,y)

F(0) → 0 : F(S(0)) → 0 : S(0) : F(S(S(0))) → 0 : S(0) : S(S(0)) : F(S(S(S(0)))) → ….

→ω 0 : S(0) : S(S(0)) : S(S(S(0))) : ….

Page 8: jan willem klop roel de vrijer

8

zip(zeros, ones) and alt rewrite in infinitely many steps to the same infinite normal form

Page 9: jan willem klop roel de vrijer

9

P

F F

0 0

P

F

0

PP

PP

P

0S0 S

S0

PP

PP

P

0S0 S

S0

P

PP

PP

0S0 S

S0

P

Transfinite reduction sequence of length

Page 10: jan willem klop roel de vrijer

Transfinite reductions

TRS: c g(c) c g

c : c : c : ….

g : c : c : ….

g : g : c : ….

g : g : g : …. …….

c : c : c : c : … . g : g : g : g : …

Page 11: jan willem klop roel de vrijer

Convergence and divergence

We have ρ: t t at limit ordinal if:

1. For each limit ordinal λ < β the prefix βλ is convergent

2. (dα)α < tends to infinity

3. the limit is t

ρ is divergent if 1. but not 2.

Page 12: jan willem klop roel de vrijer

12

0 ·2 ·3 2

depth of contracted redex tends to infinity at each limit ordinal

Page 13: jan willem klop roel de vrijer

13

Every countable ordinal can be the length of a transfinite reduction.

TRS: c f(a, c) a b

f

faa f

faaBut no uncountable

reductions!-- only finitely many reduction steps at depth n-- no infinite descending chains of ordinals

Page 14: jan willem klop roel de vrijer

14

For orthogonal TRSs we have the

Compression Lemma:

every transfinite reduction of length can be compressed to or less.

Page 15: jan willem klop roel de vrijer

Left-linearity is essential for compression:

TRS: f(x,x) c a g(a) b g(b)

f(a,b) f(g,g) c

So f(a,b) +1 c

Page 16: jan willem klop roel de vrijer

16

How to define SN and WN?

WN is easy: There is a possibly infinite reduction to a possibly infinite normal form.

SN: all reductions will eventually terminate in a (infinitary) normal form ?

?

Page 17: jan willem klop roel de vrijer

17

Examples of SN

a g(a)

c f(a, c) and a b

S-terms in CL

Page 18: jan willem klop roel de vrijer

18

Example of not SN

I(x) x

This TRS is SN, but:

I I I I …

Page 19: jan willem klop roel de vrijer

19

Good and bad reductions. In ordinary rewriting the finite reductions are good, they have an end point. The infinite ones are bad, they have no end point.

In infinitary rewriting the good reductions are the ones that are strongly convergent, they have an end point:

a b(a) reaches after steps the end point b.

The bad reductions (divergent) are the ones without end point. These reductions may be long, a limit ordinal long, but there they fail.

Page 20: jan willem klop roel de vrijer

20

What is a divergent (bad) reduction?

- Select step after step a redex and perform it

- Go on until a limit ordinal - At that point look back

- If strongly convergent: take the limit and go on

- If not, stop there: we found a divergent reduction

Page 21: jan willem klop roel de vrijer

21

Divergent reduction (again)

Suppose you have for each ordinal < limit ordinal (convergent) reductions that extend each other

Suppose there is no limit for these reductions

Together these reductions constitute a divergent reduction of length

Page 22: jan willem klop roel de vrijer

22

SN: there are no divergent reductions

So a divergent reduction is counterexample to SN

(such as an infinite reduction is counterexample to SN)

Important note:Given a divergent reduction we can find a term where infinitely often a root step was performed.

Page 23: jan willem klop roel de vrijer

Divergence: (dα)α < does not tend to infinity

n. <. >. d n, take N smallest such n and take s.t. >. d ≥ N, then from :

1. Infinitely many steps at depth N2. Finitely many positions at depth N3. At one of these positions infinitely many root steps (head steps)

Conclusion: a divergent reduction with infinitely many head steps

Page 24: jan willem klop roel de vrijer

24

Failure of Newman’s Lemma, infinitary version

We do not have the implication WCR & SN CR .

I.e. Newman’s Lemma, WCR & SN CR, fails for infinitary term rewriting.

C A(C)A(C) B(C)A(B(x)) B(A(x))

Note that we do not have A(x) B(x)!

Check WCR by looking at the critical pairs. We also have SN.

But CR∞ fails, as C reduces in steps to A and B

Page 25: jan willem klop roel de vrijer

25

A(C)

A(A(C))B(C)

C A(C)A(C) B(C)A(B(x)) B(A(x)).

A(B(C))

B(A(C))

Huet’s critical pair lemma

WCR

Page 26: jan willem klop roel de vrijer

26

A(x) x B(x) x C A(B(C))

C A(B(C))

A(C) B(C) A(A(B(C))) B(A(B(C))) A(A(C)) B(B(C)) A(A(A(B(C)))) B(B(A(B(C)))) A(A(A(C))) B(B(B(C))) A B

......

......

C ABC ABABC ABABABC ABABABABAB...

A B

...

(a) (b)

Failure of infinitary confluence

Page 27: jan willem klop roel de vrijer

27

Sxyz xz(yz) Kxy x

@(@(@(S, x), y), z) @(@(x, z), @(y, z)) @(@(K, x), y) x

@

@ K

K

@

@ S

K

@

@ K

K @

@ S

K @

@ K

K @

@ S

K @

@

@ S

K @

@ S

K @

@ S

K @

@ S

K @

@

@ K

K @

@ K

K @

@ K

K @

@ K

K @

collapsing contexts

Failure of infinitary confluence for Combinatory Logic

Page 28: jan willem klop roel de vrijer

Non-confluent infinite reduction diagram

Page 29: jan willem klop roel de vrijer

for OTRSs: PML

Projection of convergent reduction against parallel step

Page 30: jan willem klop roel de vrijer

Projection of a parallel step over infinite reduction

can result in infinite development:

TRS: f(x) x : f(x) a b

f(a) a : a : a : a … 1. Redex a has infinitely many residuals2. But all are parallel !!3. Development of a parallel set of redexes is always convergent

Page 31: jan willem klop roel de vrijer

31

Developments are not always convergent

I(x) x

Consider in I the set of all redexes

I I I I …

Page 32: jan willem klop roel de vrijer

for OTRSs: UN

A term t has at most 1 infinite normal form

Easy consequence:

SN => CR

Page 33: jan willem klop roel de vrijer

Proof of UN

C-stable reduction: All activity below prefix CC-stable term t: From t only C-stable reductionn-stable: Stable for full prefix of depth n

Lemma: if t has a C-stable reduction to nf, then t is C-stable

Page 34: jan willem klop roel de vrijer

Redex overlapping with prefix

Page 35: jan willem klop roel de vrijer

Proof of Lemma: t has C-stable reduction to nf => t is C-stable

1. No redex in t overlaps with C2. Projection of C-stable over C-stable is C-stable3. If t → s then - C is prefix of s - no redex of s overlaps with C

4. Repeating this: t is C-stable

Note that we used PML

Page 36: jan willem klop roel de vrijer

Proof of UN

Page 37: jan willem klop roel de vrijer

37

THEOREM. SN WN

is clear

Suppose not SN

So there is a term with an infinite reduction in which infinitely many root steps occur

Such a term does not have an (infinite) normal form,

i.e. not WN. This uses the Head Normalization Theorem generalized to infinite terms

Page 38: jan willem klop roel de vrijer

38

Head Normalization Theorem

THEOREM. In an orthogonal TRS let t t’ t” ...

be a reduction containing infinitely many head steps.

(i) Then t has no head normal form.(ii) Consequence: t has no (infinitary) normal form.

t is a head normal form (hnf) when it does not reduce to a redex; i.e. no reduction from t contains a root (head) step

Page 39: jan willem klop roel de vrijer

39

Head Normalization Theorem: proof

- Reduction to head normal form can always be finite

- Projection of

t0 t1 t2 ... with infinitely many head steps over parallel step yields infinitely many head steps again

Page 40: jan willem klop roel de vrijer

40

Projection of head step over parellel step t t+1

↓ p ↓ p+1

t’ t+1’

Either of two possibilities:1. p internal, then projection of head step again head step2. p head step, then p+1 empty step

Projecting ρ with infinitely many head steps:- If 2. occurs in ρ, then the projection is eventually ρ- If 2. never occurs, then in the projection infinitely many head steps by 1.