Continuous Semantics for Strong Normalization Ulrich Berger Swansea - - PowerPoint PPT Presentation

continuous semantics for strong normalization
SMART_READER_LITE
LIVE PREVIEW

Continuous Semantics for Strong Normalization Ulrich Berger Swansea - - PowerPoint PPT Presentation

CiE 2005 Amsterdam Continuous Semantics for Strong Normalization Ulrich Berger Swansea 1 Contents 1. Motivation 2. Normalization by approximation 3. Applications 2 1. Motivation Computational content of classical mathematics 1958 G


slide-1
SLIDE 1

CiE 2005 Amsterdam

Continuous Semantics for Strong Normalization

Ulrich Berger Swansea

1

slide-2
SLIDE 2

Contents

  • 1. Motivation
  • 2. Normalization by approximation
  • 3. Applications

2

slide-3
SLIDE 3
  • 1. 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.

3

slide-4
SLIDE 4

The problem Given a strongly normalizing type theory and a system of rewrite rules, show that the combined system is strongly normalizing. Example T + OR := Simply typed λ-calculus + G¨

  • del primitive recursion + open recursion:

4

slide-5
SLIDE 5

(λx.M)N = M[N/x] R0 = x R(k + 1) = Fk(Rk) Φf =N Ff(λn, y, h.if y<ρfn then Φ(f y

nh) else 0)

where <ρ is wellfounded and f y

nh := λk.

          

fk if k < n y if k = n hk if k > n

5

slide-6
SLIDE 6

Open recursion Φf =N Ff(λn, y, h.if y<ρfn then Φ(f y

nh) else 0)

realizes Open induction (Raoult 88, Coquand 97) ∀f (∀g <lex f U(g) → U(f)) → ∀f U(f) (U top. open) which axiomatizes classical analysis (LICS’94) Note that {g | g <lex f} = {f y

nh | n: N, y: ρ, y <ρ fn, h: N → ρ}

6

slide-7
SLIDE 7

In order to have strong normalization we replace Φf =N Ff(λn, y, h.if y<ρfn then Φ(f y

nh) else 0)

by Φf =N Ff(λn, y, h.Ψfnyh(y<ρfn)) Ψfnyh # t =N Φ(f y

nh)

Ψfnyh # f =N (alternatively we may forbid reduction in the branches of an if-then-else expression)

7

slide-8
SLIDE 8
  • 2. Normalization by approximation

Idea: Split normalization proof in two parts.

  • 1. Prove normalization for terms without recursion.
  • 2. Prove normalization for terms with recursion through

approximation by terms without recursion in a denotational model.

8

slide-9
SLIDE 9

Terms A term system is a functor T: Const → CountSet where Const is a subcategory of the category CountSet of countable sets. Notation: Mθ := T(θ)(M) where θ: C → C′ is a Const morphism and M ∈ T(C).

9

slide-10
SLIDE 10

Example Const := category of simply typed constant systems with type respecting constant substitutions. T(C) := closed simply typed λ-terms with constructors, and constants in C.

10

slide-11
SLIDE 11

Models (valC: DC → DT(C))C∈Const

  • D Scott-domain
  • valC continuous and natural in C ∈ Const.

[M]α := valC(α)(M) (the value of M under the constant interpretation α). Naturality means that for θ: C → C′ [M]C(α ◦ θ) = [Mθ]C′α

11

slide-12
SLIDE 12

Example (ctd.) D := the coalesced sum (all ⊥s identified) of Dnat = {⊥, 0, 1, 2, . . .} Dρ→σ = Dρ → Dσ

12

slide-13
SLIDE 13

[x]αη = η(x) [c]αη = α(c) ([λx M]αη)(a) = [M]αηa

x

[MN]αη =

  

([M]αη)(a) if a := [N]αη = ⊥ ⊥

  • therwise

[0]αη = [S(M)]αη =

  

n + 1 if n := [M]αη = ⊥ ⊥

  • therwise

13

slide-14
SLIDE 14

Rewrite Structures (C, →, α) C ∈ Const →⊆ T(C)2 (operational semantics) α ∈ DC (denotational semantics) What does it mean for the operational and denotational semantics to ‘fit together’?

14

slide-15
SLIDE 15

Adequate Rewrite Structures (C, →, α) Monotonicity If M → N, then [M]α ⊑ [N]α. SN If [M]α = ⊥, then M is SN w.r.t. →.

15

slide-16
SLIDE 16

Example (ctd.) R := (C, →, α) where C any set of typed constants → generated by rewrite rules similar to T + OR α ∈ DC determined by the rewrite rules R is monotone (induction on terms). We will prove that R is also SN.

16

slide-17
SLIDE 17

Rω = (Cω, →ω, αω) approximates R = (C, →, α) if there exist θ : Cω → C θn : C → Cω (n ∈ N) such that

  • 1. θ ◦ θn = idC.
  • 2. αω ◦ θn ⊑ αω ◦ θn+1 and

n∈N αω ◦ θn = α.

  • 3. If Aθ → N and [A]αω = ⊥, then A →ω B for some

B ∈ T(Cω) with Bθ = N.

17

slide-18
SLIDE 18

Theorem If Rω is adequate and approximates R, then R is adequate. Proof Assume [M]α = ⊥. Then [M]α = [M]

  • n∈N

αω ◦ θn =

  • n∈N

[M](αω ◦ θn) =

  • n∈N

[Mθn]αω Hence [Mθn]αω = ⊥ for some n ∈ N. Since Mθnθ = M, it suffices to show the following claim: For any A ∈ T(Cω), if [A]αω = ⊥, then Aθ is strongly normalizing. The claim can be proved by induction on SN(A).

18

slide-19
SLIDE 19
  • 3. Applications

R (as defined previously) is approximated by Rω := (Cω, →ω, αω) where Cω := {cn | c ∈ C, n ∈ N} →ω generated by rewrite rules cn+1 P = Mθn where c P = M is a rewrite rule of R. αω ∈ DC defined accordingly. Since Rω is adequate (SN as easy as SN for the simply typed λ-calculus) it follows that R is adequate. Hence we have reduced the SN problem to the = ⊥ problem.

19

slide-20
SLIDE 20

Theorem T + OR is strongly normalizing. Proof It suffices to show that [M]α = ⊥ for every term. This can be done using the notion of totality: For every type ρ the total elements of Dρ are defined in the

  • bvious way by recursion on ρ.

By induction on M one shows that [M]α is total (and hence = ⊥) provided α(c) is total for all c ∈ C.

20

slide-21
SLIDE 21

The problem therefore reduces to showing that all constants are total: G¨

  • del primitive recursion: straightforward induction.

Open recursion: Use open induction and the fact that for any continuous function F: Dρ→nat → Dnat the set U := {f ∈ Dρ→nat | Ff = ⊥} is open.

21

slide-22
SLIDE 22

Recipe for proving SN In order to show that a given rewrite system based on pattern matching is SN do the following:

  • 1. Construct a strict domain-theoretic model that interprets

the constants according to the given rewrite rules.

  • 2. Prove that all constants are total.

This assumes that the underlying typed λ-calculus is SN!

22

slide-23
SLIDE 23

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

23

slide-24
SLIDE 24

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

24

slide-25
SLIDE 25

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.

25

slide-26
SLIDE 26

[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.

26

slide-27
SLIDE 27

[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.

27