Resolution. Informatics 1 School of Informatics, University of Edinburgh



Similar documents
Logic in general. Inference rules and theorem proving

Logic in Computer Science: Logic Gates

CS510 Software Engineering

Boolean Algebra Part 1

Satisfiability Checking

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Switching Algebra and Logic Gates

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Introduction to Logic in Computer Science: Autumn 2006

Beyond Propositional Logic Lukasiewicz s System

Certamen 1 de Representación del Conocimiento

Lecture 7: NP-Complete Problems

Lecture 19: Introduction to NP-Completeness Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

CH3 Boolean Algebra (cont d)

3. Mathematical Induction

One last point: we started off this book by introducing another famously hard search problem:

Practice with Proofs

Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

Basic Proof Techniques

COMPUTER SCIENCE. Paper 1 (THEORY)

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

INTRODUCTORY SET THEORY

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

NP-Completeness and Cook s Theorem

Introduction. The Quine-McCluskey Method Handout 5 January 21, CSEE E6861y Prof. Steven Nowick

Handout #1: Mathematical Reasoning

Computational Logic and Cognitive Science: An Overview

CHAPTER 7 GENERAL PROOF SYSTEMS

Degrees of Truth: the formal logic of classical and quantum probabilities as well as fuzzy sets.

MATH10040 Chapter 2: Prime and relatively prime numbers

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Unit 3 Boolean Algebra (Continued)

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

The Classes P and NP

Generating models of a matched formula with a polynomial delay

Which Semantics for Neighbourhood Semantics?

Lecture 5 Principal Minors and the Hessian

Fundamentele Informatica II

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Pigeonhole Principle Solutions

Cartesian Products and Relations

6.080/6.089 GITCS Feb 12, Lecture 3

Updating Action Domain Descriptions

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

CSC 373: Algorithm Design and Analysis Lecture 16

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Quotient Rings and Field Extensions

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Gröbner Bases and their Applications

IAEA Training Course on Safety Assessment of NPPs to Assist Decision Making. System Analysis. Lecturer. Workshop Information IAEA Workshop

Boolean Algebra (cont d) UNIT 3 BOOLEAN ALGEBRA (CONT D) Guidelines for Multiplying Out and Factoring. Objectives. Iris Hui-Ru Jiang Spring 2010

Answer Key for California State Standards: Algebra I

each college c i C has a capacity q i - the maximum number of students it will admit

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

Lecture 8: Resolution theorem-proving

Section 12.6: Directional Derivatives and the Gradient Vector

Problem Set 7 Solutions

C H A P T E R. Logic Circuits

Database Design and Normal Forms

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Midterm Practice Problems

1. Prove that the empty set is a subset of every set.

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Invalidity in Predicate Logic

THE DIMENSION OF A VECTOR SPACE

Rational Exponents. Squaring both sides of the equation yields. and to be consistent, we must have

1 if 1 x 0 1 if 0 x 1

Lecture 17 : Equivalence and Order Relations DRAFT

Mathematical Induction

Clue Deduction: an introduction to satisfiability reasoning

Sample Induction Proofs

A SAT Based Scheduler for Tournament Schedules

Point and Interval Estimates

OHJ-2306 Introduction to Theoretical Computer Science, Fall

Jedd: A BDD-based Relational Extension of Java

Sudoku as a SAT Problem

Click on the links below to jump directly to the relevant section

Cosmological Arguments for the Existence of God S. Clarke

Lecture 16 : Relations and Functions DRAFT

Public Key Cryptography: RSA and Lots of Number Theory

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Testing LTL Formula Translation into Büchi Automata

Computational Methods for Database Repair by Signed Formulae

3.1 Solving Systems Using Tables and Graphs

Discrete Mathematics Problems

npsolver A SAT Based Solver for Optimization Problems

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

Summary. Operations on Fuzzy Sets. Zadeh s Definitions. Zadeh s Operations T-Norms S-Norms. Properties of Fuzzy Sets Fuzzy Measures

COMMUTATIVE RINGS. Definition: A domain is a commutative ring R that satisfies the cancellation law for multiplication:

THE PRODUCT SPAN OF A FINITE SUBSET OF A COMPLETELY BOUNDED ARTEX SPACE OVER A BI-MONOID

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Introduction. Appendix D Mathematical Induction D1

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Transcription:

Resolution In this lecture you will see how to convert the natural proof system of previous lectures into one with fewer operators and only one proof rule. You will see how this proof system can be used to solve the important Satisfiability problem. Along the way we discuss equivalences between expressions and normal forms. 1

Problem: Satisfiability Given a set of Boolean constraints, can they all be satisfied at once? This kind of problem arises, for example, in timetable scheduling Formalization Input: An expression in propositional logic Question: Is there an assignment of Boolean values to the variables for which the expression evaluates to true? 2

Examples Let φ = (x or y) and (not(x) or y) Setting x = true, y = true satisfies φ Let φ = (x or y) and (not(x) or y) and (not(y)) In this case, no assignment of truth values to variables makes formula true One way of seeing this is to use the truth table method But is there a more efficient algorithm for Satisfiability? 3

