Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)



Similar documents
CHAPTER 7 GENERAL PROOF SYSTEMS

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

Foundational Proof Certificates

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

A Propositional Dynamic Logic for CCS Programs

First-Order Logics and Truth Degrees

Non-deterministic Semantics and the Undecidability of Boolean BI

Lecture 13 of 41. More Propositional and Predicate Logic

CS510 Software Engineering

Automated Theorem Proving - summary of lecture 1

Handout #1: Mathematical Reasoning

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Continued Fractions and the Euclidean Algorithm

Mathematical Induction. Lecture 10-11

PROOFS AND TYPES JEAN-YVES GIRARD PAUL TAYLOR YVES LAFONT. CAMBRIDGE UNIVERSITY PRESS Cambridge. Translated and with appendices by

3. Mathematical Induction

Mathematics Course 111: Algebra I Part IV: Vector Spaces

MA651 Topology. Lecture 6. Separation Axioms.

FIRST YEAR CALCULUS. Chapter 7 CONTINUITY. It is a parabola, and we can draw this parabola without lifting our pencil from the paper.

Turing Degrees and Definability of the Jump. Theodore A. Slaman. University of California, Berkeley. CJuly, 2005

Introduction to Finite Fields (cont.)

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Research Note. Bi-intuitionistic Boolean Bunched Logic

How To Understand The Theory Of Hyperreals

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

Rigorous Software Development CSCI-GA

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

Bindings, mobility of bindings, and the -quantifier

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

GREATEST COMMON DIVISOR

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

INTRODUCTORY SET THEORY

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

CONTRIBUTIONS TO ZERO SUM PROBLEMS

DEFINABLE TYPES IN PRESBURGER ARITHMETIC

o-minimality and Uniformity in n 1 Graphs

it is easy to see that α = a

This chapter is all about cardinality of sets. At first this looks like a

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

E3: PROBABILITY AND STATISTICS lecture notes

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

No: Bilkent University. Monotonic Extension. Farhad Husseinov. Discussion Papers. Department of Economics

GROUPS ACTING ON A SET

H/wk 13, Solutions to selected problems

Theory of Automated Reasoning An Introduction. Antti-Juhani Kaijanaho

Fixed-Point Logics and Computation

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

Type Theory & Functional Programming

Answer Key for California State Standards: Algebra I

Cartesian Products and Relations

Basic Proof Techniques

Solving Linear Systems, Continued and The Inverse of a Matrix

Vocabulary Words and Definitions for Algebra

2.3 Convex Constrained Optimization Problems

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Computational Methods for Database Repair by Signed Formulae

Software Modeling and Verification

How To Prove The Dirichlet Unit Theorem

DEGREES OF CATEGORICITY AND THE HYPERARITHMETIC HIERARCHY

Algorithmic Software Verification

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

1 if 1 x 0 1 if 0 x 1

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

Notes V General Equilibrium: Positive Theory. 1 Walrasian Equilibrium and Excess Demand

Chapter ML:IV. IV. Statistical Learning. Probability Basics Bayes Classification Maximum a-posteriori Hypotheses

1 = (a 0 + b 0 α) (a m 1 + b m 1 α) 2. for certain elements a 0,..., a m 1, b 0,..., b m 1 of F. Multiplying out, we obtain

Dedekind s forgotten axiom and why we should teach it (and why we shouldn t teach mathematical induction in our calculus classes)

INCIDENCE-BETWEENNESS GEOMETRY

Logic, Algebra and Truth Degrees Siena. A characterization of rst order rational Pavelka's logic

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Degrees that are not degrees of categoricity

Introduction to Algebraic Geometry. Bézout s Theorem and Inflection Points

2. The Language of First-order Logic

CODING TRUE ARITHMETIC IN THE MEDVEDEV AND MUCHNIK DEGREES

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

Semantics and Verification of Software

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

NOTES ON CATEGORIES AND FUNCTORS

Set theory as a foundation for mathematics

The Banach-Tarski Paradox

Vector and Matrix Norms

A first step towards modeling semistructured data in hybrid multimodal logic

Interpersonal Comparisons of Utility: An Algebraic Characterization of Projective Preorders and Some Welfare Consequences

OPERATIONAL TYPE THEORY by Adam Petcher Prepared under the direction of Professor Aaron Stump A thesis presented to the School of Engineering of

Introduction. Appendix D Mathematical Induction D1

