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

Similar documents
Warm-Up Problem. Write a Resolution Proof for. Res 1/32

Warm-Up Problem. Let be a Predicate logic formula and a term. Using the fact that. (which can be proven by structural induction) show that 1/26

Propositional Logic: Equivalence

Deductive Systems. Lecture - 3

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Logic Language

Propositional Reasoning

Comp487/587 - Boolean Formulas

Lecture 9: The Splitting Method for SAT

Propositional Logic: Models and Proofs

Part 1: Propositional Logic

LOGIC PROPOSITIONAL REASONING

Propositional Logic: Evaluating the Formulas

Advanced Topics in LP and FP

Inference in Propositional Logic

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

Logic: Propositional Logic (Part I)

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

Propositional Equivalence

Learning Goals of CS245 Logic and Computation

Supplementary exercises in propositional logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Propositional logic. Programming and Modal Logic

Conjunctive Normal Form and SAT

Topic 1: Propositional logic

Propositional Logic: Methods of Proof (Part II)

Lecture Notes on SAT Solvers & DPLL

Formal Verification Methods 1: Propositional Logic

6. Logical Inference

Propositional logic. Programming and Modal Logic

Predicate Logic: Introduction and Translations

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

Language of Propositional Logic

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 15 Propositional Calculus (PC)

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

Propositional Logic: Semantics

CS156: The Calculus of Computation

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Conjunctive Normal Form and SAT

Critical Reading of Optimization Methods for Logical Inference [1]

Propositional Logic: Methods of Proof. Chapter 7, Part II

Section 1.1: Logical Form and Logical Equivalence

Overview. I Review of natural deduction. I Soundness and completeness. I Semantics of propositional formulas. I Soundness proof. I Completeness proof.

Foundations of Artificial Intelligence

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Warm-Up Problem. Please fill out your Teaching Evaluation Survey! Please comment on the warm-up problems if you haven t filled in your survey yet.

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Conjunctive Normal Form and SAT

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

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

INF3170 / INF4171 Notes on Resolution

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

Propositional logic II.

Logical Agents (I) Instructor: Tsung-Che Chiang

Predicate Logic: Semantics

Propositional Logic: Methods of Proof (Part II)

3 Propositional Logic

Logic and Inferences

Introduction to Metalogic

Logical agents. Chapter 7. Chapter 7 1

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Tecniche di Verifica. Introduction to Propositional Logic

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

cis32-ai lecture # 18 mon-3-apr-2006

Logical Agent & Propositional Logic

Logic, Sets, and Proofs

CSE507. Introduction. Computer-Aided Reasoning for Software. Emina Torlak courses.cs.washington.edu/courses/cse507/17wi/

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

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

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Knowledge based Agents

3 The Semantics of the Propositional Calculus

Decision Procedures for Satisfiability and Validity in Propositional Logic

Normal Forms of Propositional Logic

Inference Methods In Propositional Logic

Propositional and Predicate Logic - V

02 Propositional Logic

