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

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

First-Order Logic (FOL)

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Classical First-Order Logic

Predicate Logic: Sematics Part 1

AAA615: Formal Methods. Lecture 2 First-Order Logic

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

Classical First-Order Logic

CS156: The Calculus of Computation Zohar Manna Winter 2010

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

Introduction to Logic in Computer Science: Autumn 2006

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

Logic: Propositional Logic Truth Tables

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

Example. Lemma. Proof Sketch. 1 let A be a formula that expresses that node t is reachable from s

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

Lecture 13: Soundness, Completeness and Compactness

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

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

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

Predicate Logic - Semantic Tableau

03 Review of First-Order Logic

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

Logic: The Big Picture

Final Exam (100 points)

First Order Logic (FOL) 1 znj/dm2017

First Order Logic: Syntax and Semantics

Overview, cont. Overview, cont. Logistics. Optional Reference #1. Optional Reference #2. Workload and Grading

CS 514, Mathematics for Computer Science Mid-semester Exam, Autumn 2017 Department of Computer Science and Engineering IIT Guwahati

Abstract model theory for extensions of modal logic

Automated Reasoning Lecture 5: First-Order Logic

Predicate Logic. Andreas Klappenecker

0-1 Laws for Fragments of SOL

Exercises for the Logic Course

06 From Propositional to Predicate Logic


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

First-Order Predicate Logic. Basics

Mathematical Logics. 12. Soundness and Completeness of tableaux reasoning in first order logic. Luciano Serafini

The Classical Decision Problem

Herbrand Theorem, Equality, and Compactness

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 8: Procedures for First-Order Theories, Part 2

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

Exercises 1 - Solutions

Inference in first-order logic

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

Semantics and Pragmatics of NLP

Chapter 4: Computation tree logic

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

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

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

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Logic for Computer Scientists

CS 730/730W/830: Intro AI

Properties of Relational Logic

University of Aberdeen, Computing Science CS2013 Predicate Logic 4 Kees van Deemter

Discrete Mathematics

Announcements. CS311H: Discrete Mathematics. Introduction to First-Order Logic. A Motivating Example. Why First-Order Logic?

First-Order Logic. Chapter Overview Syntax

Predicate Calculus. CS 270 Math Foundations of Computer Science Jeremy Johnson

Chapter 7 Propositional Satisfiability Techniques

Undecidability of the validity problem

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

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

arxiv: v1 [cs.lo] 8 Jan 2013

Resolution: Motivation

Example ( x.(p(x) Q(x))) ( x.p(x) x.q(x)) premise. 2. ( x.(p(x) Q(x))) -elim, 1 3. ( x.p(x) x.q(x)) -elim, x. P(x) x.

Part I: Propositional Calculus

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Logic for Computer Scientists

Logic Part I: Classical Logic and Its Semantics

Introduction to Sets and Logic (MATH 1190)

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Chapter 7 Propositional Satisfiability Techniques

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

Lloyd-Topor Completion and General Stable Models

Propositional and Predicate Logic - XIII

2-4: The Use of Quantifiers

CS 730/830: Intro AI. 3 handouts: slides, asst 6, asst 7. Wheeler Ruml (UNH) Lecture 12, CS / 16. Reasoning.

Combinations of Theories for Decidable Fragments of First-order Logic

FINITE MODEL THEORY (MATH 285D, UCLA, WINTER 2017) LECTURE NOTES IN PROGRESS

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

Part 2: First-Order Logic

Predicate Calculus - Semantic Tableau (2/2) Moonzoo Kim CS Division of EECS Dept. KAIST

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)

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

Modal logics and their semantics

Quantifiers. Leonardo de Moura Microsoft Research

First Order Logic (FOL)

CMPS 217 Logic in Computer Science. Lecture #17

Propositional Reasoning

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

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

Propositional and Predicate Logic. jean/gbooks/logic.html

Theory of Computation

PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2

Handout Proof Methods in Computer Science

Friendly Logics, Fall 2015, Lecture Notes 1

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 7: Procedures for First-Order Theories, Part 1

Transcription:

