Logic: First Order Logic

Similar documents
Logic: Propositional Logic (Part I)

Logic: First Order Logic

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Logic: Propositional Logic Tableaux

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Logic: Propositional Logic Truth Tables

Equivalences. Proposition 2.8: The following equivalences are valid for all formulas φ, ψ, χ: (φ φ) φ. Idempotency Idempotency Commutativity

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form.

Tautologies, Contradictions, and Contingencies

Deductive Systems. Lecture - 3

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

Part 1: Propositional Logic

Propositional Logic Language

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)


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

Inference in Propositional Logic

Language of Propositional Logic

Logic: First Order Logic (Part I)

Comp487/587 - Boolean Formulas

Substitution Theorem. Equivalences. Proposition 2.8 The following equivalences are valid for all formulas φ, ψ, χ: (φ φ) φ Idempotency


Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

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

2.2: Logical Equivalence: The Laws of Logic

CS206 Lecture 03. Propositional Logic Proofs. Plan for Lecture 03. Axioms. Normal Forms

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

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

Solutions to Homework I (1.1)

Supplementary exercises in propositional logic

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Logic for Computer Scientists

Logic for Computer Scientists

Normal Forms of Propositional Logic

CS156: The Calculus of Computation

2.5.2 Basic CNF/DNF Transformation

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

AAA615: Formal Methods. Lecture 2 First-Order Logic

CS 512, Spring 2017, Handout 10 Propositional Logic: Conjunctive Normal Forms, Disjunctive Normal Forms, Horn Formulas, and other special forms

Introduction to Sets and Logic (MATH 1190)

1.3 Propositional Equivalences

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

CHAPTER 10. Predicate Automated Proof Systems

Introduction to Artificial Intelligence. Logical Agents

CSC Discrete Math I, Spring Propositional Logic

INF3170 / INF4171 Notes on Resolution

Theory of Computer Science

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

Outline. Formale Methoden der Informatik First-Order Logic for Forgetters. Why PL1? Why PL1? Cont d. Motivation

α-formulas β-formulas

Propositional and Predicate Logic - V

Some Rewriting Systems as a Background of Proving Methods

1 Introduction to Predicate Resolution

Logic Part I: Classical Logic and Its Semantics

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Logic Programming (PLP 11) Predicate Calculus Clocksin-Mellish Procedure Horn Clauses

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Logic for Computer Scientists

Propositional Resolution

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

CS 730/730W/830: Intro AI

Tecniche di Verifica. Introduction to Propositional Logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

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)

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Foundations of Artificial Intelligence

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Kecerdasan Buatan M. Ali Fauzi

A brief introduction to Logic. (slides from

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

3 Propositional Logic

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

First-Order Logic (FOL)

Math.3336: Discrete Mathematics. Propositional Equivalences

Predicate Logic: Sematics Part 1

6. Logical Inference

Reasoning with Quantified Boolean Formulas

Topic 1: Propositional logic

Inference Methods In Propositional Logic

Exercises 1 - Solutions

CSC165 Mathematical Expression and Reasoning for Computer Science

Semantics and Pragmatics of NLP

Warm-Up Problem. Is the following true or false? 1/35

Convert to clause form:

Propositional logic II.

CS 380: ARTIFICIAL INTELLIGENCE

Solutions to Sample Problems for Midterm

Compound Propositions

Logical Agent & Propositional Logic

ECE473 Lecture 15: Propositional Logic

Inference Methods In Propositional Logic

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

CSE 555 HW 5 SAMPLE SOLUTION. Question 1.

Inference in first-order logic

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 Equivalences I............................................ 3 1.1 Equivalences (II).................................... 4 2 Normal Forms............................................ 5 2.1 Conversion into CNF................................ 6 2.2 Exercise........................................... 7 2.3 Why Normal Forms?................................ 8 3 Tableau Calculus for PL................................... 9 3.1 Negation Normal Form.............................. 10 4 Equivalences: FOL........................................ 11 5 The Prenex Normal Form.................................. 12 5.1 Exercise........................................... 14 5.2 Tableau Calculus: FOL.............................. 15 5.3 Example........................................... 16 6 Summary: exercises........................................ 17 7 Key Concepts............................................. 18

1. Equivalences I How would you prove that the following equivalences hold? Commutativity φ ψ ψ φ φ ψ ψ φ φ ψ ψ φ Associativity (φ ψ) χ φ (ψ χ) (φ ψ) χ φ (ψ χ) Idempotence φ φ φ φ φ φ Absorption φ (φ ψ) φ φ (φ ψ) φ Distributivity φ (ψ χ) (φ ψ) (φ χ) φ (ψ χ) (φ ψ) (φ χ)

1.1. Equivalences (II) Tautology φ Unsatisfiability φ Negation φ φ φ φ Neutrality φ φ φ φ Double Negation φ φ De Morgan (φ ψ) φ ψ (φ ψ) φ ψ Implication φ ψ φ ψ

2. Normal Forms Conjunctive Normal Form (CNF) conjunction of disjunctions of literals }{{} : ni=1 ( m j=1 l i,j ) clauses E.g., (A B) (B C D) Disjunctive Normal Form (DNF) disjunction of conjunctions of literals }{{} : ni=1 ( m j=1 l i,j ) terms E.g., (A B) (A C) (A D) ( B C) ( B D) Literals are either atoms or negations of an atom.

2.1. Conversion into CNF How do we convert a formula into CNF? 1. Elimination of and by means of: A B (A B) (B A), A B A B 2. push inwards by means of (a) (A B) A B (De Morgan) (b) (A B) A B (De Morgan) (c) A A (double negation) 3. use the distributive law A (B C) (A B) (A C) to effect the conversation to CNF.

2.2. Exercise Convert the following formulas into CNF: 1. (P Q) (R (P Q)) 2. ( P ( Q R)) S)

