continuous semantics for strong normalization
play

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


  1. CiE 2005 Amsterdam Continuous Semantics for Strong Normalization Ulrich Berger Swansea 1

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

  3. 1. Motivation Computational content of classical mathematics 1958 G¨ odel 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

  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¨ odel primitive recursion + open recursion: 4

  5. ( λx.M ) N = M [ N/x ] R 0 = x R ( k + 1) = Fk ( R k ) Φ f = N Ff ( λn, y, h. if y< ρ fn then Φ( f y n h ) else 0) where < ρ is wellfounded and  fk if k < n      f y n h := λk. y if k = n    hk if k > n   5

  6. Open recursion Φ f = N Ff ( λn, y, h. if y< ρ fn then Φ( f y n h ) 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 n h | n : N , y : ρ, y < ρ fn, h : N → ρ } 6

  7. In order to have strong normalization we replace Φ f = N Ff ( λn, y, h. if y< ρ fn then Φ( f y n h ) else 0) by Φ f = N Ff ( λn, y, h. Ψ fnyh ( y< ρ fn )) Ψ fnyh # = N Φ( f y n h ) t Ψ fnyh # = N 0 f (alternatively we may forbid reduction in the branches of an if-then-else expression) 7

  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

  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

  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

  11. Models ( val C : D C → D T ( C ) ) C∈ Const - D Scott-domain - val C continuous and natural in C ∈ Const. [ M ] α := val C ( α )( M ) (the value of M under the constant interpretation α ). Naturality means that for θ : C → C ′ [ M ] C ( α ◦ θ ) = [ Mθ ] C ′ α 11

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

  13. [ x ] α η = η ( x ) [ c ] α η = α ( c ) ([ λx M ] α η )( a ) = [ M ] α η a x  ([ M ] α η )( a ) if a := [ N ] α η � = ⊥  [ MN ] α η = ⊥ otherwise  [0] α η = 0  n + 1 if n := [ M ] α η � = ⊥  [ S ( M )] α η = ⊥ otherwise  13

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

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

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

  17. R ω = ( C ω , → ω , α ω ) approximates R = ( C , → , α ) if there exist θ : C ω → C θ n : C → C ω ( n ∈ N ) such that 1. θ ◦ θ n = id C . 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

  18. Theorem If R ω is adequate and approximates R , then R is adequate. Proof Assume [ M ] α � = ⊥ . Then � � � [ M ] α = [ M ] α ω ◦ θ n = [ M ]( α ω ◦ θ n ) = [ Mθ n ] α ω n ∈ N n ∈ N n ∈ 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

  19. 3. Applications R (as defined previously) is approximated by R ω := ( C ω , → ω , α ω ) where C ω := { c n | c ∈ C , n ∈ N } generated by rewrite rules c n +1 � → ω P = Mθ n where c� P = M is a rewrite rule of R . α ω ∈ D C 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

  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 obvious 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

  21. The problem therefore reduces to showing that all constants are total: G¨ odel primitive recursion: straightforward induction. Open recursion: Use open induction and the fact that for any continuous function F : D ρ → nat → D nat the set U := { f ∈ D ρ → nat | Ff � = ⊥} is open. 21

  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

  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

  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

  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

  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

  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

Recommend


More recommend