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

Similar documents
1 Introduction to Predicate Resolution

Exercises 1 - Solutions

Logic: First Order Logic

Predicate Calculus - Syntax

Resolution: Motivation

Normal Forms for First-Order Logic

COMP9414: Artificial Intelligence First-Order Logic

Some Rewriting Systems as a Background of Proving Methods

Logic Part I: Classical Logic and Its Semantics

AAA615: Formal Methods. Lecture 2 First-Order Logic

CHAPTER 10. Predicate Automated Proof Systems

Predicate Logic: Sematics Part 1

Outline. Logic. Definition. Theorem (Gödel s Completeness Theorem) Summary of Previous Week. Undecidability. Unification

Disjunction/Conjunction Normal Form

Discrete Mathematics and Its Applications

Normal Forms Note: all ppts about normal forms are skipped.

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

The predicate calculus is complete

First-Order Logic. Resolution

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

α-formulas β-formulas

Convert to clause form:

A DARK GREY P O N T, with a Switch Tail, and a small Star on the Forehead. Any

INF3170 / INF4171 Notes on Resolution


Computational Logic. Recall of First-Order Logic. Damiano Zanardini

Part 2: First-Order Logic

COMP4418: Knowledge Representation and Reasoning First-Order Logic

software design & management Gachon University Chulyun Kim

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-4: The Use of Quantifiers

Two Posts to Fill On School Board

Propositional Resolution

Clausal Presentation of Theories in Deduction Modulo

Predicate Logic. Bow-Yaw Wang. Institute of Information Science Academia Sinica, Taiwan. November 22, 2017

LOWELL WEEKLY JOURNAL

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

Informal Statement Calculus

Logic for Computer Scientists

Introduction to Sets and Logic (MATH 1190)

Logic for Computer Scientists

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

New Techniques in Clausal Form Generation

Reasoning with Quantified Boolean Formulas

06 From Propositional to Predicate Logic

Handout Proof Methods in Computer Science

OWELL WEEKLY JOURNAL

CSC384: Intro to Artificial Intelligence Knowledge Representation II. Required Readings: 9.1, 9.2, and 9.5 Announcements:

02 Propositional Logic

Logic for Computer Scientists

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

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

README - Syntax. Skolemization. Skolemization - Example 1. Skolemization - Example 1. Skolemization - Example 1. Skolemization - Example 2

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

First-Order Logic (FOL)

Introduction to Logic

Propositional and Predicate Logic - II

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

First order logic. Example The deduction of statements: This reasoning is intuitively correct. Every man is mortal. Since Ade is a man, he is mortal.

Quantifiers Here is a (true) statement about real numbers: Every real number is either rational or irrational.

First order Logic ( Predicate Logic) and Methods of Proof

Automated Reasoning in First-Order Logic

Logic: First Order Logic (Part I)

Formal (Natural) Deduction for Predicate Calculus

Computational Logic Automated Deduction Fundamentals

CS156: The Calculus of Computation Zohar Manna Winter 2010

Proseminar on Semantic Theory Fall 2013 Ling 720 First Order (Predicate) Logic: Syntax and Natural Deduction 1

Agenda Artificial Intelligence. Let s Talk About the Wumpus Instead? Let s Talk About Blocks, Baby...


Incomplete version for students of easllc2012 only. 6.6 The Model Existence Game 99

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

Propositional and Predicate Logic - V

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

Resolution for Predicate Logic

Resolution for Predicate Logic

Solutions to Homework I (1.1)

arxiv: v1 [cs.lo] 1 Sep 2017

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

3 Propositional Logic

Logic and Proof. On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes!

Tecniche di Verifica. Introduction to Propositional Logic

MODEL THEORY FOR ALGEBRAIC GEOMETRY

CSE Discrete Structures

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

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes! 26-Aug-2011 MA

Discrete Mathematics

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Herbrand Theorem, Equality, and Compactness

Automated Reasoning Lecture 5: First-Order Logic

Predicate Logic - Deductive Systems

Negation introduction

First-Order Theorem Proving and Vampire

Predicate Logic - Semantic Tableau

Predicate Logic. Predicates. Math 173 February 9, 2010

Propositional Logic. Premises: If Jack knows Jill, then Jill knows Jack. Jack knows Jill. Conclusion: Is it the case that Jill knows Jack?

arxiv: v2 [cs.lo] 22 Nov 2017

