400 likes | 524 Views
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)
E N D
infinitary normalization TeR, 1 y 8 junio2007 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)))) …
g g g g 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
term = term tree = set of labeled positions 1 the set of positions is closed under prefixes 2 each position is labeled by a function symbol or a variable 3 the arity of the function symbol at a position equals the number of outgoing edges Finite and infinite terms
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))) : …. Streams
zip(zeros, ones) and alt rewrite in infinitely many steps to the same infinite normal form
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 : …
Convergence and divergence • We have ρ: t t at limit ordinal if: • For each limit ordinal λ < β the prefix βλis convergent • (dα)α < tends to infinity • the limit is t • ρ is divergent if 1. but not 2.
f f a a f f a a Every countable ordinal can be the length of a transfinite reduction. TRS: c f(a, c) a b But no uncountable reductions! • -- only finitely many reduction steps at depth n • - no infinite descending chains of ordinals
For orthogonal TRSs we have the Compression Lemma: every transfinite reduction of length can be compressed to or less.
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
? ? How to define SNand WN? WNis easy: There is a possibly infinite reduction to a possibly infinite normal form. SN: all reductions will eventually terminate in a (infinitary) normal form
Examples of SN a g(a) c f(a, c) and a b S-terms in CL
Example of not SN I(x) x This TRS is SN, but: I I I I …
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.
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
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
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.
Divergence: (dα)α < does not tend to infinity • n. <. >. d n, take N smallest such n and take s.t. >. d ≥ N, then from : • Infinitely many steps at depth N • Finitely many positions at depth N • At one of these positions infinitely many root steps (head steps) • Conclusion: a divergent reduction with infinitely many head steps
Failure of Newman’s Lemma, infinitary version We do not have the implication WCR & SN CR. I.e. Newman’s Lemma, WCR & SNCR, 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
A(A(C)) B(C) A(B(C)) B(A(C)) C A(C) A(C) B(C) A(B(x)) B(A(x)). A(C) Huet’s critical pair lemma WCR
for OTRSs: PML Projection of convergent reduction against parallel step
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 … • Redex a has infinitely many residuals • But all are parallel !! • Development of a parallel set of redexes • is always convergent
Developments are not always convergent I(x) x Consider inI the set of all redexes I I I I …
for OTRSs: UN A term t has at most 1 infinite normal form Easy consequence: SN => CR
Proof of UN C-stable reduction: All activity below prefix C C-stable term t: From t only C-stable reduction n-stable: Stable for full prefix of depth n Lemma: if t has a C-stable reduction to nf, then t is C-stable
Proof of Lemma: t has C-stable reduction to nf => t is C-stable No redex in t overlaps with C Projection of C-stable over C-stable is C-stable If t → s then - C is prefix of s - no redex of s overlaps with C Repeating this: t is C-stable Note that we used PML
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
Head Normalization Theorem 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 THEOREM. In an orthogonal TRS let t t’ t” ... be a reductioncontaining infinitely many head steps. (i) Then t has no head normal form. (ii) Consequence: t has no (infinitary) normal form.
Head Normalization Theorem: proof • Reduction to head normal form can always be finite • Projection of t0t1 t2 ... with infinitely many head steps • over parallel step yields infinitely many head steps again
Projection of head step over parellel step • tt+1 • ↓ p↓ p+1 • t’ t+1’ • Either of two possibilities: • p internal, then projection of head step again head step • 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.