Strong normalization for -calculi with recursion Ulrich Berger - - PowerPoint PPT Presentation

strong normalization for calculi with recursion
SMART_READER_LITE
LIVE PREVIEW

Strong normalization for -calculi with recursion Ulrich Berger - - PowerPoint PPT Presentation

Dagstuhl Seminar Mathematics, Algorithms, Proofs 10-14 January, 2005 Strong normalization for -calculi with recursion Ulrich Berger Swansea 1 Motivation: Computational content of classical mathematics 1958 G odel Dialectica


slide-1
SLIDE 1

Dagstuhl Seminar Mathematics, Algorithms, Proofs 10-14 January, 2005

Strong normalization for λ-calculi with recursion

Ulrich Berger Swansea

1

slide-2
SLIDE 2

Motivation: Computational content of classical mathematics 1958 G¨

  • del

Dialectica Interpretation of PA 1962 Spector Dialectica Interpretation of PA2 1998 Berardi,Bezem, Realizability Interpretation of Coquand Classical Countable Choice These interpretations use strong computation principles with difficult termination proofs.

2

slide-3
SLIDE 3

The problem Given a strongly normalizing type theory T and a system of rewrite rules R, show that the combined system T + R is strongly normalizing. We are mainly interested in higher-order rewrite rules that go beyond structural recursion. Example T = simple types over the booleans and the natural numbers R = G¨

  • del primitive recursion + modified bar recursion:

3

slide-4
SLIDE 4

(λx.M)N → M[N/x] R0 → x RS(k) → fk(Rk) Φs → y(λk.Ψsk(k < |s|)) ΨskT → sk ΨskF → gk(λx.Φ(s∗x)) s: ρ∗ y: (nat → ρ) → nat

4

slide-5
SLIDE 5

The Solution

  • 1. Interpret T + R in a strict domain model.
  • 2. Show that any term not denoting ⊥ is SN.
  • 3. Show that all constants are total.

By 3., all terms are total, hence = ⊥, hence SN, by 2. Remarks

  • 1. and 2. are independent of the type system and will hence

be carried out in a type free fashion. Strictness and continuity are essential. Proofs are elementary. In 3., the notion of totality is given by the type theory T reflecting its proof-theoretic strength. The proof that constants are total uses the mathematical strength of R.

5

slide-6
SLIDE 6

Related work 1971 Tait WN for Barrecursion using infinite terms 1976 Vogel SN for Barrecursion 1977 Plotkin Adequacy of call-by-name w.r.t. domain semantics 1980 Gandy Syntactic strictness argument (λI-calculus) for WN → SN

6

slide-7
SLIDE 7

1985 Bezem SN for BR without using infinite terms 1995 van de Pol, SN using strict monotone functionals Schwichtenberg 1999 Blanqui, SN for CC+rewriting using Jouannaud, syntactic arguments Okada

7

slide-8
SLIDE 8

Contents of the talk

  • 1. The type-free λ-calculus with constructors and recursion
  • 2. A strict domain model for strong normalization
  • 3. Strongly normalizing and total type systems
  • 4. Applications
  • 5. References

8

slide-9
SLIDE 9
  • 1. The type-free λ-calculus with constructors and recursion

x | co(M1, . . . , Mk) | c | λxM | MN Rewrite rules R cP1 . . . Pn → R

  • Pi variable disjoint constructor patterns (built from

variables and constructors)

  • FV(cP1 . . . Pn) ⊆ FV(R)
  • left hand sides of different rules non-unifiable

9

slide-10
SLIDE 10

The rewrite system MBR of modified bar recursion Rxf0 → x RxfS(k) → fk(Rxfk) Φygs → y(λk.Ψygsk(k < |s|)) ΨygskT → sk ΨygskF → gk(λx.Φyg(s∗x))

10

slide-11
SLIDE 11
  • 2. A strict domain model for strong normalization

D = ΣcoDarity(co) + D → D

  • case(co(

a)) = co case(abst(f)) = abst

  • co−1

i (co(

a)) = ai

  • app(abst(f), b) = f(b)

11

slide-12
SLIDE 12

Strict interpretation of terms [x]αη = η(x) [c]αη = α(c) [λx M]αη = strict(abst)(λa ∈ D.[M]αηa

x)

[MN]αη = strict(app)([M]αη, [N]αη) [co(M1, . . . , Mk)]αη = strict(co)([M1]αη, . . . , [Mk]αη) strict(f)( a) :=

  

f( a) if ⊥ / ∈ a ⊥

  • therwise

