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

a first order logic with first class types
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 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

slide-2
SLIDE 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] ∀x : Object . x ❁ −Array → length((Array)x) ≥ 0 we focus only on this first-order part

Michael Walter University of Karlsruhe

slide-3
SLIDE 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] ∀x : Object . x ❁ −Array → length((Array)x) ≥ 0 we focus only on this first-order part

Michael Walter University of Karlsruhe

slide-4
SLIDE 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] ∀x : Object . x ❁ −Array → length((Array)x) ≥ 0 we focus only on this first-order part

Michael Walter University of Karlsruhe

slide-5
SLIDE 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] ∀x : Object . x ❁ −Array → length((Array)x) ≥ 0 we focus only on this first-order part

Michael Walter University of Karlsruhe

slide-6
SLIDE 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] ∀x : Object . x ❁ −Array → length((Array)x) ≥ 0 we focus only on this first-order part

Michael Walter University of Karlsruhe

slide-7
SLIDE 7

Motivation Syntax Semantics Conclusion

Java Generics

classes parametrized by type parameters ♣✉❜❧✐❝ ❝❧❛ss Array<T> { ♣✉❜❧✐❝ T last(); } ArrayT ⊑ Array? ⊑ Object what is the signature of last? { lastT : ArrayT → T }

Michael Walter University of Karlsruhe

slide-8
SLIDE 8

Motivation Syntax Semantics Conclusion

Java Generics

classes parametrized by type parameters ♣✉❜❧✐❝ ❝❧❛ss Array<T> { ♣✉❜❧✐❝ T last(); } ArrayT ⊑ Array? ⊑ Object what is the signature of last? { lastT : ArrayT → T }

Michael Walter University of Karlsruhe

slide-9
SLIDE 9

Motivation Syntax Semantics Conclusion

First-Class Types

{ lastT : ArrayT → T } how to reason about arrays without fixing the element type?

Michael Walter University of Karlsruhe

slide-10
SLIDE 10

Motivation Syntax Semantics Conclusion

First-Class Types

{ lastT : ArrayT → 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 ∀a : Array? . last(a) ❁ − T(a) with binary predicate ❁ − (❀ universal types)

Michael Walter University of Karlsruhe

slide-11
SLIDE 11

Motivation Syntax Semantics Conclusion

Outline

1

Motivation

2

Syntax

3

Semantics

4

Conclusion

Michael Walter University of Karlsruhe

slide-12
SLIDE 12

Motivation Syntax Semantics Conclusion

Type Hierarchy

Definition (Type hierarchy) set of types T subtype relation ⊑ universal type ⊤ and empty type ⊥ greatest lower bounds (⊓) type of all types T ⊤ T int Object Array? ⊥

Michael Walter University of Karlsruhe

slide-13
SLIDE 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

slide-14
SLIDE 14

Motivation Syntax Semantics Conclusion

Terms and Formulae

Definition (Term of type T) v if v : T variable symbol f (t1, . . . , tn) if f : T1 × . . . × Tn → T function symbol, ti term of type T ′

i ⊑ Ti

Definition (Formula) p(t1, . . . , tn) if . . . ¬ϕ, ϕ ∨ ψ, ϕ ∧ ψ, ϕ → ψ ∀v.ϕ, ∃v.ϕ

Michael Walter University of Karlsruhe

slide-15
SLIDE 15

Motivation Syntax Semantics Conclusion

Outline

1

Motivation

2

Syntax

3

Semantics

4

Conclusion

Michael Walter University of Karlsruhe

slide-16
SLIDE 16

Motivation Syntax Semantics Conclusion

Structure

Definition (Structure) domain D dynamic typing function δ : D → T ❀ DT := {x ∈ D : δ(x) ⊑ T} interpretation I of functions and predicates I(f ) : DT1 × . . . × DTn → DT I(p) ⊑ DT1 × . . . × DTn ❀ value of a term, validity of a formula. . .

Michael Walter University of Karlsruhe

slide-17
SLIDE 17

Motivation Syntax Semantics Conclusion

Structure

Definition (Structure) domain D dynamic typing function δ : D → T ❀ DT := {x ∈ D : δ(x) ⊑ T} interpretation I of functions and predicates I(f ) : DT1 × . . . × DTn → DT I(p) ⊑ DT1 × . . . × DTn how about the predefined symbols? ❀ value of a term, validity of a formula. . .

Michael Walter University of Karlsruhe

slide-18
SLIDE 18

Motivation Syntax Semantics Conclusion

Interpretation

DT = T predefined symbols shall agree with their type hierarchy counterpart: I(❁ −) ∋ (x, T) ⇔ x ∈ DT ⇔ δ(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

slide-19
SLIDE 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

slide-20
SLIDE 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

slide-21
SLIDE 21

Motivation Syntax Semantics Conclusion

Reasons for Noncompactness

2 non-Noetherian type hierarchies

{x❁ −G?, x❁ −GG?, . . . , ¬(x❁ −⊥)}

  • (compare induction)

⊤ G? GG? . . . ⊥ 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

slide-22
SLIDE 22

Motivation Syntax Semantics Conclusion

Reasons for Noncompactness

2 non-Noetherian type hierarchies

{x❁ −G?, x❁ −GG?, . . . , ¬(x❁ −⊥)}

  • (compare induction)

⊤ G? GG? . . . ⊥ 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

slide-23
SLIDE 23

Motivation Syntax Semantics Conclusion

Interpretation – Modified

require DT 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

slide-24
SLIDE 24

Motivation Syntax Semantics Conclusion

Outline

1

Motivation

2

Syntax

3

Semantics

4

Conclusion

Michael Walter University of Karlsruhe

slide-25
SLIDE 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

slide-26
SLIDE 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