Where are we? Introduction to Logic 1

Similar documents
Mathematical Induction

Invalidity in Predicate Logic

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Full and Complete Binary Trees

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

DEFINABLE TYPES IN PRESBURGER ARITHMETIC

3. Mathematical Induction

Handout #1: Mathematical Reasoning

CODING TRUE ARITHMETIC IN THE MEDVEDEV AND MUCHNIK DEGREES

Certamen 1 de Representación del Conocimiento

x < y iff x < y, or x and y are incomparable and x χ(x,y) < y χ(x,y).

Factorization in Polynomial Rings

Lecture 16 : Relations and Functions DRAFT

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

First-Order Logics and Truth Degrees

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

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

Finite dimensional topological vector spaces

If an English sentence is ambiguous, it may allow for more than one adequate transcription.

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

Basic Proof Techniques

it is easy to see that α = a

INCIDENCE-BETWEENNESS GEOMETRY

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Equality and dependent type theory. Oberwolfach, March 2 (with some later corrections)

Lecture 17 : Equivalence and Order Relations DRAFT

Algorithmic Software Verification

Introduction to Automata Theory. Reading: Chapter 1

2. The Language of First-order Logic

DIVISIBILITY AND GREATEST COMMON DIVISORS

The Recovery of a Schema Mapping: Bringing Exchanged Data Back

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

8 Divisibility and prime numbers

CHAPTER 7 GENERAL PROOF SYSTEMS

Lecture notes - Model Theory (Math 411) Autumn 2002.

The Syntax of Predicate Logic

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

Fundamentele Informatica II

The sample space for a pair of die rolls is the set. The sample space for a random number between 0 and 1 is the interval [0, 1].

10.4 Traditional Subject Predicate Propositions

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

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

Fixed-Point Logics and Computation

Lecture 8: Resolution theorem-proving

Jaakko Hintikka Boston University. and. Ilpo Halonen University of Helsinki INTERPOLATION AS EXPLANATION

k, then n = p2α 1 1 pα k

Mathematical Induction

Overview of E0222: Automata and Computability

Quotient Rings and Field Extensions

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

Computability Theory

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

Software Verification and Testing. Lecture Notes: Temporal Logics

The composition of Mappings in a Nautural Interface

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

calculating the result modulo 3, as follows: p(0) = = 1 0,

Lecture 13 of 41. More Propositional and Predicate Logic

Aikaterini Marazopoulou

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

INTRODUCTORY SET THEORY

First-Order Theories

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

Predicate Logic Review

THE BANACH CONTRACTION PRINCIPLE. Contents

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

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

Bindings, mobility of bindings, and the -quantifier

Matrix Representations of Linear Transformations and Changes of Coordinates

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES

1 if 1 x 0 1 if 0 x 1

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Page 331, 38.4 Suppose a is a positive integer and p is a prime. Prove that p a if and only if the prime factorization of a contains p.

MODELS OF SET THEORY

MATH 289 PROBLEM SET 4: NUMBER THEORY

Predicate Logic. For example, consider the following argument:

Solutions to Math 51 First Exam January 29, 2015

Solutions to In-Class Problems Week 4, Mon.

Translation Guide. Not both P and Q ~(P Q) Not either P or Q (neither/nor)

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

3515ICT Theory of Computation Turing Machines

ON SEQUENTIAL CONTINUITY OF COMPOSITION MAPPING. 0. Introduction

5544 = = = Now we have to find a divisor of 693. We can try 3, and 693 = 3 231,and we keep dividing by 3 to get: 1

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Software Modeling and Verification

MAT Program Verication: Exercises

The Division Algorithm for Polynomials Handout Monday March 5, 2012

SMALL SKEW FIELDS CÉDRIC MILLIET

Graph Theory Problems and Solutions

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Cartesian Products and Relations

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

EQUATIONAL LOGIC AND ABSTRACT ALGEBRA * ABSTRACT

Mathematical Induction. Lecture 10-11

LEARNING OBJECTIVES FOR THIS CHAPTER

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Transcription:

Introduction to Logic 1 1. Preliminaries 2. Propositional Logic 3. Tree method for PL 4. First-order Predicate Logic 5. Tree Method for FOL 6. Expressiveness of FOL Where are we?

Introduction to Logic 2 5. Trees for FOL

Introduction to Logic 3 The tree method for predicate logic We add to the branching rules for propositional connectives three rules for quantifiers. We use an infinite set of individual constants {a 0, a 1,...}. a. xφ x φ b. xφ(x) φ(b) c. xφ(x) φ(c) xφ x φ : for every constant b already present on the branch. If there is no previous constant, use a 0. :for c a fresh constant, not already present on the tree