Overview CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL Agenda for today: Semantic argument method for proving FOL validity Işıl Dillig Important properties of FOL Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 1/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 2/30 Motivation for semantic argument method Semantic Argument Method to Prove Validity So far, defined what it means for FOL formula to be valid, but how to prove validity? Will extend semantic argument method from PL to FOL Recall: In propositional logic, satisfiability and validity are dual concepts: F is valid iff F is unsatisfiable Since this duality also holds in FOL, we ll focus on validity Recall: Semantic argument method is a proof by contradiction. Basic idea: Assume that F is not valid, i.e., there exists some S, σ such that S, σ = F. Then, apply proof rules. If can derive contradiction on every branch of proof, F is valid. All proof rules from prop. logic carry over to first-order logic only focus on new rules Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 3/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 4/30 Universal elimination I Universal Elimation Rule II Universal elimination I: U, I, σ = x.f U, I, σ[x o] = F (for any o U ) Example: Suppose U, I, σ = x.hates(jack, x) Using the above proof rule, we can conclude: U, I, σ[x I (jack)] = hates(jack, x) Universal elimination II: U, I, σ = x.f (for a fresh o U ) U, I, σ[x o] = F By a fresh object constant, we mean an object that has not been previously used in the proof Why do we have this restriction? Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 5/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 6/30 1

Existential Elimination Rule 1 Existential Elimination Rule II Existential elimination I: U, I, σ = x.f (for a fresh o U ) U, I, σ[x o] = F Again, fresh means an object that has not been used before Existantial elimination II: U, I, σ = x.f (for any o U ) U, I, σ[x o] = F If U, I, σ do not entail x.f, this means there does not exist any object for which F holds Thus, no matter what object x maps to, it still won t entail F Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 7/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 8/30 Contradiction rule Finally, we need a rule for deriving for contradicitons Contradiction rule: U, I, σ 1 = p(s 1,..., s n ) U, I, σ 2 = p(t 1,..., t n ) (I, σ 1 )(s i ) = (I, σ 2 )(t i ) for all i [1, n] σ 1 = σ[ x o 1 ] σ 2 = σ[ y o 2 ] U, I, σ = Example 1: Proving Validity Prove the validity of formula: F : ( x.p(x)) ( y.p(y)) We start by assuming it is not valid, i.e., there exists some S, σ such that S, σ = F. Example: Suppose we have S, {x a} = p(x) and S, {y a} = p(y) The proof rule for contradiction allows us to derive Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 9/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 10/30 Example 2 Is this formula valid? F : ( x. (p(x) q(x))) ( x.p(x) x.q(x)) Example 2, cont Let s now prove validity using semantic argument method F : ( x. (p(x) q(x))) ( x.p(x) x.q(x)) Let s assume there is some S, σ that does not entail φ, and derive contradiction on all branches Informal argument: Suppose x.(p(x) q(x)) holds This means either q(x) for all objects (i.e., x.q(x)) Or if q(x) does not hold for some object o, then p(x) must hold for that object o (i.e, x.p(x)) Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 11/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 12/30 2

Example 3 Example 4 Is this formula valid? F : ( x.p(x, x)) ( x. y.p(x, y)) How do you prove it s not valid? Falsifying interpretation: Is the following formula valid? ( x.(p(x) q(x))) ( x.p(x)) ( x.q(x)) Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 13/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 14/30 Example 4, cont Let s prove validity using semantic argument method: F : ( x.(p(x) q(x))) ( x.p(x)) ( x.q(x)) Assume there is a S, σ such that S, σ = F Soundness and Completeness of Proof Rules The proof rules we used are sound and complete. Soundness: If every branch of semantic argument proof derives a contradiction, then F is indeed valid. Translation: The proof system does not reach wrong conclusions Completeness: If formula F is valid, then there exists a finite-length proof in which every branch derives Translation: There are no valid first-order formulas which we cannot prove to be valid using our proof rules. Proofs can be found in Section 2.7 of COC Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 15/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 16/30 Important Properties of First Order Logic Decidable Fragments of First-Order Logic Really important result: It is undecidable whether a first-order formula is valid. (Church and Turing) However, validity in FOL is semi-decidable Thus, there exists an algorithm that always terminates and says if any arbitrary FOL formula is valid Although full-first order logic is not decidable, there are fragments of FOL that are decidable. A fragment of FOL is a syntactially restricted subset of full FOL: e.g., no functions, or only universal quantifiers, etc. Some decidable fragments: But no algorithm is guaranteed to terminate if the FOL formula is not valid Homework walks you through the undecidability proof via reduction to PCP Quantifier-free first order logic Monadic first-order logic Bernays-Schönfinkel class Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 17/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 18/30 3