Transcription:

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

Revision: CNF and DNF of propositional formulae A literal is a propositional variable or its negation. An elementary disjunction is a disjunction of literals. An elementary conjunction is a conjunction of literals. A disjunctive normal form (DNF) is a disjunction of elementary conjunctions. A conjunctive normal form (CNF) is a conjunction of elementary disjunctions.

Conjunctive and disjunctive normal forms of first-order formulae An open first-order formula is in disjunctive normal form (resp., conjunctive normal form) if it is a first-order instance of a propositional formula in DNF (resp. CNF), obtained by uniform substitution of atomic formulae for propositional variables. Examples: ( P(x) Q(x, y)) (P(x) R(y)) is in CNF, as it is a first-order instance of ( p q) (p r); (P(x) Q(x, y) R(y)) P(x) is in DNF, as it is a first-order instance of ( p q r) p. and are not in either CNF or DNF. xp(x) Q(x, y) P(x) (Q(x, y) R(y)) R(y)

Prenex normal forms A first-order formula Q 1 x 1...Q n x n A, where Q 1,..., Q n are quantifiers and A is an open formula, is in a prenex form. The quantifier string Q 1 x 1...Q n x n is called the prefix, and the formula A is the matrix of the prenex form. Examples: is in prenex form, while x y(x > 0 (y > 0 x = y 2 )) x(x = 0) y(y < 0) and are not in prenex form. x(x > 0 y(y > 0 x = y 2 ))

Prenex conjunctive and disjunctive normal forms If A is in DNF then Q 1 x 1...Q n x n A is in prenex disjunctive normal form (PDNF); if A is in CNF then Q 1 x 1...Q n x n A is in prenex conjunctive normal form (PCNF). Examples: is both in PDNF and in PCNF. is in PDNF, but not in PCNF. x y( x > 0 y > 0) x y( x > 0 (y > 0 x = y 2 )) x y( P(x) (Q(x, y) R(y)) R(y)) is neither in PCNF nor in PDNF.

Transformation to prenex normal forms THEOREM: Every first-order formula is equivalent to a formula in a prenex disjunctive normal form (PDNF) and to a formula in a prenex conjunctive normal form (PCNF). Here is an algorithmic procedure: 1. Eliminate all occurrences of and. 2. Import all negations inside all other logical connectives. 3. Use the equivalences: (a) xp xq x(p Q), (b) xp xq x(p Q), to pull some quantifiers outwards and, after renaming one of the bound variables if necessary.

Transformation to prenex normal forms cont d 4. To pull all quantifiers in front of the formula and thus transform it into a prenex form, use the following equivalences, where x is not free in Q: (c) (d) (e) (f) xp Q Q xp x(p Q), xp Q Q xp x(p Q), xp Q Q xp x(p Q), xp Q Q xp x(p Q), If necessary, use renaming in order to apply these. Example: Better: xp(x) xq(x) x(p(x) xq(x)) x(p(x) yq(y)) x y(p(x) Q(y)). xp(x) xq(x) x( xp(x) Q(x)) x( yp(y) Q(x)) x y(p(y) Q(x)). 5. Finally, transform the matrix in a DNF or CNF, just like a propositional formula.

Transformation to prenex normal forms: example A = z( xq(x, z) xp(x)) ( xp(x) x zq(z, x)). 1. Eliminating : A z( xq(x, z) xp(x)) ( xp(x) x zq(z, x)) 2. Importing the negation: A z( xq(x, z) xp(x)) ( xp(x) x zq(z, x)) z( x Q(x, z) x P(x)) ( xp(x) x z Q(z, x)). 3. Using the equivalences (a) and (b): A z x( Q(x, z) P(x)) x(p(x) z Q(z, x)). 4. Renaming: A z x( Q(x, z) P(x)) y(p(y) w Q(w, y)). 5. Using the equivalences (c)-(f) to pull the quantifiers in front: A z x y w(( Q(x, z) P(x)) P(y) Q(w, y)). 6. The resulting formula is in a prenex DNF. For a prenex CNF we have to distribute the over : A z x y w(( Q(x, z) P(y) Q(w, y)) ( P(x) P(y) Q(w, y))).