Introduction to Logic 4 Algorithm 1. To show whether Γ = φ, (with Γ finite). Append φ to the formulas of Γ. 2. Close any branch which contains a formula and its negation. If all branches are closed, stop. 3. If a formula has not been considered and has for main connective a propositional connective, apply the connective rule. Otherwise do 4. 4. If a formula xφ(x) has not been considered, apply rule and go back to 3. Otherwise go to 5. 5. If a formula xφ(x) has not been examined, apply the rule and go to 6. 6. Whenever a new formula or new constant appears on the tree, go back to stage 2. Otherwise, stop.

Introduction to Logic 5 Example 1 If everyone is proud, then someone is proud? xp (x) xp (x)

Introduction to Logic 6 ( xp (x) xp (x))

Introduction to Logic 7 ( xp (x) xp (x)) xp (x) xp (x)

Introduction to Logic 8 ( xp (x) xp (x)) xp (x) xp (x) x P (x)

Introduction to Logic 9 ( xp (x) xp (x)) xp (x) xp (x) x P (x)

Introduction to Logic 10 ( xp (x) xp (x)) xp (x) xp (x) x P (x) P (a 0 )

Introduction to Logic 11 ( xp (x) xp (x)) xp (x) xp (x) x P (x) P (a 0 )

Introduction to Logic 12 ( xp (x) xp (x)) xp (x) xp (x) x P (x) P (a 0 ) P (a 0 )

Introduction to Logic 13 ( xp (x) xp (x)) xp (x) xp (x) x P (x) P (a 0 ) P (a 0 ) The algorithm stops and all branches are closed.

Introduction to Logic 14 Example 2 someone is cooking and reading, and someone is cooking and watching TV, so someone is reading and watching TV x(a(x) B(x)), x(a(x) C(x))? x(b(x) C(x)) x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x))

Introduction to Logic 15 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x))

Introduction to Logic 16 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x)) A(a 0 ) B(a 0 )

Introduction to Logic 17 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 )

Introduction to Logic 18 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 )

Introduction to Logic 19 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 )

Introduction to Logic 20 x(a(x) B(x)) x(a(x) C(x)) x(b(x) C(x)) x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 )

Introduction to Logic 21 x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) (B(a 0 ) C(a 0 ))

Introduction to Logic 22 x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) (B(a 0 ) C(a 0 )) (B(a 1 ) C(a 1 ))

Introduction to Logic 23 x (B(x) C(x)) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) (B(a 0 ) C(a 0 )) (B(a 1 ) C(a 1 )) B(a 0 ) C(a 0 )

Introduction to Logic 24 A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) A(a 0 ) B(a 0 ) A(a 1 ) C(a 1 ) (B(a 0 ) C(a 0 )) (B(a 1 ) C(a 1 )) B(a 0 ) C(a 0 ) B(a 1 ) C(a 1 )

Introduction to Logic 25 The algorithm stops, but there is an open branch. Note that the open branch gives us a countermodel with two individuals a 0 and a 1, in which a 0 is A, B but not C, and a 1 is A, C but not B. U = {a 0, a 1 } A M = U B M = {a 0 } C M = {a 1 }

Introduction to Logic 26 Example 3 Everyone loves someone, so someone is loved by everyone x yl(x, y)? y xl(x, y) x yl(x, y) y xl(x, y) y xl(x, y) y x L(x, y)

Introduction to Logic 27 Example 3 Everyone loves someone, so someone is loved by everyone x yl(x, y)? y xl(x, y) x yl(x, y) y xl(x, y) y xl(x, y) y x L(x, y)

Introduction to Logic 28 yl(a 0, y) x L(x, a 0 ) L(a 0, a 1 ) L(a 2, a 0 ) yl(a 1, y) yl(a 2, y) x L(x, a 1 ) x L(x, a 2 ) L(a 1, a 3 ) L(a 2, a 4 ) L(a 5, a 1 ) L(a 6, a 2 )..

Introduction to Logic 29 The algorithm will continue indefinitely : no stop, and an infinite open branch. However: it is us who can say (and prove) the branch will be infinite ; the algorithm has no way to tell. This also suggests that, from the algorithm, we can construct an infinite model that satisfies x yl(x, y), but falsifies y xl(x, y).

Introduction to Logic 30 Summary 1. The procedure terminates with all branches closed 2. The procedure terminates with some finite open branch 3. The procedure does not terminate (there is an infinite open branch).

Introduction to Logic 31 Completeness Let us write : φ for : the tree built from φ closes. We can prove that : Theorem (Completeness) : φ iff = φ (soundness) If a branch extension rule is applied to a satisfiable branch, one of the resulting branches is satisfiable. The interesting cases are the rules for and. Clearly, if a branch containing xφ(x) is satisfiable, so is the extension. If a branch containing xφ(x) is satisfiable in a model M, then for some constant c, φ(c) is satisfied in M. What about φ(c) where c is a fresh constant? Then the model M in which c M = c M is also a model of the branch.

Introduction to Logic 32 (completeness) If B is an open branch, extract a model M B by letting U B be the set of constants occurring on that branch. For P an n-ary predicate letter, set: (a i1,..., a in ) is in P M iff P (a i1,..., a in ) is a formula on B By induction, one can prove that if φ is on B, then M B = φ, and if φ is on B, then M B = φ. So, if φ, then M B, where B is an open branch, satisfies φ, and so φ.

