Logic: First Order Logic

Similar documents
Logical Structures in Natural Language: First order Logic (FoL)

Logic: First Order Logic

Logic: Propositional Logic Truth Tables

Logic. Foundations of First Order Logic. franconi. Enrico Franconi

Logic: Propositional Logic Tableaux

Logic: First Order Logic (Part I)

Exercises for the Logic Course

Introduction to Logic in Computer Science: Autumn 2006

First-Order Logic (FOL)

ITS336 Lecture 6 First-Order Logic

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

First order logic (FOL) Chapters 8 & 9

Predicate Calculus - Syntax

Logic Overview, I. and T T T T F F F T F F F F

2. Use quantifiers to express the associative law for multiplication of real numbers.

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW PREDICATE LOGIC

Logic: Propositional Logic (Part I)

Recall that the expression x > 3 is not a proposition. Why?

Introduction to Sets and Logic (MATH 1190)

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

Predicate Logic: Sematics Part 1

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/26)

Logic III. Introduction to Artificial Intelligence CSE 150

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Propositional logic (revision) & semantic entailment. p. 1/34

First-Order Logic. Michael Rovatsos. University of Edinburgh R&N: February Informatics 2D

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

First Order Logic: Syntax and Semantics

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

Chapter 4: Classical Propositional Semantics

Marie Duží

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Logic. Readings: Coppock and Champollion textbook draft, Ch

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

AAA615: Formal Methods. Lecture 2 First-Order Logic

1 Predicates and Quantifiers

Logica e Linguaggio. Raffaella Bernardi. March 22, University of Trento

Logic and Proofs. (A brief summary)

CS156: The Calculus of Computation Zohar Manna Winter 2010

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Automated Reasoning Lecture 5: First-Order Logic

Semantics and Pragmatics of NLP

MAT 243 Test 1 SOLUTIONS, FORM A

7.8E 8.1E. Question 2. Question 1

Introduction to Logic in Computer Science: Autumn 2007

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2)

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

Formal (Natural) Deduction for Predicate Calculus

Logic. Stephen G. Ware CSCI 4525 / 5525

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

06 From Propositional to Predicate Logic

J Propositional logic is declarative J Propositional logic is compositional: q meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2

Comp487/587 - Boolean Formulas

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Predicate Calculus lecture 1

First-Order Logic. Chapter 8

Reasoning. Inference. Knowledge Representation 4/6/2018. User

CS156: The Calculus of Computation

LING 501, Fall 2004: Quantification

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Denote John by j and Smith by s, is a bachelor by predicate letter B. The statements (1) and (2) may be written as B(j) and B(s).

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

Completeness in the Monadic Predicate Calculus. We have a system of eight rules of proof. Let's list them:

Artificial Intelligence. Propositional logic

Logic and Proofs. (A brief summary)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

First-Order Logic. Chapter Overview Syntax

SYMBOLIC LOGIC UNIT 10: SINGULAR SENTENCES

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

CS 188: Artificial Intelligence Spring 2007

Logic. (Propositional Logic)

Rules of Inference. Arguments and Validity

First-Order Logic. Chapter 8

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

King s College London


Deductive Systems. Lecture - 3

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Predicate Logic. Predicates. Math 173 February 9, 2010

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

COMP 2600: Formal Methods for Software Engineeing

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Propositional Logic: Part II - Syntax & Proofs 0-0

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

2-4: The Use of Quantifiers

Intermediate Logic. First-Order Logic

Generalized Quantifiers Logical and Linguistic Aspects

Introduction to first-order logic:

Completeness for FOL

15414/614 Optional Lecture 3: Predicate Logic

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

CS 1571 Introduction to AI Lecture 14. First-order logic. CS 1571 Intro to AI. Midterm

INTRODUCTION TO NONMONOTONIC REASONING

Propositional Logic: Models and Proofs

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

First-order logic. Chapter 8. Chapter 8 1

Transcription:

Logic: First Order Logic Raffaella Bernardi bernardi@inf.unibz.it P.zza Domenicani 3, Room 2.28 Faculty of Computer Science, Free University of Bolzano-Bozen http://www.inf.unibz.it/~bernardi/courses/logic06