Quantifier-Free Fragment of FOL Monadic First-Order Logic Monadic FOL: all predicates are monadic (i.e., arity 1) The quantifier-free fragment of FOL is the syntactically restricted subset of FOL where formulas do not contain universal or existential quantifiers. Determining validity and satisfiability in quantifier-free FOL is decidable (NP-complete) It can be reduced to boolean SAT using a technique called Ackermannization. Result: Monadic first-order logic is decidable Decidability follows from the Lowenheim-Skolem theorem which states a small-model property If S is a satisfiable monadic sentence, it is true for some structure whose universe contains 2 k r elements (k= # predicates; r = # variables) However, if we add even a single binary predicate, the logic becomes undecidable. Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 19/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 20/30 Bernays-Schönfinkel Class More on EPR The Bernays-Schönfinkel class is a fragment of FOL where: 1. there are no function constants, 2. only formulas of the form: x 1,..., x n. y 1,..., y m.f (x 1,..., x n, y 1,... y m ) Result: The Bernays-Schönfinkel fragment of FOL is decidable Bernays-Schönfinkel is called Effectively Propositional because it can be reduced to SAT Reduction: Replace existentially quantified variables with fresh constants and ground universally quantified variables by all combination of constants Deciding satisfiability in EPR and Monadic FOL is NEXPTIME-complete This class is also known as Effectively Propositional Logic (EPR). Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 21/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 22/30 Compactness of First-Order Logic Consequences of Compactness Another important property of FOL is compactness. A logic is called compact if an infinite set of sentences Γ is satisfiable iff every finite subset of Γ is satisfiable. Theorem (due to Gödel): First-order logic is compact. Proof of compactness might look like a useless property, but it has very interesting consequences! Compactness can be used to show that a variety of interesting properties are not expressible in first-order logic. For instance, we can use compactness theorem to show that transitive closure is not expressible in first order logic. Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 23/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 24/30 4

Transitive Closure Given a directed graph G = (V, E), the transitive closure of G is defined as the graph G = (V, E ) where: E = {(n, n ) if there is a path from vertex n to n } Observe: A binary predicate p(t, t ) be viewed as a graph containing an edge from node t to t Thus, the concept of transitive closure applies to binary predicates as well A binary predicate T is the transitive closure of predicate p if t 0, t n T iff there exists some sequence t 0, t 1..., t n such that t i, t i+1 p Expressing Transitive Closure in FOL At first glance, it looks like transitive closure T of binary relation p is expressible in FOL: x, z.(t (x, z) (p(x, z) y.p(x, y) T (y, z))) But this formula does not describe transitive closure at all! To see why, consider U = N, p is equality predicate, and T is relation that is true for any number x, y. Clearly, this T is not the transitive closure of equality, but this structure is actually a model of the formula. Thus, the formula above is not a definition of transitive closure at all! Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 25/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 26/30 Transitive Closure and FOL In fact, no matter how hard we try to correct this definition, we cannot express transitive closure in FOL Will use compactness theorem to show that transitive closure is not expressible in FOL Compactness: An infinite set of sentences Γ is satisfiable iff every finite subset of Γ is satisfiable. For contradiction, suppose transitive closure is expressible in first order logic Proof I Ψ n (a, b) encode the proposition: there is no path of length n from a to b. In particular, Ψ 1 = p(a, b) Similarly, Ψ n = x 1,.... x n 1.(p(a, x 1 ) p(x 1, x 2 )... p(x n 1, b)) Let Γ be a (possibly infinite) set of sentences expressing that T is the transitive closure of p. Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 27/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 28/30 Proof II Recall: Γ is a set of propositions encoding T is transitive closure of p. Now, construct Γ as follows: Γ = Γ {T (a, b), Ψ 1, Ψ 2, Ψ 3,..., } Observe: Γ is unsatisfiable because: 1. Since Γ encodes that T is transitive closure of p, T (a, b) says there is some path from a to b 2. The infinite set of propositions Ψ 1, Ψ 2,... say that there is no path of any length from a to b Proof III Now, consider any finite subset of Γ : Γ = Γ {T (a, b), Ψ 1, Ψ 2, Ψ 3,..., } Clearly, any finite subset does not contain Ψ i for some i. Observe: This finite subset is satisfied by a model where there is a path of length i from a to b Thus, every finite subset of Γ is satisfiable. By the compactness theorem, this would imply Γ is also satisfiable But we just showed that Γ is unsatisfiable! Thus, transitive closure cannot be expressed in FOL! Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 29/30 Işıl Dillig, CS389L: Automated Logical Reasoning Lecture 7: Validity Proofs and Properties of FOL 30/30 5