higher order termination from kruskal to computability
play

Higher-Order Termination From Kruskal to Computability Jean-Pierre - PowerPoint PPT Presentation

Higher-Order Termination From Kruskal to Computability Jean-Pierre Jouannaud cole Polytechnique 91400 Palaiseau, France Project LogiCal, Ple Commun de Recherche en Informatique du Plateau de Saclay, CNRS, cole Polytechnique, INRIA,


  1. Higher-Order Termination From Kruskal to Computability Jean-Pierre Jouannaud École Polytechnique 91400 Palaiseau, France Project LogiCal, Pôle Commun de Recherche en Informatique du Plateau de Saclay, CNRS, École Polytechnique, INRIA, Université Paris-Sud. Joint work with Frédéric Blanqui and Albert Rubio LPAR 2006, Pnomh Penh, november 17, 2006

  2. Outline Higher-order algebras Tait’s method Recursive path ordering General Schema Higher Order Recursive Path Ordering HORPO and Closure Outline 1 Higher-order algebras 2 Tait’s method 3 Recursive path ordering 4 General Schema 5 Higher Order Recursive Path Ordering 6 HORPO and Closure Jean-Pierre Jouannaud École Polytechnique 91400 Palaiseau, France [2mm] Project LogiCal, Pôle Commun de Recherche en Informatique plain

  3. Higher-order algebras [Jouannaud, Rubio, JACM to appear]

  4. Types, signatures and terms S : set of sort symbols of a fixed arity, denoted by s : ∗ n ⇒ ∗ S ∀ : set of sort variables Types T S := α | s ( T n S ) | ( T S → T S ) for α ∈ S ∀ and s : ∗ n ⇒ ∗ ∈ S Terms T := X | ( λ X : T S . T ) | @( T , T ) | F ( T , . . . , T ) . We will sometimes write T ( T ) for @( T , T ) .

  5. Types, signatures and terms S : set of sort symbols of a fixed arity, denoted by s : ∗ n ⇒ ∗ S ∀ : set of sort variables Types T S := α | s ( T n S ) | ( T S → T S ) for α ∈ S ∀ and s : ∗ n ⇒ ∗ ∈ S Terms T := X | ( λ X : T S . T ) | @( T , T ) | F ( T , . . . , T ) . We will sometimes write T ( T ) for @( T , T ) .

  6. Types, signatures and terms S : set of sort symbols of a fixed arity, denoted by s : ∗ n ⇒ ∗ S ∀ : set of sort variables Types T S := α | s ( T n S ) | ( T S → T S ) for α ∈ S ∀ and s : ∗ n ⇒ ∗ ∈ S Terms T := X | ( λ X : T S . T ) | @( T , T ) | F ( T , . . . , T ) . We will sometimes write T ( T ) for @( T , T ) .

  7. Types, signatures and terms S : set of sort symbols of a fixed arity, denoted by s : ∗ n ⇒ ∗ S ∀ : set of sort variables Types T S := α | s ( T n S ) | ( T S → T S ) for α ∈ S ∀ and s : ∗ n ⇒ ∗ ∈ S Terms T := X | ( λ X : T S . T ) | @( T , T ) | F ( T , . . . , T ) . We will sometimes write T ( T ) for @( T , T ) .

  8. Typing rules Functions: f : σ 1 × . . . × σ n ⇒ σ Variables: Γ ⊢ t 1 : τ 1 . . . Γ ⊢ t n : τ n x : σ ∈ Γ Γ ⊢ x : σ θ = mgu ( σ 1 = τ 1 & . . . & σ n = τ n ) Γ ⊢ f ( t 1 , . . . , t n ) : σθ Application: Abstraction: Γ ⊢ s : σ 1 → σ Γ ⊢ t : τ 1 Γ ∪ { x : σ } ⊢ t : τ θ = mgu ( σ 1 = τ 1 ) Γ ⊢ ( λ x : σ. t ) : σ → τ Γ ⊢ @( s , t ) : σθ

  9. Gödel’s System T I N , α : ∗ 0 , x : I N : I N ⇒ I N s : I N × α × ( I N → α → α ) ⇒ α rec X : I N → α → α U : α rec ( 0 , U , X ) → U rec ( s ( x ) , U , X ) → @( X , x , rec ( x , U , X )) Rules use first-order pattern matching

  10. Brouwer’s ordinals Ord , α : ∗ 0 : Ord lim : ( I N → Ord ) ⇒ Ord s : Ord → Ord rec : Ord × α × ( Ord → α → α ) × (( I N → Ord ) → ( I N → α ) ⇒ α ) → α F : I N → Ord x : Ord W : ( I N → Ord ) → ( I N → α ) → α U : α X : Ord → α → α rec ( 0 , U , X , W ) → U rec ( s ( x ) , U , X , W ) → @( X , x , rec ( x , U , X , W )) rec ( lim ( F ) , U , X , W ) → @( W , F , λ n . rec (@( F , n ) , U , X , W ))

  11. Goal Automate strong normalization proofs

  12. Tait and Girard’s computability predicate method

  13. Language Simple type discipline One rewrite schema: @( λ x . u , v ) → u { x �→ v }

  14. Tait ] , the computability predicate of type σ s.t.: [ [ σ ] (i) computable terms are strongly normalizing; (ii) reducts of computable terms are computable; (iii) a neutral term u is computable iff all its reducts are computable; (iv) u : σ → τ is computable iff so is @( u , v ) for all computable v ; (v) (optionnal) λ x . u is computable iff so is u { x �→ v } for all computable v . Except (v), no explicit mention of β -reduction.

  15. Examples of computability predicates Basic types: there are two possibilities ] iff s is strongly normalizing s : σ ∈ [ [ σ ] or ] iff ∀ t : τ s.t. s − → t then t ∈ [ s : σ ∈ [ [ σ ] [ τ ] ] or ... Functional types: ] iff @( s , u ) : τ ∈ [ ] for s : θ → τ ∈ [ [ σ → τ ] [ τ ] every u : θ ∈ [ ] . [ θ ]

  16. Main Lemma Given term s and computable substitution γ , then s γ is computable. By induction on the structure of terms. 1 s ∈ X . s γ computable by assumption. 2 s = @( u , v ) . u γ and v γ are computable by induction hypothesis, hence s γ = @( u γ, v γ ) is computable by computability property (iv). 3 s = λ x . u . By property (v), s γ = λ x . u γ is computable iff u γ { x �→ v } = u ( γ ∪ { x �→ v } ) is computable for all computable v . We conclude by induction hypothesis.

  17. Recursive path ordering

  18. Recursive path ordering: s ≻ rpo t iff s = f ( s ) with f ∈ F , and u � rpo t for some u ∈ s 1 s = f ( s ) with f ∈ F , and t = g ( t ) with 2 f > F g , and A s = f ( s ) and t = g ( t ) with f = F g , and A and 3 s ( ≻ rpo ) stat f t where s � rpo t iff s ≻ rpo t or s = t

  19. Tait and Girard’s SN proof of RPO Computability is defined as strong normalization, implying all computability properties trivially. We add a new computability property: (vi) Let f ∈ F n and s be computable terms. Then f ( s ) is computable.

  20. First: proof of property (vi) The restriction of ≻ rpo to terms smaller than or equal to the terms in s w.r.t. ≻ rpo is a well-founded ordering which we use for building an outer induction on the pairs ( f , s ) ordered by ( > F , ( ≻ rpo ) stat f ) lex . We now show that f ( s ) is computable by proving that t is computable for all t such that f ( s ) ≻ rpo t . This property is itself proved by an inner induction on | t | , and by case analysis upon the proof that f ( s ) ≻ rpo t .

  21. Proof of (vi) continued 1 subterm: ∃ u ∈ s such that u ≻ rpo t . By assumption, u is computable. Reduct t too. 2 precedence: t = g ( t ) , f > F g , and s ≻ rpo t . By inner induction, t is computable. By outer induction, g ( t ) = t is computable. 3 status: t = g ( t ) with f = F g ∈ Lex , s ( ≻ rpo ) lex t , and s ≻ rpo t . By inner induction, t is computable. By outer induction, g ( t ) = t is computable. ✷

  22. Second (Main Lemma) : every term is computable. Proof by induction on the structure of terms. If t is a variable, done. Otherwise t = f ( t ) . By induction hypothesis, t is computable. By property (vi), t is computable. Done. The well-foundedness of ≻ rpo follows by Property (i).

  23. General Schema

  24. Closure and General Schema The computability closure CC ( t = f ( t )) , with f ∈F , is the set CC ( t , ∅ ) , s.t. CC ( t , V ) , with V ∩ V ar ( t ) = ∅ , is the smallest set of typable terms containing all variables in V and terms in t , closed under: basic type subterm; application; abstraction; 1 precedence: let f > F g , and s ∈ CC ( t , V ) ; 2 then g ( s ) ∈ CC ( t , V ) ; recursive call: let f ( s ) be a term s.t. terms in 3 s belong to CC ( t , V ) and t ( − → β ∪ ✄ ) stat f s ; then g ( s ) ∈ CC ( t , V ) for every g = F f ; reduction: let u ∈ CC ( t , V ) , and u − → β ∪ ✄ v ; 4 then v ∈ CC ( t , V ) .

  25. General schema [Blanqui, Jouannaud and Okada, TCS 2001] We say that a rewrite system R satisfies the general schema if R = { f ( l ) → r | r ∈ CC ( f ( l )) } We now consider computability with respect to the rewrite relation − → β , and add the → R ∪ − computability property (vii) whose proof can be easily adapted from the previous one. We can then add a new case in Tait’s Main Lemma, for terms headed by an algebraic function symbol. Conclusion: − → R is SN. → β ∪ −

  26. Example : System T rec ( s ( x ) , U , X ) → @( X , x , rec ( x , U , X ))

  27. Higher Order Recursive Path Ordering

  28. Higher-Order Recursive Path Ordering: Ingredients A type quasi-ordering ≥ T S s.t. (i) > T S is well-founded; (ii) Arrow preservation: τ → σ = T S α iff α = τ ′ → σ ′ , τ ′ = T S τ and σ = T S σ ′ ; (iii) Arrow decreasingness: τ → σ > T S α implies σ ≥ T S α or α = τ ′ → σ ′ , τ ′ = T S τ and σ > T S σ ′ ; (iv) Arrow monotonicity: τ ≥ T S σ implies α → τ ≥ T S α → σ and τ → α ≥ T S σ → α ; A well-founded precedence ≥ F s.t. @ < F f ∈ F A status stat f ∈ { Mul , Lex } for every f ∈ F .

  29. Definition : s ≻ horpo iff σ ≥ T S τ and Case 1: s = f ( s ) with f ∈ F ∪ { @ } 1 u � horpo t for u ∈ s 2 t = g ( t ) with f > F g and s ≻ horpo t 3 t = g ( t ) with f = F g , s ≻ horpo t and s ( ≻ horpo ) stat f t 2: s = @( v , w ) v = λ x . u and u { x �→ w } ≻ horpo t 3: s = λ x : α. u and 1 u { x �→ y } ≻ horpo t , for some fresh y : α 2 t = λ y : β. v , y �∈ V ar ( v ) , α = T S β and u ≻ horpo v 3 u = @( v , x ) , x �∈ V ar ( v ) and v ≻ horpo t where s � horpo t iff s ≻ horpo t or s = α t

Recommend


More recommend