Some Equivalence Rules De Morgan's Laws not (x or y) = (not(x) and not(y)) not (x and y) = (not(x) or not(y)) Associativity Laws x or (y or z) = (x or y) or z x and (y and z) = (x and y) and z Commutativity Laws x or y = y or x x and y = y and x Idempotent laws x or x = x x and x = x Absorptive laws x or (x and y) = x = x and (x or y) Identity laws x or false = x x and true = x (Left) Distributivity laws x or (y and z) = (x or y) and (x or z) x and (y or z) = (x and y) or (x and z) (Right) Distributivity laws (x and y) or z = (x or z) and (y or z) (x or y) and z = (x and z) or (y and z) 4

Normal Forms It is not strictly necessary to use all the logical operators. For example: A B is equivalent to not(a) or B A B is equivalent to not(a and not(b)) A or B is equivalent to not(not(a) and not(b)) and so on. We can use this to convert any expression into An equivalent one with fewer operator types. 5

Conjunctive Normal Form (CNF) Any expression in our logic can be rewritten as a set of sets of propositions or their negations: [ [E1,E2, ],, [En, ] ] Equivalent to ( (E1 or E2 or ) and (En or ) ) For example: (a and not(b) c) and a and not(c) becomes [ [not(a),b,c], [a], [not(c)] ] 6

What s So Special About This? The order of expressions (like E1) in an or set doesn t matter [ [E1,E2, ],, [En, ] ] The order of sub-sets (like [E1,E2, ]) in the and set doesn t matter 7

Conversion to CNF (a and not(b) c) and a and not(c) P Q equivalent to not(p) or Q (not(a and not(b)) or c) and a and not(c) not(p and Q) equivalent to not(p) or not(q) (not(a) or not(not(b)) or c) and a and not(c) not(not(p)) equivalent to P (not(a) or b or c) and a and not(c) (P or ) and to [ [P, ], ] [ [not(a),b,c], [a], [not(c)] ] 8

Showing Inconsistency Suppose I have [ [a], [not(a),b], [not(b),not(c)] ] and I want to know if this is inconsistent with c [c] [not(b),not(c)] [not(b)] [not(a),b] [not(a)] [a] [ ] c and not(c) can t both be true not(b) and b can t both be true not(a) and a can t both be true Contradiction 9

Proof by Inconsistency To prove P from [ [E1,E2, ],, [En, ] ] show that [ [not(p)], [E1,E2, ],, [En, ] ] is inconsistent 10

A Resolution Proof To prove b from [ [not(a),b,c], [a], [not(c)] ] show that [ [not(b)], [not(a),b,c], [a], [not(c)] ] is inconsistent [not(b)] [not(a), c] [c] [ ] [not(a),b,c] [a] [not(c)] 11

One Proof Rule to Rule Them All Suppose we have already derived clauses C 1 and C 2, where C 1 contains the literal x and C 2 contains the literal not(x) Then we can derive the clause C 1 {x} U C 2 {not(x)} Goal: To derive the empty clause, i.e., the clause with no literals Clauses are inconsistent if and only if there is a way to derive empty clause 12

Problem: Satisfiability Is there a more efficient algorithm for Satisfiability than the truth table method? Truth table method requires building a truth table of size 2 n, where n is number of variables Idea: Use Resolution to try to prove that the input formula is inconsistent (unsatisfiable) 13

The Non-determinism Issue Resolution, as we have defined it, is not an algorithm There can be many options for which clauses to resolve at any point. Which to choose? Example: [[not(a),b], [not(b), c], [not(c),a]] In this case, every pair of clauses can be resolved 14

Davis-Putnam Algorithm for Resolution Choose an ordering of the variables (we will see how to do this with an example) For i = 1 to n do Stage i: Resolve all pairs of clauses such that one contains the i th variable negated, and the other contains the i th variable un-negated Formula is unsatisfiable precisely when the empty clause occurs at the end 15

An Example [[x,y], [x,z], [not(x), y,z], [not(z), y], [not[y]] 16

An Example [[x,y], [x,z], [not(x), y,z], [not(z), y], [not[y]] [[x,y], [x,y], [not(x), y], [not(y]] (Resolving on z) 17

An Example [[x,y], [x,z], [not(x), y,z], [not(z), y], [not[y]] [[x,y], [not(x), y], [not(y]] (Resolving on z) 18

An Example [[x,y], [x,z], [not(x), y,z], [not(z), y], [not[y]] [[x,y], [not(x), y], [not(y]] [[y], [not(y]] (Resolving on x) 19

An Example [[x,y], [x,z], [not(x), y,z], [not(z), y], [not[y]] [[x,y], [not(x), y], [not(y]] [[y], [not(y]] Unsatisfiable! [[]] 20

Another Example [[x,y], [x,z], [not(z)], [not[y]] 21

Another Example [[x,y], [x,z], [not(z)], [not[y]] [[x], [x,z], [not(z)]] (Resolving on y) 22

Another Example [[x,y], [x,z], [not(z)], [not[y]] [[x], [x,z], [not(z)]] [[x]] (Resolving on z) 23

Another Example [[x,y], [x,z], [not(z)], [not[y]] [[x], [x,z], [not(z)]] [[x]] Satisfiable! 24

Things to Practice Convert some expressions involving all the connectives into CNF Try some resolution proofs, and some runs of the Davis-Putnam algorithm 25