Propositional Resolution

Similar documents
Computational Logic Lecture 3. Logical Entailment. Michael Genesereth Autumn Logical Reasoning

Logic, Human Logic, and Propositional Logic. Human Logic. Fragments of Information. Conclusions. Foundations of Semantics LING 130 James Pustejovsky

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

Advanced Topics in LP and FP

Deductive Systems. Lecture - 3

Part 1: Propositional Logic

Propositional Resolution

Propositional Reasoning

Propositional logic II.

Proof Methods for Propositional Logic

Inference in Propositional Logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

Propositional Logic Part 1

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Inference in first-order logic

Propositional and Predicate Logic - V

Artificial Intelligence Chapter 7: Logical Agents

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

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

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logic and Inferences

Propositional Logic: Methods of Proof (Part II)

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Inf2D 13: Resolution-Based Inference

Inference Methods In Propositional Logic

CSC242: Intro to AI. Lecture 11. Tuesday, February 26, 13

Propositional Logic: Methods of Proof (Part II)

Logical Agents (I) Instructor: Tsung-Che Chiang

Convert to clause form:

CS 380: ARTIFICIAL INTELLIGENCE

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Inference Methods In Propositional Logic

CS 2710 Foundations of AI Lecture 12. Propositional logic. Logical inference problem

Propositional and First-Order Logic

CS 7180: Behavioral Modeling and Decision- making in AI

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

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Propositional Logic: Review

CS:4420 Artificial Intelligence

Computation and Logic Definitions

CS 771 Artificial Intelligence. Propositional Logic

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

02 Propositional Logic

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Knowledge based Agents

Logical Agents. Santa Clara University

Language of Propositional Logic

Logical agents. Chapter 7. Chapter 7 1

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

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

Propositional Logic Language

6. Logical Inference

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Propositional Logic: Models and Proofs

Introduction to Intelligent Systems

Propositional Logic: Methods of Proof (Part II)

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Class Assignment Strategies

Logical Agents. Chapter 7

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

7.5.2 Proof by Resolution

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Intelligent Agents. Pınar Yolum Utrecht University

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

Learning Goals of CS245 Logic and Computation

Propositional Dynamic Logic

Introduction to Intelligent Systems

Supplementary exercises in propositional logic

Inference in first-order logic

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

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

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Inference in first-order logic

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


Part 1: Propositional Logic

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

Logical Inference 2 rule based reasoning

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Propositional logic. Programming and Modal Logic

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

Properties of Relational Logic

Deliberative Agents Knowledge Representation I. Deliberative Agents

03 Propositional Logic II

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Marie Duží

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Artificial Intelligence

TDT4136 Logic and Reasoning Systems

Artificial Intelligence. Propositional logic

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

Chapter 3: Propositional Calculus: Deductive Systems. September 19, 2008

First-Order Theorem Proving and Vampire

Transcription:

Computational Logic Lecture 4 Propositional Resolution Michael Genesereth Spring 2005 Stanford University Modified by Charles Ling and TA, for CS2209 Use with permission

Propositional Resolution Propositional resolution is a rule of inference. Using propositional resolution alone (without other rules of inference), it is possible to build a theorem prover that is sound and complete for all of Propositional Logic. The search space using propositional resolution is much smaller than for Modus Ponens and the Standard Axiom Schemata. 3

Clausal Form Propositional resolution works only on expressions in clausal form. Fortunately, it is possible to convert any set of propositional calculus sentences into an equivalent set of sentences in clausal form (same as CNF) 4

Clausal Form A literal is either an atomic sentence or a negation of an atomic sentence. P ~P A clausal sentence is either a literal or a disjunction of literals. P ~P P Q A clause is a set of literals. {P} {~P} {P,Q} 5

Empty Sets The empty clause {} is unsatisfiable. Why? It is equivalent to an empty disjunction. 6

Conversion to Clausal Form (or CNF) Implications Out: ~ 1 2 1 2 (~ ) ( ~ ) 1 2 1 2 1 2 Negations In: ~~ ~ ( ) ~ ~ 1 2 1 2 ~ ( ) ~ ~ 1 2 1 2 7

Distribution Operators Out Conversion to Clausal Form ( ) ( ) ( ) 1 2 3 1 2 1 n ( ) ( ) ( ) 1 2 3 1 3 2 3 ( ) 1 2 3 1 2 3 ( ) 1 2 3 1 2 3 ( ) 1 2 3 1 2 3 ( ) 1 2 3 1 2 3... {,..., } 1 n 1 n...,..., 1 n 1 n 8

Example G (R F) I G (~ R F) N G (~ R F) D G (~ R F) O {G} {~ R,F} 9

Example ~ (G (R F)) I ~ (G (~ R F)) N ~ G ~ (~ R F)) ~ G (~~ R ~ F) ~ G (R ~ F) D (~ G R) (~ G ~ F) O { ~ G, R} {~ G, ~ F} 10