Introduction to Logic 33 Undecidability So, FOL is complete: the tree method yields a sound and complete proof procedure for validity in FOL. But is FOL decidable? Note that the tree method is not a decision method, but only a semi-decision method: if = φ, then φ, ie the tree will eventually close. But if φ, it can happen that the algorithm keeps on searching (remember example 3!). This is not a specificity of this method, indeed: Theorem (Church 1936) : FOL is undecidable.

Introduction to Logic 34 6. Limitations of FOL

Introduction to Logic 35 Expressiveness We know that FOL is more expressive than PL, but how expressive is it? To answer this question, we need to know some general properties about FOL. The compactness theorem, in particular, plays an essential role.

Introduction to Logic 36 First-order logic with identity Consider FOL to which one adds a binary relation = expressing identity. In particular, if c and d are constants of the language, and M is a structure, then M = c = d iff c M = d M. How much can one express with identity? Abbreviation: x y for (x = y) there are at least two elements : x y( x = y) there are at least three elements : x y z(x y y z z x) there are at least n elements λ n := x 1 x 2... x n ( x i x j ) i j

Introduction to Logic 37 there are at most two elements : x y z(x = y y = z x = z) there are at most n elements : µ n = x 0 x 1 x n ( x i = x j ) there is exactly n elements : there are at least n elements, and at most n elements: (λ n µ n ) i j

Introduction to Logic 38 Some stars are blue : x(s(x) B(x)) (At least) two stars are blue : x y( x = y S(x) S(y) B(x) B(y)) Can we express that: infinitely many stars are blue? Consider the following theory (set of sentences): T = {λ n ; n 2} there is at least two elements there is at least three elements. T has only infinite models. Suppose it has a finite model M. Let k be the size of the domain. Since M satisfies all sentences of T, M = λ k+1 : contradiction.

Introduction to Logic 39 A finite number of Existential quantification: some Finite cardinality quantification : at least n, at most n, exactly n. Infinite cardinality: infinitely many (but note that we expressed it by means of an infinite set of sentences). What about there is a finite number of? This can t be expressed in FOL! Why? because FOL has compactness.

Introduction to Logic 40 Compactness Consider the sentences: F : there are finitely many elements F 1 : there is at least one element F 2 : there are at least two elements F 3 : there are at least three elements.. Taken together, these sentences are inconsistent: they require both that there are finitely many elements, and they entail that there are infinitely many elements. However, every finite subset of these sentences is satisfiable (why?).

Introduction to Logic 41 Compactness We know that each F n is expressible in FOL by the sentence λ n. If F (finiteness) were expressible by a sentence φ, then the set of sentences Γ = {λ n ; n 2} {φ} would not be satisfiable, while every finite subset would be : so FOL would not be compact. However... Theorem (Compactness) If every finite set of FO-sentences of a set Γ has a model, then Γ has a model. Corollary : finiteness is not expressible in FOL.

Introduction to Logic 42 Further examples Some properties of relations can be expressed in FOL: R is reflexive : xr(x, x) R is symmetric : x y(r(x, y) R(y, x)) Others can t be expressed. Example : Connectedness: for any two points x and y, there is a path leading from x to y, ie a set of points a 1,..., a n such that xra 1 Ra 2 R...Ra n Ry. Proof: show that the theory saying x and y are connected, are distinct, and there is no path of length 1 between them, no path of length 2,..., is consistent (use compactness).

Introduction to Logic 43 Most (1) There are more cats than dogs (2) Most dogs are nice Neither of the sentences can be expressed within FOL. Why not? The idea is: they involve quantification over sets, not only individuals. there are more A than B : the set of A has more elements than the set of B. Most A are B means : the set of A that are B has more elements than the set of A that are not B.

Introduction to Logic 44 Restricted quantification Some A are B : [ x : A(x)]B(x) All A are B : [ x : A(x)]B(x) We can define these new expressions within FOL. [ x : A(x)]B(x) x(a(x) B(x)) [ x : A(x)]B(x) x(a(x) B(x)]

Introduction to Logic 45 Most again Introduce a new quantifier Mx : for most x in the domain MxP (x) : most individuals are P [Mx : A(x)]B(x) is true in a structure if there are more individuals that are A and B than are A and B. Imagine we work with only finite structures: Show that [Mx : A(x)]B(x) cannot be paraphrased as: (a) Mx(A(x) B(x)) (b) Mx(A(x) B(x)) Show that (a) gives a weaker reading, and that (b) gives a stronger reading.

Introduction to Logic 46 Beyond FOL How to go beyond these expressive limitations? Use a more powerful logic: like Second Order Logic (SOL), in which we can quantify over properties (sets)! Problem : we lose some nice properties. Second-order logic, for instance, is not only undecidable, but even incomplete. It is also non-compact (since it can express finiteness of a domain).