A First-Order Logic with First-Class Types

Similar documents
A Short Introduction to First-Order Theorem Proving with KeY

15-819M: Data, Code, Decisions

Dynamic Logic with Non-rigid Functions

EXTENSIONS OF FIRST ORDER LOGIC

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Fundamentals of Software Engineering

Gradual Typing with Union and Intersection Types

Typed First-order Logic

Negations in Refinement Type Systems

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Dynamic Logic David Harel, The Weizmann Institute Dexter Kozen, Cornell University Jerzy Tiuryn, University of Warsaw The MIT Press, Cambridge, Massac

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Subtyping. Lecture 13 CS 565 3/27/06

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology

Static program checking and verification

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

The KeY System 1.0 (Deduction Component)

Chapter 2 (First-Order Logic) of. Verification of Object-Oriented Software

Handling Integer Arithmetic in the Verification of Java Programs

Lecture 6. Abstract Interpretation

Runtime Checking for Program Verification Systems

Semantic Analysis. How to Ensure Type-Safety. What Are Types? Static vs. Dynamic Typing. Type Checking. Last time: CS412/CS413

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

Safe Stratified Datalog With Integer Order Does not Have Syntax

Software Verification for Java 5

Discrete Mathematics Lecture 4. Harper Langston New York University

Lecture - 8A: Subbasis of Topology

Lecture Notes on Real-world SMT

Decision Procedures for Recursive Data Structures with Integer Constraints

Formal Systems II: Applications

From OCL to Propositional and First-order Logic: Part I

Second-Order Type Systems

Knowledge Representation

Incremental Reasoning for Multiple Inheritance

Chapter 3: Propositional Languages

Dependent Object Types - A foundation for Scala s type system

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

Greedy regular expression matching

Logic as a framework for NL semantics. Outline. Syntax of FOL [1] Semantic Theory Type Theory

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018

TLA+ TLC. Rui Fan Stanislav Funiac Mandana Vaziri. Presented by Spring 2001

Formal Methods in Software Engineering. Lecture 07

Lecture 2 : Counting X-trees

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Pierce Ch. 3, 8, 11, 15. Type Systems

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

From OCL to Typed First-order Logic

Automata Theory for Reasoning about Actions

Semantic Subtyping. Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud)

COMBINING PARTIAL EVALUATION AND SYMBOLIC EXECUTION

Informationslogistik Unit 4: The Relational Algebra

Lecture-12: Closed Sets

CSE-321 Programming Languages 2011 Final

Checking Conservativity With HETS

Principles of Knowledge Representation and Reasoning

Featherweight Java (FJ)

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Seminar: Specification and Verification of Object-oriented Software. The KeY Tool

Specification, Verification, and Interactive Proof

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

Softwaretechnik. Lecture 03: Types and Type Soundness. Peter Thiemann. University of Freiburg, Germany SS 2008

Formally Certified Satisfiability Solving

The Polymorphic Blame Calculus and Parametricity

Forgetting and Compacting data in Concept Learning

Uncertain Data Models

CS 512, Spring 2017: Take-Home End-of-Term Examination

Finite Math Linear Programming 1 May / 7

The Resolution Width Problem is EXPTIME-Complete

A Hoare Logic Contract Theory: An Exercise in Denotational Semantics

Part III Chapter 15: Subtyping

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result.

Substitution in Structural Operational Semantics and value-passing process calculi

CSCI-GA Scripting Languages

Part III. Chapter 15: Subtyping

Deductive Methods, Bounded Model Checking

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014

Higher-Order Intensional Type Analysis. Stephanie Weirich Cornell University

Modal logic of the planar polygons

Resolving of Intersection Types in Java

Shared Subtypes. Subtyping Recursive Parameterized Algebraic Data Types

JOURNAL OF OBJECT TECHNOLOGY

Lecture 15: The subspace topology, Closed sets

Towards a Logical Reconstruction of Relational Database Theory

A Tool for Storing OWL Using Database Technology

Linear Dependent Types in a Subrecursive Setting

RELATIONAL REPRESENTATION OF ALN KNOWLEDGE BASES

Introductory logic and sets for Computer scientists

System Description: iprover An Instantiation-Based Theorem Prover for First-Order Logic

On the Finiteness of the Recursive Chromatic Number

Modal Logic ALEXANDER CHAGROV. Tver State University. and MICHAEL ZAKHARYASCHEV

Reasoning About Loops Using Vampire

A Logic of Proofs for Differential Dynamic Logic

Review Material: First Order Logic (FOL)

MA651 Topology. Lecture 4. Topological spaces 2

Propositional Logic. Part I

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus

Subtyping (cont) Formalization of Subtyping. Lecture 15 CS 565. Inversion of the subtype relation:

Term Algebras with Length Function and Bounded Quantifier Elimination

Transcription:

A First-Order Logic with First-Class Types joint work with Peter H. Schmitt and Mattias Ulbrich Institute for Theoretical Computer Science The 8th KeY Symposium, Speyer, 2009

Java Card DL modal logic based on a first-order logic with subtyping, type predicates and casts [Gie05] x : Object. x Array length((array)x) 0 we focus only on the first-order part

Java Card DL modal logic based on a first-order logic with subtyping, type predicates and casts [Gie05] x : Object. x Array length((array)x) 0 we focus only on the first-order part

Java Card DL modal logic based on a first-order logic with subtyping, type predicates and casts [Gie05] x : Object. x Array length((array)x) 0 we focus only on the first-order part

Java Generics classes parametrized by type parameters public class Array<T> { public T last(); } Array T Array? Object what is the signature of last? { last T : Array T T }

Java Generics classes parametrized by type parameters public class Array<T> { public T last(); } Array T Array? Object what is the signature of last? { last T : Array T T }

First-Class Types { last T : Array T T } how to reason about arrays without fixing the element type?

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 a : Array?. last(a) T (a) with binary predicate ( universal types)

Outline 1 Motivation 2 Syntax 3 Semantics 4 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?

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

Terms and Formulae Definition (Term of type T ) v f (t 1,..., t n ) if v : T variable symbol 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.ϕ

Outline 1 Motivation 2 Syntax 3 Semantics 4 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 T1... D Tn D T I(p) D T1... D Tn value of a term, validity of a formula...

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 T1... D Tn D T I(p) D T1... D Tn how about the predefined symbols? value of a term, validity of a formula...

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.

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 is a finite subset which is already not satisfiable.

Reasons for Noncompactness two obstructions to compactness 1 constant symbols generate domain of T { (c. = T ) : T T } (for infinite T ; compare N)

Reasons for Noncompactness 2 non-noetherian type hierarchies {x G?, x G G?,..., (x )} (compare induction) G? G G?... Theorem (Giese) The logic of KeY has a sound and complete calculus if and only if the type hierarchy is Noetherian.

Reasons for Noncompactness 2 non-noetherian type hierarchies {x G?, x G G?,..., (x )} (compare induction) G? G G?... Theorem (Giese) The logic of KeY has a sound and complete calculus if and only if the type hierarchy is Noetherian.

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.

Outline 1 Motivation 2 Syntax 3 Semantics 4 Conclusion

Conclusion characterized completeness of the logic of KeY characterized completeness of first-class types first-class types are not useful on their own universal types, dependent types

Discussion last : Array? Object T : Array? T a : Array?. last(a) T (a) universal types: last : t : Array t t dependent types: cast : (t : T) t sophisticated machinery needed...!?

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.