Degree Hypergroupoids Associated with Hypergraphs

1 VECTOR SPACES AND SUBSPACES

Lecture 8: Resolution theorem-proving

COMPUTER SCIENCE TRIPOS

So let us begin our quest to find the holy grail of real analysis.

System BV is NP-complete

Transcription:

Summary Summary Last Lecture sequent calculus Automated Reasoning Georg Moser Institute of Computer Science @ UIBK Winter 013 (Normalisation and Strong Normalisation) let Π be a proof in minimal logic 1 a reduction sequence Π = Π 1,, Π n computable upper bound n on the maximal length of any reduction sequence Corollary if T 0 is complete and T 1, T are satisfiable extensions of T 0, then T 1 T is satisfiable GM (Institute of Computer Science @ UIBK) Automated Reasoning 17/1 Summary let G be a set of universal sentences (of L) without =, then the following is equivalent 1 G is satisfiable G has a Herbrand model 3 finite G 0 Gr(G), G 0 has a Herbrand model Corollary x 1 x n G(x 1,, x n ) is valid iff there are ground terms t k 1,, tk n, k N and the following is valid: G(t 1 1,, t1 n) G(t k 1,, tk n ) formula, formula G not containing individual, nor function constants, nor = such that G GM (Institute of Computer Science @ UIBK) Automated Reasoning 18/1 Summary Outline of the Lecture Propositional Logic short reminder of propositional logic, soundness and completeness theorem, natural deduction, propositional resolution irst Order Logic introduction, syntax, semantics, undecidability of first-order, Löwenheim- Skolem, compactness, model existence theorem, natural deduction, completeness, sequent calculus, normalisation Properties of irst Order Logic Craig s Interpolation, Robinson s Joint Consistency, Herbrand s Limits and xtensions of irst Order Logic, Curry-Howard Isomorphism, Limits, Second-Order Logic GM (Institute of Computer Science @ UIBK) Automated Reasoning 19/1

Background: Russel s paradox according to naive set theory, any definable collection is a set; this is not a good idea Proof 1 let R := {x x x} as x x is a definition (= a predicate) this should be set 3 so either R R, or R R, but R R R R R R R R 4 hence R R R R, which is a contradiction 5 thus naive set theory is inconsistent Oops, what to do? Brouwer s Way Out (174) Change Mathematics! intuitionistic logic is a restriction of classical logic, where certain formulas are no longer derivable for example A A is no longer valid its interpretation in intuitionistic logic is: there is an argument for A or there is a argument for A (= from the assumption A we can prove a contradiction) GM (Institute of Computer Science @ UIBK) Automated Reasoning 130/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 131/1 A Problem with the xcluded Middle solutions of the equation x y = z with x and y irrational and z rational Proof 1 is an irrational number one of the following two cases has to occur: is rational, then is irrational, then x = y = z = x = y = z = ( ) = = prototypical example of a non-constructive proof : i introduction : i : i elimination : e G G : i G : e : e : e GM (Institute of Computer Science @ UIBK) Automated Reasoning 13/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 133/1

Remark note the absence of introduction elimination : i : e : e : e (Alternative) an equivalent formalisation of intutitionistic logic is given by sequent calculus with the following restriction: sequents Γ : 1 (Brower, Heyting, Kolmogorow (Kreisel) Interpretation) an argument for is an argument for and an argument for is an argument of or an argument for is a transformation of an argument for into an argument for is interpreted as no argument for can exist the formal definition needs Kripke models GM (Institute of Computer Science @ UIBK) Automated Reasoning 134/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 135/1 Kripke Models a frame is a pair (W, ), where W denotes a nonempty set of worlds and denotes a preorder on W a Kripke model on a frame = (W, ) is a triple K = (W,, (A p ) p W ) such that for all p: 1 A p = (A p, a p ) A p is a non-empty set (the domain in world p) 3 A p is a mapping that associates predicate constants to domains predicate symbols P, p, q W, (a 1,, a n ) A n p: p q, A p = P(a 1,, a n ) implies A q = P(a 1,, a n ) we set A = p W A p Convention suppose (x 1,, x n ) is formula with free variables x 1,, x n ; we write (a 1,, a n ) for the interpretation of x i by a i A in for a given Kripke model K = (W,, (A p ) p W ) the satisfaction relation is defined as follows: K, p K, p K, p P(a 1,, a n ) if A p = P(a 1,, a n ) K, p A B iff K, p A and K, p B K, p A B iff K, p A or K, p B K, p A B iff for all q p: K, q A implies K, q B a formula is valid in K if K, p for all p W GM (Institute of Computer Science @ UIBK) Automated Reasoning 136/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 137/1