Resolution Principle General: {,...,,..., } 1 m {,..., ~,..., } 1 n {,...,,,..., } 1 m 1 n Example: {P,Q} {~ P,R} {Q,R} 11

Issues Collapse {~ P,Q} {P,Q} {Q} Singletons {~ P,Q} {P} {Q} {P} {~ P} {} 12

Issues Multiple Conclusions {P,Q} {~ P,~ Q} {P,~ Q} {Q,~ Q} {P, ~P} Single Application Only {P,Q} {~ P, ~ Q} {} Wrong!! 13

Special Cases Modus Ponens Modus Tolens Chaining P Q P Q P Q P ~ Q Q R Q ~ P P R {~ P,Q} {P} {Q} {~ P,Q} {~ Q} {~ P} {~ P,Q} {~ Q, R} {~ P,R} 14

Incompleteness? Propositional Resolution is not generatively complete. We cannot generate P (Q P) using propositional resolution. There are no premises. Consequently, there are no conclusions. 15

Answer This apparent problem disappears if we take the clausal form of the premises (if any) together with the negated goal (also in clausal form), and try to derive the empty clause. General Method: To determine whether a set of sentences logically entails a sentence, rewrite {~ } in clausal form and try to derive the empty clause using the resolution rule of inference. 16

Example ~ (P (Q P)) I ~ (~ P ~ Q P) N ~~ P ~~ Q ~ P P Q ~ P D P Q ~ P O {P} {Q} {~ P} 17

Example If Mary loves Pat, then Mary loves Quincy. If it is Monday, Mary loves Pat or Quincy. Prove that, if it is Monday, then Mary loves Quincy. P > Q 1. {~ P,Q} Premise M > (P v Q) 2. {~ M, P, Q} Premise Prove: M > Q 3. {M} Negated Goal 4. {~ Q} Negated Goal 5. {P,Q} 3,2 6. {Q} 5,1 7. {} 6,4 18

Example Heads you win. Tails I lose. Show that you always win. 1. {~ H, Y} Premise 2. {~ T,~ M} Premise 3. {H, T} Premise 4. {~ H, ~ T} Premise 5. {M, Y} Premise 6. {~ M,~ Y} Premise 7. {~ Y} Negated Goal 8. {T, Y} 3,1 9. {~ M, Y} 8, 2 10. {Y} 9,5 11. {} 10,7 H > Y T > ~M ~H > T H > ~T ~M > Y M > ~Y 19

Soundness and Completeness A sentence is provable from a set of sentences by propositional resolution if and only if there is a derivation of the empty clause from the clausal form of {~ }. Theorem: Propositional Resolution is sound and complete, i.e. = if and only if -. 20

Two Finger Method function resolvents(, ) 1 2 { { } {~ } and ~ } 1 2 1 2 { {~ } { } ~ and } 1 2 1 2 21

Two Finger Method 1. {P, Q} Premise 2. {~ P, R} Premise 3. {~ Q, R} Premise 4. {~ R} Premise 5. {Q,R} 1,2 6. {P,R} 1,3 7. {~ P} 2,4 8. {~ Q} 3,4 9. {R} 3,5 10. {Q} 4,5 11. {R} 2,6 12. {P} 4,6 13. {Q} 1,7 14. {R} 6,7 15. {P} 1,8 16. {R} 5,8 17. {} 4,9 22

TFM With Identical Clause Elimination 1. {P, Q} Premise 2. {~ P,R} Premise 3. {~ Q,R} Premise 4. {~ R} Premise 5. {Q,R} 1,2 6. {P,R} 1,3 7. {~ P} 2,4 8. {~ Q} 3,4 9. {R} 3,5 10. {Q} 4,5 11. {P} 4,6 12. {} 4,9 23

TFM With ICE, Complement Detection 1. {P, Q} Premise 2. {~ P,R} Premise 3. {~ Q,R} Premise 4. {~ R} Premise 5. {Q,R} 1,2 6. {P,R} 1,3 7. {~ P} 2,4 8. {~ Q} 3,4 9. {R} 3,5 10. {} 4,9 24

Termination Theorem: There is a resolution derivation of a conclusion from a set of premises if and only if there is a derivation using the two finger method. Theorem: Propositional resolution using the two-finger method always terminates. Proof: There are only finitely many clauses that can be constructed from a finite set of logical constants. 25

Decidability of Propositional Entailment Propositional resolution is a decision procedure for Propositional Logic. Logical entailment for Propositional Logic is decidable. Sadly, the problem in general is NP-complete. 26

Horn Clauses and Horn Chains A Horn clause is a clause containing at most one positive literal. Example: {R, ~P, ~ Q} Example: {~ P, ~ Q, ~ R} Example: P Non-Example: {Q, R, ~ P} NB: Every Horn clause can be written as a rule. {~ P, ~ Q, R} P Q R 27

Complexity Good news: When a set of propositional sentences is Horn, satisfiability and, consequently, logical entailment can be decided in time linear in the size of the sentence set. P Q R R S S T S V p q r s t v Does {P, Q} = V? 28