A brief introduction to Logic. (slides from

KE/Tableaux. What is it for?

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Natural Deduction for Propositional Logic

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

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

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

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

Intelligent Agents. Pınar Yolum Utrecht University

Propositional Resolution Introduction

Logic for Computer Science - Week 4 Natural Deduction

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

SAT Solvers: Theory and Practice

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

CSC Discrete Math I, Spring Propositional Logic

Truth-Functional Logic

Classical Propositional Logic

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

AI Programming CS S-09 Knowledge Representation

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

1 Propositional Logic

Transcription:

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

Propositional Logic: Resolution Carmen Bruni Lecture 6 Based on work by J Buss, A Gao, L Kari, A Lubiw, B Bonakdarpour, D Maftuleac, C Roberts, R Trefler, and P Van Beek 2/35

Conjunctive normal form (CNF): Conjunctive Normal Form A literal is a (propositional) variable or the negation of a variable A clause is a disjunction of literals (literals connected by ) A formula is in conjunctive normal form if it is a conjunction of clauses In other words, a formula is in CNF if and only if its only connectives are, and/or, applies only to variables, and applies only to subformulas with no occurrence of For CNF Formulas, it is usually easier to read by dropping brackets and only using them around clauses and the whole formula (possible by associativity since we re only dealing with and binary connectives and only care up to logical equivalence): 3/35

CNF examples Some CNF formulas: (Only one clause) (Three singleton clauses) With simpler bracketing: (Only one clause) (Three singleton clauses) 4/35

CNF examples Some formulas not in CNF: ( applied to ) ( applied to ) ( applied to ) (Uses ) 5/35

Converting to CNF 1 Eliminate implication and equivalence Replace by Replace by (Now only, and appear as connectives) 2 Apply De Morgan s and double-negation laws as often as possible Replace by Replace by Replace by (Now negation only occurs in literals) 3 Transform into a conjunction of clauses using distributivity Replace by (One could stop here, but ) 4 Simplify using idempotence, contradiction, excluded middle and Simplification I & II 6/35

Practice Show that the CNF of is 7/35

Working with CNF Formulas In a clause, there is no need to have any variable twice [Why?] Also, the order of the literals in the clause does not matter Thus we can think of a clause as simply a set of literals Similarly, in a CNF formula, no clause [set] need appear more than once, and the order of clauses does not matter Thus we can think of a CNF formula as simply a set of clauses For example, the formula can be described by the set of clauses, and We shall use these observations in our next topic, Resolution 8/35

What Is a Proof? A proof is a formal demonstration that a statement is true A proof is generally syntactic, rather than semantic Generically, a proof consists of a sequence of formulas Inference rules justify subsequent lines of the proof which are inferred by the previous lines Notions of Proof 9/35

Inference Rules In general, an inference rule is written as That is, given,,,, we can infer Examples of possible rules (remember rules are syntactic NOT semantic!): A kind of definition of Rules need not be equivalences Notions of Proof 10/35

Notation We notate there is a proof with premises and conclusion by In this course, we are doing two types of proof systems: Resolution and Natural Deduction These will be denoted by Res and ND Notions of Proof 11/35

Overview of Resolution Resolution is one of the most widely used systems for computer-aided proofs It has two distinctive features It applies only to formulas in Conjunctive Normal Form Thus we do some preliminary work before starting an actual proof It is used to prove contradictions That is, a proof aims to conclude a special contradiction formula For this reason, Resolution is sometimes called a refutation system Resolution 12/35

A Note and Warning In CNF, we treat as a clause containing no literals, ie, the set Since it contains no true literal, it is false Be forewarned however that this notation only makes sense when dealing with CNF formulas In some sense, we really should have a symbol like Res but we won t do this Just keep this slide in mind if you start replacing with when not dealing with CNF formulas Resolution 13/35

The Resolution System and Rule The Resolution inference rule: for any Propositional variable and formulas and Special Cases: Unit resolution: Contradiction: Resolution is a refutation system; a proof is finished when one derives a contradiction Remember: proof systems are syntactic NOT semantic! In this case, the original premises are refuted Resolution 14/35

Example of Using Resolution To prove: Res 1 premise 2 premise 3 premise Consider lines 1 and 3 We have the formulas (1) and (3) Apply unit resolution, yielding the formula Resolution 15/35

Example of Using Resolution To prove: Res 1 premise 2 premise 3 premise 4 1, 3 Consider lines 1 and 3 We have the formulas (1) and (3) Apply unit resolution, yielding the formula We have the formulas (2) and (4) Apply the contradiction rule, yielding Resolution 15/35

Example of Using Resolution To prove: Res 1 premise 2 premise 3 premise 4 1, 3 5 2, 4 Consider lines 1 and 3 We have the formulas (1) and (3) Apply unit resolution, yielding the formula We have the formulas (2) and (4) Apply the contradiction rule, yielding Done! Resolution 15/35

Resolution Using Set Notation In a Resolution proof, we consider only CNF formulas Each step of the proof produces one clause from two previous clauses Implicitly, all clauses together can be considered a single CNF formula (join the clauses by s) Often, one writes clauses as sets That is, the formula has the set of clauses which become the three sets of literals and Set notation works due to associativity, commutativity and idempotency Resolution 16/35

Set-Notation Example Expressed using the set notation, the previous example becomes 1 premise 2 premise 3 premise 4 1, 3 5 2, 4 (Note that and are the same thing) Resolution 17/35

Preparing for a Resolution Proof To use Resolution successfully, we must account for two features Resolution only yields contradictions Rather than proving Res, prove Res instead The resolution rule only applies to disjunctions ( ) Before applying resolution, first convert each formula to CNF, and separate all formulas at the s Resolution 18/35

Resolution Example II To prove: Res Preliminary step 1: move the conclusion to the premises, negating it This gives premises Resolution 19/35

Resolution Example II To prove: Res Preliminary step 1: move the conclusion to the premises, negating it This gives premises Preliminary step 2: Convert the premises to CNF Resolution 19/35

To prove: Res Resolution Example II Preliminary step 1: move the conclusion to the premises, negating it This gives premises Preliminary step 2: Convert the premises to CNF Step 3: Write down the list of premises 1 premise 2 premise 3 premise (from negated goal) and then do the actual resolution, as above Resolution 19/35

The Resolution Proof Procedure To prove from, via a Resolution refutation: 1 Convert each formula in to CNF 2 Convert to CNF 3 Split the CNF formulas at the s, yielding a set of clauses 4 From the resulting set of clauses, keep applying the resolution inference rule until either: The empty clause results In this case, is proven from The rule can no longer be applied to give a new formula In this case, cannot be proven from Resolution 20/35

Example: Resolution To show: Res Resolution 21/35

Example: Resolution To show: Res Convert each premise formula to CNF We get and Convert the negation of the goal formula to CNF: Replacing the yields ; then De Morgan yields Splitting the yields four clauses:,, and Resolution 21/35

Example, cont d Now we can make inferences, starting from our premises 1 premise 2 premise 3 premise (from negated conclusion) 4 premise (from negated conclusion) Resolution 22/35

Example, cont d Now we can make inferences, starting from our premises 1 premise 2 premise 3 premise (from negated conclusion) 4 premise (from negated conclusion) 5 1, 3 (variable ) Resolution 22/35

Example, cont d Now we can make inferences, starting from our premises 1 premise 2 premise 3 premise (from negated conclusion) 4 premise (from negated conclusion) 5 1, 3 (variable ) 6 2, 5 (variable ) Resolution 22/35

Example, cont d Now we can make inferences, starting from our premises 1 premise 2 premise 3 premise (from negated conclusion) 4 premise (from negated conclusion) 5 1, 3 (variable ) 6 2, 5 (variable ) 7 4, 6 (variable ) Refutation complete! Resolution 22/35

Questions About Proofs Given a sequence of formulas, is it a proof? Determined by examining the sequence, formula by formula If the sequence always follows the rules, it is a proof; if it ever does not, then it is not a proof Why might we want a proof? For some (carefully constructed) proof systems, the existence of a proof implies that the conclusion is a logical consequence of the premises Such a system is called sound If is a sound proof system, S implies Soundness and Completeness of Resolution 23/35

Resolution Is Sound For resolution to be meaningful, we need the following Theorem Suppose that Res ; that is, there is a resolution refutation with premises and conclusion Then the set is unsatisfiable (contradictory) That is, if Res, then is a contradiction Therefore, In other words, the Resolution proof system is sound (If we prove something, it is true) We prove the theorem by induction on the length of the refutation Soundness and Completeness of Resolution 24/35

Soundness: The central argument Claim: Suppose that a set is satisfiable Let be a formula obtained from by one use of the resolution inference rule Then the set is satisfiable Proof: Let valuation satisfy ; that is, T for each Let be, obtained by resolving and Case I: F Since T, we must have T Thus T Case II: T Since T, we must have T Thus T In either of the two possible cases, we have T, as claimed Soundness and Completeness of Resolution 25/35

The Claim Implies the Theorem Using induction on, the previous claim implies Claim II: Suppose that the set is satisfiable Let be a formula obtained from by uses of the resolution inference rule Then the set is satisfiable (The previous claim is the inductive step of this one) Therefore, if a set of premises leads to after any number of resolution steps, the set must be unsatisfiable since any set containing is unsatisfiable Thus Resolution is a sound refutation system, as required Soundness and Completeness of Resolution 26/35

Can Resolution Fail? In some cases, there may be no way to obtain, using any number of resolution steps What then? Definition A proof system is complete if every entailment has a proof; that is, if implies S Theorem Resolution is a complete refutation system for CNF formulas That is, if there is no proof of from a finite set of premises in CNF, then is satisfiable Soundness and Completeness of Resolution 27/35

Resolution Is Complete (Outline) Claim Suppose that a resolution proof reaches a dead end that is, no new clause can be obtained, and yet has not been derived Then the entire set of formulas (including the premises!) is satisfiable Proof (outline): We use induction again However, it is not an induction on the length of the proof, nor on the number of formulas Instead, we use induction on the number of variables present in the formulas Basis: there are no variables at all that is, the set of clauses is the empty set The empty set of clauses is satisfiable, by definition Soundness and Completeness of Resolution 28/35

Completeness Proof, part II Inductive hypothesis: The claim holds for sets having at most variables Consider a set of clauses using variables, from which no additional clause can be derived via the resolution rule Suppose that it does not contain Select any one variable, say, and separate the clauses into three sets: : the clauses that contain the literal : the clauses that contain the literal : the remaining clauses, which do not contain at all The remainder set has at most variables Thus the hypothesis applies: the set has a satisfying valuation Soundness and Completeness of Resolution 29/35

Completeness Proof, part III We have a valuation, on the variables other than, that satisfies set Case I: Every clause in, of the form, has T In this case, the set is already satisfied Define F, which additionally makes every clause in true Case II: has some clause with F In this case, set T; this satisfies every formula in What about a clause in? Consider the formula, obtained by resolution from and It must lie in ; thus T Thus also T, as required Thus the full set of clauses is satisfiable By induction, every set that cannot produce is satisfiable Soundness and Completeness of Resolution 30/35

Resolution Provides an Algorithm The resolution method yields an algorithm to determine whether a given formula, or set of formulas, is satisfiable or contradictory Convert to CNF (A well-specified series of steps) Form resolvents, until either is derived, or no more derivations are possible (Why must this eventually stop?) If is derived, the original formula/set is contradictory Otherwise, the preceding proof describes how to find a satisfying valuation Soundness and Completeness of Resolution 31/35

The Algorithm Can Be Very Slow The algorithm can be souped up in many ways Choosing a good order of doing resolution steps (It matters!) Sophisticated data structures, to handle large numbers of clauses Additional techniques: setting variables, learning, etc However, it still has limitations Theorem (Haken, 1985): There is a number such that For every, there is an unsatisfiable formula on variables (and about total literals) whose smallest resolution refutation contains more than steps Resolution is an exponential-time algorithm! (And you thought quadratic was bad ) Soundness and Completeness of Resolution 32/35

Resolution in Practice: Satisfiability (SAT) solvers Determining the satisfiability of a set of propositional formulas is a fundamental problem in computer science Examples: software and hardware verification automatic generation of test patterns planning scheduling many problems of practical importance can be formulated as determining the satisfiability of a set of formulas Soundness and Completeness of Resolution 33/35

Resolution in practice: SAT Solvers Modern SAT solvers can often solve hard real-world instances with over a million propositional variables and several million clauses Annual SAT competitions: http://wwwsatcompetitionorg/ Many are open source systems Currently, the best SAT solvers use backtracking search to find resolvable clauses Soundness and Completeness of Resolution 34/35

Satisfiability in Theory If a formula is satisfiable, then there is a short demonstration of that: simply give the valuation Anyone can easily check that it is correct The class of problems with this property is known as NP The class of problems for which one can find a solution efficiently is known as (For a precise definition, we need to define efficiently We won t, here) A Fundamental Question: Is NP? A partial answer: If SAT is in (by any algorithm), then NP Soundness and Completeness of Resolution 35/35