Skolemization I: Skolem constants Skolemization: procedure for systematic elimination of the existential quantifiers in a first-order formula in a prenex form, by introducing new constant and functional symbols, called Skolem constants and Skolem functions, in the formula. Simple case: the result of Skolemization of the formula x y za is the formula y za[c/x], where c is a new (Skolem) constant. For instance, the result of Skolemization of the formula x y z(p(x, y) Q(x, z)) is y z(p(c, y) Q(c, z)). More generally, the result of Skolemization of the formula x 1 x k y 1 y n A is y 1 y n A[c 1 /x 1,..., c k /x k ], where c 1,..., c k are new (Skolem) constants. Note that the resulting formula is not equivalent to the original one, but is equally satisfiable with it.

Skolemization II: Skolem functions The result of Skolemization of y zp(y, z) is yp(y, f (y)), where f is a new unary function, called Skolem function. More generally, the result of Skolemization of y x 1 x k y 1 y n A is y y 1 y n A[f 1 (y)/x 1,..., f k (y)/x k ], where f 1,..., f k are new Skolem functions. The result of Skolemization of is x y z ua(x, y, z, u) x za[x, f (x)/y, z, g(x, z)/u), where f is a new unary Skolem function and g is a new binary Skolem function.

Skolemization III: the general case In the general case of Skolemization, the existential quantifiers are eliminated one by one, from left to right, by introducing at every step a Skolem function depending on all existentially quantified variables to the left of the existential quantifier that is being eliminated: is transformed to x 1... x k ya(x 1,..., x k, y,...) x 1... x k A(x 1,..., x k, y,...)[f (x 1,..., x k )/y] where f is a new k-ary Skolem function. Thus, eventually, all existential quantifiers are eliminated. Again, the resulting formula after Skolemization is generally not equivalent to the original one, but is equally satisfiable with it.

Clausal form of first-order formulae A literal is an atomic formula or a negation of an atomic formula. Examples: P(x), P(f (c, g(y))), Q (f (x, g(c)), g(g(g(y)))). A clause is a set of literals. Example: {P(x), P(f (c, g(y))), Q(f (x, g(c)), g(g(g(y))))}. A clausal form is a set of clauses. Example: { {P(x)}, { P(f (c)), Q(g(x, x), y)}, { P(f (y)), P(f (c)), Q(y, f (x))} }.

The logical meaning of first-order clauses All variables in a clause are assumed to be universally quantified. Thus, a clause represents the universal closure of the disjunction of literals in it. Example: {P(x), P(f (c, g(y))), Q(f (x, g(c)), g(g(g(y))))} represents ( ) x y P(x) P(f (c, g(y))) Q(f (x, g(c)), g(g(g(y)))) The universal quantifiers will hereafter be omitted.

The logical meaning of sets of first-order clauses A set of clauses represents the conjunction of the (formulae represented by the) clauses contained in it. Example: the set { } {P(x)}, { P(f (c)), Q(x, y)}, { P(f (y)), Q(y, f (x))} represents the formula xp(x) x y ( P(f (c)) Q(x, y) ) x y ( P(f (y)) Q(y, f (x)) ). Hereafter we will assume that no two clauses in a clausal form share common variables, which can always be achieved by means of renaming. Thus, the clausal form above can be re-written as: { } {P(x)}, { P(f (c)), Q(x 1, y 1)}, { P(f (y 2)), Q(y 2, f (x 2))} representing the formula xp(x) x 1 y 1 ( P(f (c)) Q(x1, y 1) ) x 2 y 2 ( P(f (y2)) Q(y 2, f (x 2)) ). Because distributes over, after the renaming the clausal form also represent the universal closure of the conjunction of the disjunctions represented by the clauses contained in it: x x 1 y 1 x 2 y 2 (P(x) ( P(f (c)) Q(x 1, y 1) ) ( P(f (y 2)) Q(y 2, f (x 2)) )).

Transformation of first-order formulae to clausal form Theorem: Every set of first-order formulae {A 1,..., A n } can be transformed to a set of clauses {C 1,..., C k } where no two clauses share common variables, such that {A 1,..., A n } is equally satisfiable with the universal closure (C 1 C k ) of the conjunction of all clauses, each taken as disjunction of its literals. The algorithm applies to each formula A {A 1,..., A n } as follows: 1. Transform A to a prenex CNF. 2. Eliminate all existential quantifiers by introducing Skolem constants or functions. 3. Remove all universal quantifiers. 4. Write the matrix (which is in CNF) as a set of clauses. Finally, apply in the union of all sets of clauses produced as above renaming of variables occurring in more than one clause.