12

slide-13
SLIDE 13

Interpretation of constants w.r.t. a rewrite system R If there is no rule for c, then αR(c) := ⊥. Otherwise αR(c) := abst(f) where f: Dk → D is defined by f( a) :=

          

[R]αRη if c P → R ∈ R and P −1( a) = Just(η) dummy if P −1( a) = Nothing for all c P → R ∈ R ⊥

  • therwise

P −1 is the generalization of co−1

i

to constructor patterns.

  • dummy ∈ D is arbitrary, but fixed.

[M]R := [M]αR

13

slide-14
SLIDE 14

The stratification R<ω of a rewrite system R R<ω := {cn+1 P → R[n] | c P → R ∈ R, n ∈ N}

  • cn new constants
  • M[n] := M[dn/d | d constant]

A M :⇔ A is obtained from M by replacing every

  • ccurrence of a constant c by some cn

14

slide-15
SLIDE 15

Proposition 1 If [M]R = ⊥ and all M[n] are SN w.r.t. R<ω, then M is SN w.r.t. R. Proof (1) If c0 ∈ A, then [A]R<ω = ⊥ (2) [M]R =

n[M[n]]R<ω

(3) If A →R<ω B, then [A]R<ω ⊑ [B]R<ω (4) If A M, c0 ∈ A and M →R N, then A →R<ω B with B N. The proposition follows.

15

slide-16
SLIDE 16
  • 3. Strongly normalizing and total type systems

Type systems A type system consists of a set T of types and a function that assigns to every set of constants C a set ⊢C ⊆ T C × Λ0(C) × T which is stable under type respecting constant substitutions: If ∆ ⊢C M: ρ and ∆ = ∆′ ◦ θ, then ∆′, Γ ⊢C′ Mθ: ρ (∆ ∈ T C, M ∈ Λ0(T ), ρ ∈ T , θ: C → C′, ∆′ ∈ T C′)

16

slide-17
SLIDE 17

Type sound conversion systems A conversion system R for Λ(C) is type-sound w.r.t. ∆ ∈ T C if ∆ ⊢C λ xL: ρ ⇒ ∆ ⊢C λ xR: ρ for every rule L → R ∈ R with FV(L) = ρ and ρ ∈ T . Strongly normalizing type systems The type system T , ⊢ is called strongly normalizing if for any set of constants C, any type assignment ∆ ∈ T C and any stratified type-sound conversion system R for Λ(C) all typeable closed terms are strongly normalizing w.r.t. R.

17

slide-18
SLIDE 18

Totality of a type systems w.r.t. a type interpretation A type interpretation for T is a mapping that assigns to every ρ ∈ T a subset [ [ρ] ] of D \ {⊥}. α ∈ DC is total w.r.t. [ [·] ] and ∆ ∈ T C if α(c) ∈ [ [∆(c)] ] for every c ∈ C. The type system T , ⊢ is total w.r.t. a type interpretation [ [·] ] if whenever ∆ ⊢C M: ρ, then [M] is total w.r.t. [ [·] ], ∆, ρ, i.e. [M]α ∈ [ [ρ] ] for all α that are total w.r.t. [ [·] ] and ∆.

18

slide-19
SLIDE 19

A rewrite system R is total if αR(c) is total for each constant c. Proposition 1 implies Proposition 2 Let T , ⊢ be a strongly normalizing type system which is total w.r.t. the type interpretation [ [·] ]. Let ∆ ∈ T C be a type assignment and R a type-sound and total rewrite

  • system. Then all typeable closed terms are strongly

normalizing w.r.t. R.

19

slide-20
SLIDE 20
  • 4. Application: System F + G¨
  • del primitive recursion +

modified bar recursion

20

slide-21
SLIDE 21

System F . . . Γ, x: ρ ⊢C x: ρ Γ, x: ρ ⊢C M: σ Γ ⊢C λx.M: ρ → σ Γ ⊢C M: ρ → σ Γ ⊢C N: ρ Γ ⊢C MN: σ Γ ⊢C M: ρ ∀+ Γ ⊢C M: ∀p ρ (*) Γ ⊢C M: ∀p ρ ∀− Γ ⊢C M: ρ[σ/p]

21

slide-22
SLIDE 22

. . . extended by constants and data types ∆, Γ ⊢C c: ∆(c) (c ∈ C) ∆, Γ ⊢C T: boole ∆, Γ ⊢C F: boole ∆, Γ ⊢C 0: nat ∆, Γ ⊢C M: nat ∆, Γ ⊢C S(M): nat ∆, Γ ⊢C []: ∀p list(p) ∆, Γ ⊢C M: ρ ∆, Γ ⊢C N: list(ρ) ∆, Γ ⊢C cons(M, N): list(ρ)