2.3. Why Normal Forms? We can transform propositional formulas, in particular, we can construct their CNF and DNF. DNF tells us something as to whether a formula is satisfiable. If all disjuncts contain or complementary literals, then no model exists. Otherwise, the formula is satisfiable. But: CNF tells us something as to whether a formula is a tautology. If all clauses (= conjuncts) contain or complementary literals, then the formula is a tautology. Otherwise, the formula is falsifiable. the transformation into DNF or CNF is expensive (in time/space) it is only possible for finite sets of formulas

3. Tableau Calculus for PL Which rules do we need? φ ψ If a model satisfies a conjunction, φ then it also satisfies each of the ψ conjuncts φ ψ φ ψ If a model satisfies a disjunction, then it also satisfies one of the disjuncts. It is a non-deterministic rule, and it generates two alternative branches of the tableaux.

3.1. Negation Normal Form The given tableau calculus works only if the formula has been translated into Negation Normal Form, i.e., all the negations have been pushed inside. Example: Build a tableau for: (A (B C)) Build a tableau for its CNF: ( A ( B C))

4. Equivalences: FOL ( x. φ) ψ x. (φ ψ) if x not free in ψ ( x. φ) ψ x. (φ ψ) if x not free in ψ ( x. φ) ψ x. (φ ψ) if x not free in ψ ( x. φ) ψ x. (φ ψ) if x not free in ψ x. φ x. ψ x. (φ ψ) x. φ x. ψ x. (φ ψ) x. φ x. φ x. φ x. φ & propositional equivalences

5. The Prenex Normal Form Quantifier prefix + (quantifier free) matrix x 1 x 2 x 3... x n φ 1. Elimination of and by means of: A B (A B) (B A), (A B A B) 2. push inwards by means of (A B) A B (De Morgan) (A B) A B (De Morgan) A A (double negation) xa(x) x A(x) xa(x) x A(x)

3. rename bound variables, if necessary 4. pull quantifiers outwards 5. use the distributive law A (B C) (A B) (A C) to effect the conversation to CNF. Renaming of variables. Let φ[x/t] be the formula φ where all occurrences of x have been replaced by the term t.

5.1. Exercise Convert the following formulas into prenex normal forms: ( x.a(x)) ( x.b(x)) x( y( z(a(x, y, z) B(y)) ( x.c(x, z)))) x y(a(x, y, z) uc(x, u)) vc(x, v)) x(s(x) y(l(y) A(x, y)))

5.2. Tableau Calculus: FOL 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 tableaux. 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.

5.3. Example The above set of completion rules work only if the formula has been translated into Negation Normal Form, i.e., all the negations have been pushed inside. Build a tableau for the following formula: ( x. ( y. (P (x) Q(y)))) Build a tableau for its prenex normal form: x. ( y. (P (x) Q(y)))

6. Summary: exercises Take the result of the conversion of the formulas below and check by means of the tableau calculus whether they are satisfiable 1. (P Q) (R (P Q)) 2. ( P ( Q R)) S) 3. x y((a(x, y, z) uc(x, u)) vc(x, v)) 4. x(s(x) y(l(y) A(x, y)))

7. Key Concepts Interpretation, Model, Domain Satisfiability, etc.. Truth tables Tableaux In the mid-term there will be exercises about: 1. Entailment KB = φ in PL to be proved or refuted by means of truth tables. 2. Formalization of a simple argument in PL, and its solution by means of truth tables or tableaux 3. Evaluation of a given FOL formula in a domain/interpretation. 4. Entailment KB = φ in FOL to be proved by means of tableaux Send us questions/doubts by the Wednesday 13rd (20:00), we will discuss them in class on the 15th 08:30-09:30 before the mid-term (09:30-11:30).