Contents 1 Summary of Last Lesson................................... 3 1.1 Remarks: Variables and Quantifiers................... 4 1.2 Remarks: Equivalences.............................. 5 2 Semantics of FOL: Satisfiability of formulas................... 6 2.1 Exercise........................................... 7 2.2 Remarks: Universal quantification..................... 8 2.3 Remarks: Existential quantification................... 9 3 Entailment............................................... 10 4 The Calculus............................................. 11 4.1 Rules.............................................. 12 4.2 Exercises.......................................... 14 4.3 Exercises: Universal quantifier I...................... 14 4.4 Exercises: Universal Quantifiers II.................... 15 4.5 Exercise: negated quantifiers......................... 15 4.6 Heuristics.......................................... 16 4.7 Heuristic (II)....................................... 18 5 Conclusion............................................... 19

1. Summary of Last Lesson What did we say last time about the points below? motivations for using FOL. introduction to the syntax of FOL. introduction to the semantics of FOL. Today, we will look at entailment in FOL and the tableau calculus for FOL.

1.1. Remarks: Variables and Quantifiers In the wffs x.a and x.a A is said to be the scope of x and x. Do you see any difference between the following two formulas w.r.t. their variables? 1. y.( x.(p (x, y) P (y))) 2. x.(p (x, y) P (y)) When a variable occurs within the scope of a quantifier it is said to be bound, otherwise it is said to be free. In 1. both x and y are bound. In 2. x is bound, while y is free. A formula is a sentence if no free variable occurs in it. Hence, 1. is a sentence, and 2. is not.

1.2. Remarks: Equivalences How do you represent in FOL the following sentences? 1. All lectures teach Logic. x.lectures(x) Teach(x, logic) 2. Not all lecturers teach Logic. ( x.lectures(x) Teach(x, logic)) 3. Some lectures teach logic x.lectures(x) Teach(x, logic) 4. Some lectures do not teach Logic x.lectures(x) Teach(x, logic) Question: Are any of these sentences/formulas equivalent? Yes: 2 and 4! Question: What do you conclude? How can you generalize this claim? x.a = x A

2. Semantics of FOL: Satisfiability of formulas A formula φ is satisfied by (is true in) an interpretation I under a variable assignment α, I, α = φ : I, α = P (t 1,..., t n ) iff (t 1 I,α,..., t n I,α ) P I I, α = φ iff I, α = φ I, α = φ ψ iff I, α = φ and I, α = ψ I, α = φ ψ iff I, α = φ or I, α = ψ I, α = x. φ iff for all d : I, α[x/d] = φ I, α = x. φ iff there exists a d : I, α[x/d] = φ

2.1. Exercise Evaluate the following wff (well formed formula) and give a counter-example if the formula is falsifiable. x.e(x) y.g(x, y) = {1, 2, 3, 4,...}, i.e. the set of positive integers. E I = {2, 4,...}, i.e. the set of even integers. G I = {(1, 2), (1, 3), (1, 4), (2, 3),...}, i.e. the relation greater than. Use the same domain and interpretation, to evaluate the following formulas: x. y.g(y, x) y. x.g(y, x) In the domain and interpretation above, the first formula is false and the second formula is true. What do you conclude about order of quantifiers?

2.2. Remarks: Universal quantification Everyone in England is smart : x. In(x, england) Smart(x) ( x. φ) is equivalent to the conjunction of all possible instantiations in x of φ: In(kingJohn, england) Smart(kingJohn) In(richard, england) Smart(richard)... Typically, is the main connective with. Common mistake: using as the main connective with : Why is a mistake? What does it mean? x. In(x, england) Smart(x) it means Everyone is in England and is smart. Note, it would entail the existence of the x.

2.3. Remarks: Existential quantification Someone in France is smart : x. In(x, france) Smart(x) ( x. φ) is equivalent to the disjunction of all possible instantiations in x of φ In(kingJohn, france) Smart(kingJohn) In(richard, france) Smart(richard)... Typically, is the main connective with. Common mistake: using as the main connective with : x. In(x, france) Smart(x) Why is it a mistake? What does it mean? It would be true even if nobody is in France! It would not entail the existence of x.

3. Entailment Entailment is defined similarly as in propositional logic. The formula φ is logically implied by a formula ψ, if φ is true in all models of ψ (symbolically, ψ = φ): ψ = φ iff I = φ for all models I of ψ