22

slide-23
SLIDE 23

In the following: System F := system F with constants and data types Proposition 3 System F is a strongly normalizing type system. Proof The proposition states that typeable terms are SN w.r.t. β-conversion and arbitrary type sound stratified rewrite systems. This can be proven by a straightforward extension of any of the known proofs of SN for system F.

23

slide-24
SLIDE 24

We wish to apply Proposition to prove SN for system F extended by bar recursion. Preparation: dummy = abst(λa ∈ D.dummy) ˜ P(D) := {A ⊆ D | dummy ∈ A and ⊥ ∈ A} Note that if A, B ∈ ˜ P(D), so is A → B := {abst(f) ∈ D | ∀a ∈ D (a ∈ A → f(a) ∈ B)}

24

slide-25
SLIDE 25

The interpretation [ [ρ] ]τ of a type ρ w.r.t. an assignment τ: Typevariables → ˜ P(D) [ [p] ]τ = τ(p) [ [ρ → σ] ]τ = [ [ρ] ]τ → [ [σ] ]τ [ [∀p ρ] ]τ =

  • A∈ ˜

P(D)

[ [ρ] ]τ A

p

[ [list(ρ)] ]τ = the least L ⊆ D s.t.

  • [] ∈ L;
  • if a ∈ [

[ρ] ]τ and l ∈ L, then cons(a, l) ∈ L;

  • abst(f) ∈ L for every continuous f: D → D.

25

slide-26
SLIDE 26

Proposition 4 System F is total w.r.t. [ [·] ]. Proof Easy induction on typing judgments. Proposition 5 The rewrite system MBR is total. Proof G¨

  • del primitive recursion: straightforward induction.

Φ, Ψ: The intuitive continuity argument why these functionals are well-defined easily works.

26

slide-27
SLIDE 27

Altogether we have Theorem System F + G¨

  • del primitive recursion + modified

bar recursion is strongly normalizing. Also works for other forms of bar recursion and open recursion and, hopefully, for stronger type systems.

27

slide-28
SLIDE 28

References

[1] C. Spector. Provably recursive functionals of analysis: a consistency proof of analysis by an extension of principles in current intuitionistic mathematics. In F. D. E. Dekker, editor, Recursive Function Theory: Proc. Symposia in Pure Mathematics, volume 5, pages 1–27. American Mathematical Society, Providence, Rhode Island, 1962. [2] W.W. Tait. Normal form theorem for barrecursive functions of finite type. In J.E. Fenstad, editor, Proceedings of the Second Scandinavian Logic Symposium, pages 353–367. North–Holland, Amsterdam, 1971. [3] H. Vogel. Ein starker Normalisationssatz f¨ ur die barrekursiven

  • Funktionale. Archive for Mathematical Logic, 18:81–84, 1985.

28

slide-29
SLIDE 29

[4] G. D. Plotkin. LCF considered as a programming language. Theoretical Computer Science, 5:223–255, 1977. [5] M. Bezem. Strong normalization of barrecursive terms without using infinite terms. Archive for Mathematical Logic, 25:175–181, 1985. [6] J. van de Pol and H. Schwichtenberg. Strict functionals for termination proofs. In M. Dezani-Ciancaglini and G. Plotkin, editors, Typed Lambda Calculi and Applications, volume 902 of LNCS, pages 350–364. Springer Verlag, Berlin, Heidelberg, New York, 1995.

29

slide-30
SLIDE 30

[7] S. Berardi, M. Bezem, and T. Coquand. On the computational content of the axiom of choice. Journal of Symbolic Logic, 63(2):600–622, 1998. [8] F. Blanqui, J-P. Jouannaud, and M. Okada. The calculus of algebraic constructions. In P. Narendran and M. Rusinowitch, editors, Proceedings of RTA’99, number 1631 in LNCS, pages 301–316. Springer Verlag, Berlin, Heidelberg, New York, 1999. [9] B., P. Oliva. Modified bar recursion and classical dependent

  • choice. In Logic Colloquium 2001. Springer, to appear.

[10] B. A computational interpretation of open induction. In

  • F. Titsworth, editor, Proceedings of the Ninetenth Annual IEEE

Symposium on Logic in Computer Science, pages 326–334. IEEE Computer Society, 2004.

30