Some Transfer Results Natural Deduction vs Sequent Calculus Natural Deduction for Minimal Logic natural deduction (and the sequent calculus) for intuitionistic logic is sound and complete introduction A A elimination natural deduction is strongly normalising sequent calculus admits cut-eliminiation Γ Γ Γ Γ, G Γ, G Γ G Craig s interpolation theoremm holds for intutitionistic logic Γ, Γ GM (Institute of Computer Science @ UIBK) Automated Reasoning 138/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 139/1 Natural Deduction vs Sequent Calculus A Sequent Calculus for Minimal Logic left right, Γ C, Γ C : l Γ 1 Γ Γ 1, Γ, Γ C, Γ C : l, Γ 1 C, Γ C, Γ 1, Γ C : l : r Γ : r Γ 1, Γ C, Γ 1, Γ C : l Γ, : l : r Natural Deduction vs Sequent Calculus Lemma let S = (Γ C) be a sequent; proof Π of S in natural deduction iff proof Ψ of S in the sequent calculus Proof direction from left to right is shown by induction on the length of Π, ie, on the number of sequents in Π 1 the base case is immediate as Π A A iff Ψ A A for the step case, consider the case that Π has the following form: Π 0 by induction hypothesis a sequent calculus proof Ψ 0 of GM (Institute of Computer Science @ UIBK) Automated Reasoning 140/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 141/1

Natural Deduction vs Sequent Calculus Proof (cont d) 3 the following is a correct proof: Natural Deduction vs Sequent Calculus Natural Deduction Structural Rules Ψ 0 : l cut 4 all other cases are similar the other direction follows by induction on the length of Ψ contraction weakening A, A, Γ C A, Γ C Γ C A, Γ C Question is this really correct? Answer no, we forgot about the structural rules in the direction from right to left Observations note the restriction to one formula in the succedent contraction and weakening can also be represented by changed axioms and representation of sequents GM (Institute of Computer Science @ UIBK) Automated Reasoning 14/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 143/1 Natural Deduction vs Sequent Calculus Outline of the Lecture Propositional Logic short reminder of propositional logic, soundness and completeness theorem, natural deduction, propositional resolution irst Order Logic introduction, syntax, semantics, undecidability of first-order, Löwenheim- Skolem, compactness, model existence theorem, natural deduction, completeness, sequent calculus, normalisation Properties of irst Order Logic Craig s Interpolation, Robinson s Joint Consistency, Herbrand s Limits and xtensions of irst Order Logic, Curry-Howard Isomorphism, Second-Order Logic Typed λ-calculus Typed λ-calculus (types and terms) we define the set of types T and typed λ-terms as follows: a variable type: α,, γ, if σ, τ are types, then (σ τ) is a (product) type if σ, τ are types, then (σ τ) is a (function) type any (typed) variable x : σ is a (typed) term if M : σ, N : τ are terms, then M, N : σ τ is a term if M : σ τ is a term, then fst(m) : σ and snd(m) : τ are terms if M : τ is a term, x : σ a variable, then the abstraction (λx σ M) : σ τ is a term if M : σ τ, N : σ are terms, then the application (MN) : τ is a term GM (Institute of Computer Science @ UIBK) Automated Reasoning 144/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 145/1

