a first order logic with first class types
play

A First-Order Logic with First-Class Types Michael Walter joint - PowerPoint PPT Presentation

Motivation Syntax Semantics Conclusion A First-Order Logic with First-Class Types Michael Walter joint work with Peter H. Schmitt and Mattias Ulbrich Institute for Theoretical Computer Science University of Karlsruhe The 18th International


  1. Motivation Syntax Semantics Conclusion A First-Order Logic with First-Class Types Michael Walter joint work with Peter H. Schmitt and Mattias Ulbrich Institute for Theoretical Computer Science University of Karlsruhe The 18th International Conference on Automated Reasoning with Analytic Tableaux and Related Methods, 2009 Michael Walter University of Karlsruhe

  2. Motivation Syntax Semantics Conclusion Java Card DL modal logic behind based on a typed first-order logic with subtyping, type predicates and casts [Gie05] − Array → length((Array) x ) ≥ 0 ∀ x : Object . x ❁ we focus only on this first-order part Michael Walter University of Karlsruhe

  3. Motivation Syntax Semantics Conclusion Java Card DL modal logic behind based on a typed first-order logic with subtyping, type predicates and casts [Gie05] − Array → length((Array) x ) ≥ 0 ∀ x : Object . x ❁ we focus only on this first-order part Michael Walter University of Karlsruhe

  4. Motivation Syntax Semantics Conclusion Java Card DL modal logic behind based on a typed first-order logic with subtyping, type predicates and casts [Gie05] − Array → length((Array) x ) ≥ 0 ∀ x : Object . x ❁ we focus only on this first-order part Michael Walter University of Karlsruhe

  5. Motivation Syntax Semantics Conclusion Java Card DL modal logic behind based on a typed first-order logic with subtyping, type predicates and casts [Gie05] − Array → length((Array) x ) ≥ 0 ∀ x : Object . x ❁ we focus only on this first-order part Michael Walter University of Karlsruhe

  6. Motivation Syntax Semantics Conclusion Java Card DL modal logic behind based on a typed first-order logic with subtyping, type predicates and casts [Gie05] − Array → length((Array) x ) ≥ 0 ∀ x : Object . x ❁ we focus only on this first-order part Michael Walter University of Karlsruhe

  7. Motivation Syntax Semantics Conclusion Java Generics classes parametrized by type parameters ♣✉❜❧✐❝ ❝❧❛ss Array<T> { ♣✉❜❧✐❝ T last(); } Array � T � ⊑ Array � ? � ⊑ Object what is the signature of last? { last T : Array � T � → T } Michael Walter University of Karlsruhe

  8. Motivation Syntax Semantics Conclusion Java Generics classes parametrized by type parameters ♣✉❜❧✐❝ ❝❧❛ss Array<T> { ♣✉❜❧✐❝ T last(); } Array � T � ⊑ Array � ? � ⊑ Object what is the signature of last? { last T : Array � T � → T } Michael Walter University of Karlsruhe

  9. Motivation Syntax Semantics Conclusion First-Class Types { last T : Array � T � → T } how to reason about arrays without fixing the element type? Michael Walter University of Karlsruhe

  10. Motivation Syntax Semantics Conclusion First-Class Types { last T : Array � T � → T } how to reason about arrays without fixing the element type? single signature last : Array � ? � → ⊤ T : Array � ? � → T with type of all types T need to assert that the return value has proper type − T ( a ) ∀ a : Array � ? � . last( a ) ❁ − with binary predicate ❁ ( ❀ universal types) Michael Walter University of Karlsruhe

  11. Motivation Syntax Semantics Conclusion Outline Motivation 1 Syntax 2 Semantics 3 Conclusion 4 Michael Walter University of Karlsruhe

  12. Motivation Syntax Semantics Conclusion Type Hierarchy Definition (Type hierarchy) ⊤ set of types T subtype relation ⊑ Object int T universal type ⊤ and empty type ⊥ Array � ? � greatest lower bounds ( ⊓ ) ⊥ type of all types T Michael Walter University of Karlsruhe

  13. Motivation Syntax Semantics Conclusion Signature Definition (Signature) predicate, function and variable symbols with types predefined symbols: . equality = : ⊤ × ⊤ type predicate − : ⊤ × T ❁ subtype predicate ⊑ : T × T type intersection ⊓ : T × T → T type constants T : → T (for each type T ∈ T ) casts Michael Walter University of Karlsruhe

  14. Motivation Syntax Semantics Conclusion Terms and Formulae Definition (Term of type T ) v if v : T variable symbol f ( t 1 , . . . , t n ) if f : T 1 × . . . × T n → T function symbol, t i term of type T ′ i ⊑ T i Definition (Formula) p ( t 1 , . . . , t n ) if . . . ¬ ϕ , ϕ ∨ ψ , ϕ ∧ ψ , ϕ → ψ ∀ v .ϕ , ∃ v .ϕ Michael Walter University of Karlsruhe

  15. Motivation Syntax Semantics Conclusion Outline Motivation 1 Syntax 2 Semantics 3 Conclusion 4 Michael Walter University of Karlsruhe

  16. Motivation Syntax Semantics Conclusion Structure Definition (Structure) domain D dynamic typing function δ : D → T ❀ D T := { x ∈ D : δ ( x ) ⊑ T } interpretation I of functions and predicates I ( f ) : D T 1 × . . . × D T n → D T I ( p ) ⊑ D T 1 × . . . × D T n ❀ value of a term, validity of a formula. . . Michael Walter University of Karlsruhe

  17. Motivation Syntax Semantics Conclusion Structure Definition (Structure) domain D dynamic typing function δ : D → T ❀ D T := { x ∈ D : δ ( x ) ⊑ T } interpretation I of functions and predicates I ( f ) : D T 1 × . . . × D T n → D T I ( p ) ⊑ D T 1 × . . . × D T n how about the predefined symbols? ❀ value of a term, validity of a formula. . . Michael Walter University of Karlsruhe

  18. Motivation Syntax Semantics Conclusion Interpretation D T = T predefined symbols shall agree with their type hierarchy counterpart: I ( ❁ − ) ∋ ( x , T ) ⇔ x ∈ D T ⇔ δ ( x ) ⊑ T I ( ⊑ ) = ⊑ , I ( T ) = T , . . . Observation If the type hierarchy is infinite then the logic has no sound and complete calculus. � Michael Walter University of Karlsruhe

  19. Motivation Syntax Semantics Conclusion Completeness and Compactness Definition ((Strong) completeness) A | = ϕ ⇒ A ⊢ ϕ Compactness Theorem Every logic which has a sound and complete calculus is compact: If some set of formulae is not satisfiable then there exists a finite subset which is already not satisfiable. Michael Walter University of Karlsruhe

  20. Motivation Syntax Semantics Conclusion Reasons for Noncompactness two obstructions to compactness 1 constant symbols generate domain of T {¬ ( c . = T ) : T ∈ T } � (for infinite T ; compare N ) Michael Walter University of Karlsruhe

  21. Motivation Syntax Semantics Conclusion Reasons for Noncompactness ⊤ G � ? � 2 non-Noetherian type hierarchies G � G � ? �� { x ❁ − G � ? � , x ❁ − G � G � ? �� , . . . , −⊥ ) } ¬ ( x ❁ � . . . (compare induction) ⊥ Theorem (Giese) The logic of [Gie05] has a sound and complete calculus if and only if the type hierarchy is Noetherian. Michael Walter University of Karlsruhe

  22. Motivation Syntax Semantics Conclusion Reasons for Noncompactness ⊤ G � ? � 2 non-Noetherian type hierarchies G � G � ? �� { x ❁ − G � ? � , x ❁ − G � G � ? �� , . . . , −⊥ ) } ¬ ( x ❁ � . . . (compare induction) ⊥ Theorem (Giese) The logic of [Gie05] has a sound and complete calculus if and only if the type hierarchy is Noetherian. Michael Walter University of Karlsruhe

  23. Motivation Syntax Semantics Conclusion Interpretation – Modified require D T to be a type hierarchy that contains ( T , ⊑ ) predefined symbols shall extend their type hierarchy counterparts sanity conditions Theorem The modified logic has a sound and complete calculus if and only if the type hierarchy is Noetherian. Michael Walter University of Karlsruhe

  24. Motivation Syntax Semantics Conclusion Outline Motivation 1 Syntax 2 Semantics 3 Conclusion 4 Michael Walter University of Karlsruhe

  25. Motivation Syntax Semantics Conclusion Conclusion characterized completeness of the logic of [Gie05] characterized completeness of first-class types first-class types are not useful on their own � ❀ universal types, dependent types Michael Walter University of Karlsruhe

  26. Motivation Syntax Semantics Conclusion Martin Giese. A Calculus for Type Predicates and Type Coercion. In Bernhard Becker, editor, Proceedings of the 14th International Conference on Automated Reasoning with Analytic Tableaux and Related Methods (TABLEAUX 2005) , Lecture Notes in Artificial Intelligence, pages 123–137. Springer, 2005. Michael Walter University of Karlsruhe

Recommend


More recommend