Resolution Theorem Proving

Slides:



Advertisements
Similar presentations
Inference Rules Universal Instantiation Existential Generalization
Advertisements

Standard Logical Equivalences
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Artificial Intelligence
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
Methods of Proof Chapter 7, second half.. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound)
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
Logic Use mathematical deduction to derive new knowledge.
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Methods of Proof Chapter 7, Part II. Proof methods Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation.
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
Resolution in Propositional and First-Order Logic.
F22H1 Logic and Proof Week 7 Clausal Form and Resolution.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
CSE (c) S. Tanimoto, 2008 Propositional Logic
ITCS 3153 Artificial Intelligence Lecture 11 Logical Agents Chapter 7 Lecture 11 Logical Agents Chapter 7.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
I NTRO TO L OGIC Dr Shlomo Hershkop March
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
CPS 170: Artificial Intelligence Propositional Logic Instructor: Vincent Conitzer.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
Logical Agents Logic Propositional Logic Summary
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
Propositional Calculus – Methods of Proof Predicate Calculus Math Foundations of Computer Science.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
1 Logical Inference Algorithms CS 171/271 (Chapter 7, continued) Some text and images in these slides were drawn from Russel & Norvig’s published material.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Reasoning with Propositional Logic automated processing of a simple knowledge base CD.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 05 : Knowledge Base & First Order Logic.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #6
EA C461 Artificial Intelligence
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Logical Inference: Through Proof to Truth
Logic Use mathematical deduction to derive new knowledge.
Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Artificial Intelligence: Agents and Propositional Logic.
CS 416 Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Methods of Proof Chapter 7, second half.
Reasoning with the Propositional Calculus
Reasoning with the Propositional Calculus
Artificial Intelligence Propositional Logic
RESOLUTION.
Presentation transcript:

Resolution Theorem Proving G51IAI Introduction to Artificial Intelligence Dr Matthew Hyde

Outline Propositional Logic Recap Conjunctive normal form The Resolution Algorithm Strategies to Guide the Search Conclusion

Propositional Logic Proposition symbols (“literals”) A, B, C, D, Student, North Each can be either True or False The name is irrelevant It is just the name you give to the proposition In your model, if North = True, it could mean that you are facing north, or everyone is facing north, or that it is possible to go north, etc...

Propositional Logic Logical Connectives form more complex sentences OR: “V” - True if one of the symbols is true, or both ( Awake V Asleep ) AND: “Λ” - True if both of the symbols are true ( Awake Λ Listening ) NOT: “¬” ¬Awake, ¬A, ¬B, ¬Student IMPLIES: “=>” P => Q - True unless P is true and Q is false ( Awake Λ Listening ) => ¬Fail

Propositional Logic Literals A “knowledge base” Simply, a group of logical expressions that we already know to be true. E.g.: North Awake Λ Listening Student Awake V Asleep Literals

Propositional Logic The knowledge base evaluates to true, because it is equivalent to putting an “Λ” between each expression North Awake Λ Listening Student Awake V Asleep North Λ (Awake Λ Listening) Λ Student Λ (Awake V Asleep)

Summary so far Literals can be either TRUE or FALSE e.g A, B, ¬C, D, ¬Student, North ... Knowledge base made up of combinations of literals Each line of the knowledge base is TRUE Therefore, ALL of the knowledge base evaluates to TRUE

Inference in Propositional Logic We can infer new facts from what we already know “Modus Ponens” Rule A => B A B Also works for longer sentences A Λ B Λ C => D A Λ B Λ C D We know these two We can therefore infer that this is true

Example of Inference CompassNorth => FacingNorth Snowing => Cold CompassNorth Awake Cold We can infer that FacingNorth = ????

Example of Inference CompassNorth => FacingNorth Snowing => Cold CompassNorth Awake Cold FacingNorth We can infer that FacingNorth = True

Resolution in Propositional Logic Resolution is one method for automated theorem proving It is important to Artificial Itelligence because it helps logical agents to reason about the world It helps them to prove new theorems, and therefore helps them to add to their knowledge

Resolution Algorithm Input a knowledge base and an expression It negates the expression, adds that to the knowledge base, and then finds a contradiction if one exists If it finds a contradiction, then the negated statement is false Therefore, the original statement must be true

Resolution Algorithm Small example Is it sunny? sunny = TRUE? Prove sunny Knowledge base: sunny daytime sunny V night

Resolution Algorithm CONTRADICTION Small example ¬sunny = FALSE Is it sunny? sunny = TRUE? Prove sunny Knowledge base: sunny daytime sunny V night ¬sunny Negate it Add it to the knowledge base CONTRADICTION ¬sunny = FALSE Therefore: sunny = TRUE

Conjunctive Normal Form Resolution algorithm needs sentences in CNF A series of “conjunctions” (clauses joined together by “AND”) (¬ A V B) Λ (B V C) Λ (D V ¬ E V F) Λ (G) Λ ... Inside the brackets, we only have V (OR) ¬ (NOT) symbols There are no “implies” (=>) symbols anywhere

Conjunctive Normal Form (A V B) Λ (B V C) Λ (D V E V F) Λ (G) Λ ... Clauses The whole thing represents the knowledge base, so it evaluates to TRUE

Conjunctive Normal Form Resolution algorithm ‘resolves’ clauses In fact, it only applies to clauses Each pair of clauses that contains complementary literals is resolved Complementary literals have the property that one negates the other A, ¬A Student, ¬Student