Typed λ-calculus Typed λ-calculus the following are (well-formed, typed) terms λfxfx : (σ τ) σ τ λxx, λyy : (σ σ) (τ τ) but λxxx cannot be typed! the set of free variables of a term is defined as follows V(x) = {x} V(λxM) = V(M) {x} V(MN) = V( M, N ) = V(M) V(N) V(fst(M)) = V(snd(M)) = V(M) (informal) occurrences of x in the scope of λ are called bound GM (Institute of Computer Science @ UIBK) Automated Reasoning 146/1 (substitution) M[x := N] denotes the result of substituting N for x in M x[x := N] = N and if x y, then y[x := N] = y (λxm)[x := N] = λxm (λym)[x := N] = λy(m[x := N]), if x y and y V(N) (M 1 M )[x := N] = (M 1 [x := N])(M [x := N]) M 1, M [x := N] = M 1 [x := N], M [x := N] fst(m)[x := N] = fst(m[x := N]) snd(m)[x := N] = snd(m[x := N]) (-reduction) (λxm)n M[x := N] fst( M, N ) M snd( M, N ) N GM (Institute of Computer Science @ UIBK) Automated Reasoning 147/1 Typed λ-calculus Lemma -reduction is closed under context: LM LN ML NL λxm λxn M N = M, L N, L L, M L, N fst(m) fst(n) snd(m) snd(n) (λf λxfx)(λxx + 1)0 (λx(λxx + 1)x)0 (λxx + 1)0 1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 148/1 Curry-Howard Isomorphism Type Checking Γ M : σ Γ N : τ Γ M, N : σ τ Remarks x : σ, Γ x : σ ref pair Γ M : σ τ Γ fst(m) : σ fst Γ M : σ τ Γ snd(m) : τ snd Γ, x : σ M : τ Γ λxm : σ τ abs Γ M : σ τ Γ N : σ Γ MN : τ 1 different to type checking system in functional programming we have type assignment for product types weakening is incorporated into the axiom, sequents arepresented as sets GM (Institute of Computer Science @ UIBK) Automated Reasoning 149/1 app

Types as ormulas Types as ormulas (Types as ormulas) (ref) (Ax) + structural rules (pair) ( : i) (abs) ( : i) (fst) ( : e) (app) ( : e) (snd) ( : e) Question what is the correspondence to? Answer sum types! a (binary) sum type describes a set of values drawn from exactly two given types GM (Institute of Computer Science @ UIBK) Automated Reasoning 150/1 Types as ormulas Type System for Sum Types Γ M : σ Γ inl(m) : σ + τ Γ N : τ Γ inr(n) : σ + τ Γ M : σ + τ Γ, x : σ N 1 : γ Γ, y : τ N : γ Γ case M of inl(x) N 1 inr(y) N : γ (-reduction, cont d) (λxm)n M[x := N] fst( M, N ) snd( M, N ) M N case inl(m) of inl(x) N 1 inr(y) N N1 [x := M] case inr(n) of inl(x) N 1 inr(y) N N [y := N] GM (Institute of Computer Science @ UIBK) Automated Reasoning 151/1 Types as ormulas Curry-Howard Correspondence Proofs as Programs Proofs as Programs (Types as ormulas (cont d)) (ref) (Ax) + structural rules (pair) ( : i) (abs) ( : i) (fst) ( : e) (app) ( : e) (snd) ( : e) (inl) ( : i) (inr) ( : i) (case) ( : e) (Curry-Howard) (normalisation) Π 1 Π Γ M : σ Γ N : τ Γ M, N : σ τ Γ fst( M, N ) : σ = Π 1 Γ M : σ the Curry-Howard correspondence (aka Curry-Howard isomorophism) consists of the following parts: 1 formulas = types proof = programs 3 normalisation = computation (-reduction) fst( M, N ) M GM (Institute of Computer Science @ UIBK) Automated Reasoning 15/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 153/1

Proofs as Programs Proofs as Programs (normalisation) Π 1 Γ, x : σ M : τ Γ λxm : σ τ Γ (λxm)n : τ Π Γ N : σ = Π 1 [x\π ] Γ M[x := N] : τ Discussion act the Curry-Howard correspondence extends to many systems, for example intuitionistic logic and λ-calculus Hilbert axioms and combinatory logic linear logic and interaction nets the proof Π 1 [x\π ] represents the proof obtained from Π 1 by substituting Π into Π 1 instead of the use of ref wrt x (-reduction) (λxm)n M Observations the Curry-Howard correspondence 1 links logic with programming, ie, provides an explanation for the sucess of logic in computer science allows to mutual enrich both areas 3 provides a formally verified form of programming 4 GM (Institute of Computer Science @ UIBK) Automated Reasoning 154/1 GM (Institute of Computer Science @ UIBK) Automated Reasoning 155/1 Proofs as Programs strong normalisation of simply typed λ-calculus is typically proved via strong normalisation of minimal logic similarily, undecidablilty of type inhabitation of dependent types follows from undeciabilty of intuitionistic predicate logic correspondencence between interaction nets and linear logic provides type system to interaction nets formalisation of the theory of forbidden patterns for rewrite strategies in Isabelle provides a machine-checked theory code export from Isabelle provides OCaml code that has been integrated into T T T GM (Institute of Computer Science @ UIBK) Automated Reasoning 156/1