4. The Calculus The completion rules for quantified formulas: x. φ φ{x/t} x. φ x. φ φ{x/a} If a model satisfies a universal quantified formula, the it also satisfies the formula where the quantified variable has been substituted with some term. The prescription is to use all the terms which appear in the tableau. If a model satisfies an existential quantified formula, then it also satisfies the formula where the quantified variable has been substituted with a fresh new Skolem term.

4.1. Rules (1) A B A B (2) A B A B (3) A B A B (4) A B A B A B (5) A A (6) (A B) A B (7) (A B) A B (8) (A B) A B (9) (A B) A B A B

(10) x.a(x) A(t) where t is a term (11) x.a(x) A(t) where t is a term which has not been used in the derivation so far. (12) x(a(x)) x( A(x)) (13) x(a(x)) x( A(x)) Finally, whenever a wff A and its negation A appear in a branch of a tableau, the unsatisfability is indicated in that branch and it is closed, i.e. it is not further extended.

4.2. Exercises Prove that the following entailments are valid. (P (c) T (c, e)) ( P (c) T (e, c)) = P (c) T (c, e) x. y.g(x, y) = y. x.g(x, y) 4.3. Exercises: Universal quantifier I (a) Formalize the following problem and (b) check its validity. All frogs are green. Everything is a frog. Therefore, Alf is green. Let F (x), G(x) and a stand for x is a frog, x is green, and Alf. We may formalize the argument as: (b) Build the tableau. x.f (x) G(x), x.f (x) = G(a)

4.4. Exercises: Universal Quantifiers II Prove whether the following entailments are valid and give a counter-example (a domain and an interpretation) if they are not. F (a) G(b), x. F (x) = G(b) x.f (x) G(x), x.g(x) = F (a) 4.5. Exercise: negated quantifiers x.f (x) G(x), x.g(x) = F (a) x.f (x) G(x) = F (a) x.f (x) x.g(x), xg(x) = x F (x)

4.6. Heuristics Prove x.( y.(r(x, y))) R(a, a) is valid. 1. ( x.( y.r(x, y))) R(a, a)) 2. x.( y.(r(x, y))) Rule (8) applied to 1. 3. R(a, a) Rule (8) applied to 1. 4. y.r(a, y) Rule (11) applied to 2. 5. R(a, a) Rule (11) applied to 4. Can we conclude that the x.( y.(r(x, y))) R(a, a) is valid? Let us interpret the above theorem as following: Let the natural numbers be our domain of interpretation. Let R(x, y) stand for x < y Then, x.( y.(r(x, y))) is satisfiable. E.g. 2 < 4. From this it follows that R(a, a) should be true as well, but it is not. Hence, x.( y.(r(x, y))) R(a, a) is not satisfiable in this interpretation, much less valid.

On line 5. Rule (11) has violeted the constraint: the term a was already used. Similarly, a could have not been used in line 4. either. Hence we don t get a contraddiction and the tableau is not closed. Note : The same term can be used many times for universal instantiation. Heuristic : When developing a semantic tableau in FOL use the existential instantiation rule (Rule 11) before the universal instantiation rule (Rule 10).

4.7. Heuristic (II) 1. ( x.(a(x) B(x)) x.a(x)) 2. x.(a(x) B(x)) Rule (8) applied to 1. 3. ( x.a(x)) Rule (8) applied to 1. 4. x. A(x) Rule (12) applied to 3. 5. A(a) Rule (11) applied to 4. 6. A(a) B(a) Rule (10) applied to 2. 7. A(a) Rule (1) applied to 6. 8. B(a) Rule (1) applied to 6. Closed Note: if we had used Rule 10 before we would have not been able to apply Rule 11.

5. Conclusion Change in the schedule : 1st of December: two hours (09:30-11:30) with Rosella Gennari. 5th of December: one hour (17:00-18:00) with Raffaella Bernardi. 15th of December: three hours (08:30-11:30) with Raffaella Bernardi 22nd of December: one hour (08:30-09:30) to ask all your last minute doubts!(09:30-11:30): mid term (= 30% of the exam)! NOTE: At end of the lesson some of the student proposed to have the mid term on the 15th of December. That s fine with me. You will receive a mail from Sara Mani about this change.