Procedure for converting to CNF (a) To eliminate ↔, (a ↔ b) ≡ (a → b) Λ (b→ a) (b) To eliminate →, (a → b) ≡ ¬ a ν b (c) Double negation ¬ (¬a) ≡ a (d) De Morgan ¬ (a Λ b) ≡ (¬a ν ¬b) ¬(a ν b) ≡ (¬a Λ ¬b) (e) Distributivity of Λ over ν (a Λ (b ν c )) ≡ ((a Λ b) ν (a Λ c)) (f) Distributivity of ν over Λ (a ν (b Λ c )) ≡ ((a ν b) Λ (a ν c))

Resolution Rule Given two clauses: ( A V B ) ( ¬B V C ) Produce one clause containing all of the literals except the two complementary literals: A V C

Resolution Rule Given two clauses: ( A V B V C V D ) ( E V F V ¬B V G V H ) Produce one clause containing all of the literals except the two complementary literals: A V C V D V E V F V G V H

Resolution Example ¬asleep v fail asleep Show that the knowledge base entails “fail” Negate the theorem ¬asleep v fail asleep

This means, put a “¬” symbol in front of it Very Important: NEGATE THE THEOREM This means, put a “¬” symbol in front of it If it already has one, then remove it

A ¬A ¬B B Fail ¬Fail Very Important: Theorem Negated Theorem Then add it to the knowledge base and find a contradiction

Resolution Example ¬asleep v fail asleep Show that the knowledge base entails “fail” Negate the theorem ¬fail ¬asleep v fail asleep ¬asleep fail Empty

Example 2 Beep Beep! Roadrunner and Coyote

Example 2 Coyote chases Roadrunner If Roadrunner is smart, Coyote does not catch it If coyote chases Roadrunner and does not catch it, then Coyote is annoyed. Roadrunner is smart Theorem: Coyote is annoyed ???? Beep Beep!

Example 2 Theorem: Coyote is annoyed We try to prove that “Coyote is NOT annoyed” is false We add “Coyote is NOT annoyed” to the knowledge base, and prove false So, the original theorem must be true Beep Beep!

Example 2 Sentence Expression Coyote chases Roadrunner Chase If Roadrunner is smart, Coyote does not catch it Smart => ¬Catch If coyote chases Roadrunner and does not catch it, then Coyote is Annoyed Chase Λ ¬Catch => Annoyed Roadrunner is smart Smart Coyote is not annoyed ¬Annoyed We are asking: Does the knowledge base entail “Annoyed”

Example 2 Convert these into Conjunctive Normal Form: S => ¬B Expression Simplified Chase C Smart => ¬Catch S => ¬B Chase Λ ¬Catch => Annoyed C Λ ¬B => A Smart S ¬Annoyed ¬A Convert these into Conjunctive Normal Form: S => ¬B C Λ ¬B => A

S => ¬B ¬S V ¬B C Λ ¬B => A ¬C V B V A Example 2 Expression CNF

Example 2 C = Coyote Chases Roadrunner S = Roadrunner is Smart Number Expression 1 C 2 ¬S V ¬B 3 ¬C V B V A 4 S 5 ¬A C = Coyote Chases Roadrunner S = Roadrunner is Smart B = Coyote Catches Roadrunner A = Coyote is Annoyed

Example 2 ¬Annoyed Λ Annoyed Number Expression 1 C 6 B V A from 1 and 3 2 ¬S V ¬B 7 ¬B from 2 and 4 3 ¬C V B V A 8 A from 6 and 7 4 S 9 False from 5 and 8 5 ¬A ¬Annoyed Λ Annoyed

Example 2 – Proved in a different way Number Expression 1 C 6 ¬S V ¬C V A from 2 and 3 2 ¬S V ¬B 7 ¬C V A from 4 and 6 3 ¬C V B V A 8 ¬C from 5 and 7 4 S 9 False from 1 and 8 5 ¬A Coyote catches Roadrunner AND Coyote does not catch Roadrunner

Example 2 – conclusion Annoyed Λ ¬Annoyed This cannot be true, therefore adding “¬Annoyed” causes a contradiction in the knowledge base Theorem was: “Coyote is annoyed” We added the opposite and proved FALSE We proved that Annoyed = TRUE, by proving that ¬Annoyed = FALSE Therefore Coyote is annoyed The knowledge base entails “annoyed”

Can take a very long time Resolution Problems Can take a very long time Depending on the number of clauses in the knowledge base

Example 3 B V A ¬C V A ¬B V A C V ¬D ¬A V ¬B V D Does this entail A? In other words: Does all of this mean that A is TRUE? If we set A to FALSE, and find a contradiction, then A must be TRUE

Example 3 The Knowledge Base B V A ¬C V A ¬B V A C V ¬D ¬A V ¬B V D ¬A A V A A Contradiction

Example 3 1) B V A 2) ¬C V A 7) ¬C From 2,6 3) ¬B V A 8) ¬D From 4,7 4) C V ¬D 5) ¬A V ¬B V D 6) ¬A 7) ¬C From 2,6 8) ¬D From 4,7 9) ¬A V ¬B From 5,8 10) B From 1,6 11) ¬A From 9,10 12) ¬B From 3,11 Contradiction

Example 3 - conclusion So you can find the answer in 1 step or 6 steps, depending on the order in which you resolve the clauses The speed of the resolution algorithm depends on the order But, resolution will always find a proof if one exists. You just have to keep going until there are no more clauses to resolve

What you need to know The resolution algorithm Uses the principle of proof by contradiction Why the knowledge base must be in Conjunctive Normal Form The speed of the algorithm depends on the order in which you resolve the clauses