CORNELL CS 611 - Lecture 26 Strong Normalization

Unformatted text preview:

CS611 Lecture 26 Strong Normalization 1 November 2006Lecturer: Dexter Kozen1 IntroductionIn Lecture 24, we proved that each term in the simply typed λ-calculus would never get stuck. Today, wewant to show that it will actually terminate. This property is known as strong normalization.Formally, we want to prove that if ` e : τ , then e ⇓. We will prove this by induction, but we will needa fairly sophisticated induction hypothesis that takes both the typing and the reduction order into account.We cannot just do induction on the subterm relation. For example, even if e1and e2terminate, we cannotconclude that e1e2does: consider e1= e2= λx. xx.2 Church vs. CurryWe will prove this theorem in the pure simply-typed λ-calculus in Curry style. This differs from Churchstyle in that the binding o cc urrence of a variable in a λ-abstraction is not annotated with its type.Let α, β, . . . denote type variables, x, y, . . . term variables, σ, τ, . . . types, and d, e, . . . terms. In theCurry-style simply typed λ-calculus, terms and types are defined bye ::= x | e d | λx. e τ ::= α | σ → τand the typing rules areΓ, x:τ ` x : τΓ ` e : σ → τ Γ ` d : σΓ ` (e d) : τΓ, x:σ ` e : τΓ ` (λx. e) : σ → τNote that in Church style, a closed term can have at most one type, but in Curry style, if it has any typeat all, then it has infinitely many. For example, ` λx. x : ((α → β) → γ) → ((α → β) → γ). In general, if` e : τ, then also ` e : τ0, where τ0is any substitution instance of τ.A term e is typable if there exists a type environment Γ and a type τ such that Γ ` e : τ. One can showby induction that if Γ ` e : τ , then FV(e) ⊆ dom Γ.3 Strong NormalizationBy the Church–Rosser theorem, normal forms are unique up to α-equivalence, so any two reduction strategiesstarting from the same term that terminate must yield the same result up to α -e quivalence. However, theremay be some strategies that terminate and some that do not.A term is strongly normalizing (SN) if all β-reduction sequences starting from that term converge to anormal form; equivalently, if there is no infinite β-reduction sequence starting from that term. Our maintheorem isTheorem 1. All typable terms are strongly normalizing.3.1 Ultra-Strong NormalizationWe say that a term e is ultra-strongly normalizing with respect to Γ and σ and write Γ `USNe : σ if(i) Γ ` e : σ(ii) for all n ≥ 0, if σ is of the form σ1→ σ2→ · · · → σn→ τ and Γ `USNei: σi, 1 ≤ i ≤ n, thene e1e2· · · enis SN.1A term e is ultra-strongly normalizing (USN) if it is ultra-strongly normalizing with respect to some Γand σ.The definition of the relation `USNmay seem circular, but it is not: Γ `USNe : σ is defined in terms ofΓ `USNei: σi, where the σiare strict subexpressions of σ, so it is well-defined by structural induction ontypes.Almost all the work we need to do is contained in the following lemma:Lemma 2. Let x1, . . . , xnbe distinct variables. If(i) Γ, xn: σn, . . . , x1: σ1` e : τ,(ii) Γ `USNdi: σi, 1 ≤ i ≤ n, and(iii) xj/∈ FV(di) for j > i,then Γ `USNe{d1/x1} · · · {dn/xn} : τ.Proof. Suppose the three premises (i)–(iii) hold. The proof is by induction on the structure of e.Case 1 Variable x.Case 1A x = xifor some i. We have τ = σiby assumption (i) and x{d1/x1} · · · {dn/xn} = dibyassumption (iii). The desired conclusion is therefore Γ `USNdi: σi, which follows from assumption (ii).Case 1B x /∈ {x1, . . . , xn}. We have Γ ` x : τ by assumption (i), and x{d1/x1} · · · {dn/xn} = x. Thedesired conclusion is therefore Γ `USNx : τ. We already have Γ ` x : τ , so we need only show that x e1· · · emis SN for all appropriately typed USN terms ei. But in any infinite β-reduction sequence starting fromx e1· · · em, every reduction must be inside one of the ei, since there are no other β-redexes; therefore someeimust contain an infinite subsequence. But this is impossible, since the eiare USN.Case 2 Application e1e2. For some type σ,Γ, xn: σn, . . . , x1: σ1` (e1e2) : τ⇒ Γ, xn: σn, . . . , x1: σ1` e1: σ → τ ∧ Γ, xn: σn, . . . , x1: σ1` e2: σ⇒ Γ `USNe1{d1/x1} · · · {dn/xn} : σ → τ ∧ Γ `USNe2{d1/x1} · · · {dn/xn} : σ (1)by the induction hypthesis. By clause (i) in the definition of USN, this impliesΓ ` e1{d1/x1} · · · {dn/xn} : σ → τ ∧ Γ ` e2{d1/x1} · · · {dn/xn} : σ⇒ Γ ` (e1e2){d1/x1} · · · {dn/xn} : τ .This establishes clause (i) in the definition of USN for e1e2. For clause (ii), we must show that if τ = τ3→· · · → τmand if Γ `USNei: τifor 3 ≤ i ≤ m, then(e1e2){d1/x1} · · · {dn/xn} e3· · · em= (e1{d1/x1} · · · {dn/xn}) (e2{d1/x1} · · · {dn/xn}) e3· · · em(2)is SN. But by (1),Γ `USNe1{d1/x1} · · · {dn/xn} : σ → τ3→ · · · → τmΓ `USNe2{d1/x1} · · · {dn/xn} : σΓ `USNei: τi, 3 ≤ i ≤ m,thus (2) is SN. This proves that Γ `USN(e1e2){d1/x1} · · · {dn/xn} : τ.2Case 3 Abstraction λx. e. We can assume without loss of generality that λx. e has been α-converted sothat x /∈ FV(di) and x 6= xifor any i, 1 ≤ i ≤ n. Instead of x, let us call this bound variable xn+1. Thenfor some σn+1, we have(i) Γ, xn: σn, . . . , x1: σ1` (λxn+1. e) : σn+1→ τ ,(ii) Γ `USNdi: σi, 1 ≤ i ≤ n, and(iii) xj/∈ FV(di) for j > i (including j = n + 1),and we wish to show Γ `USN(λxn+1. e){d1/x1} · · · {dn/xn} : σn+1→ τ .Starting from assumption (i), we haveΓ, xn: σn, . . . , x1: σ1` (λxn+1. e) : σn+1→ τ⇒ Γ, xn: σn, . . . , x1: σ1, xn+1: σn+1` e : τ⇒ Γ, xn+1: σn+1, xn: σn, . . . , x1: σ1` e : τ.If dn+1is any term such that Γ `USNdn+1: σn+1, then by the induction hypothesis we have bothΓ, xn+1: σn+1`USNe{d1/x1} · · · {dn/xn} : τ (3)Γ `USNe{d1/x1} · · · {dn+1/xn+1} : τ. (4)For clause (i) in the definition of USN, starting from (3), we haveΓ, xn+1: σn+1` e{d1/x1} · · · {dn/xn} : τ⇒ Γ ` λxn+1. (e{d1/x1} · · · {dn/xn}) : σn+1→ τ⇒ Γ ` (λxn+1. e){d1/x1} · · · {dn/xn} : σn+1→ τ since xn+1/∈ FV(di).For clause (ii), we wish to show that if in addition to the assumptions (i)–(iii) …


View Full Document

CORNELL CS 611 - Lecture 26 Strong Normalization

Download Lecture 26 Strong Normalization
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 26 Strong Normalization and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 26 Strong Normalization 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?