13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.

Slides:



Advertisements
Similar presentations
Inference in First-Order Logic
Advertisements

Artificial Intelligence 8. The Resolution Method
Some Prolog Prolog is a logic programming language
Resolution Proof System for First Order Logic
Inference Rules Universal Instantiation Existential Generalization
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: – Constant symbols (i.e., the "individuals"
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
Automated Reasoning Systems For first order Predicate Logic.
First Order Logic Resolution
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.
Artificial Intelligence Inference in first-order logic Fall 2008 professor: Luigi Ceccaroni.
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.
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.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
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
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Inference and Resolution for Problem Solving
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Inference in First-Order Logic
Chapter 3 Propositional Logic
Artificial Intelligence
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Automated Reasoning ARTIFICIAL INTELLIGENCE 6th edition George F Luger
Start with atomic sentences in the KB and apply Modus Ponens, adding new atomic sentences, until “done”.
The Semantic Web – WEEK 8: An automatic Proof technique.. The “Layer Cake” Model – [From Rector & Horrocks Semantic Web cuurse] You are here!
INFERENCE IN FIRST-ORDER LOGIC IES 503 ARTIFICIAL INTELLIGENCE İPEK SÜĞÜT.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
Inference in First-Order logic Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
UIUC CS 497: Section EA Lecture #3 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Chapter 8 Inference and Resolution for Problem Solving.
Logical Inference 2 rule based reasoning
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
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.
Automated Reasoning Early AI explored how to automate several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Reasoning using First-Order Logic
Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri CS 440 / ECE 448 Introduction to Artificial Intelligence.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
Inference in First Order Logic. Outline Reducing first order inference to propositional inference Unification Generalized Modus Ponens Forward and backward.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Resolution Theorem Proving in Predicate Calculus Lecture No 10 By Zahid Anwar.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Resolution in the Propositional Calculus
Logic Use mathematical deduction to derive new knowledge.
Biointelligence Lab School of Computer Sci. & Eng.
CS 416 Artificial Intelligence
Biointelligence Lab School of Computer Sci. & Eng.
Methods of Proof Chapter 7, second half.
RESOLUTION.
Presentation transcript:

13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution Theorem Proving 13.3 PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.6 Exercises

Chapter Objective Learn about general-purpose theorem proving in predicate calculus.

The problem Given: a knowledge base (a set of sentences) Prove: a sentence Formally, Given: a Knowledge Base (KB), a sentence  Show whether: KB |=  (does KB entail  ? Or does  follow from KB ?)

The tool Modus ponens KB: p  q p question: q answer: yes {p  q, p} |= {q} We can form arbitrarily long “chains” of inference to prove a sentence We can use forward or backward reasoning

Example If Mary goes to a party, Jane also does. If Jane goes to a party, she cannot study. If Jane cannot study, she fails. Mary went to a party. Can we prove: Jane will fail.

Example If Mary goes to a party, Jane also does. M J If Jane goes to a party, she cannot study. J C If Jane cannot study, she fails. C F Mary went to a party. M Can we prove: Jane will fail. F Does {M  J, J  C, C  F, M} entail {F}?

Example 1. M  J 2. J  C 3. C  F 4. M Modus ponens on 1 and 4: 5. J 7. F proven!

Another tool Modus tollens KB: p  q q entails  p. So, a theorem proving process involves applying such rules until the desired sentence is proven. We call this a “proof” because the rules we use are sound (correct).

Using modus ponens solves a lot of practical problems and is fairly efficient in terms of “searching” for a proof. Unfortunately, fails to prove some sentences which should be entailed by a KB (it is incomplete)

Example If Mary goes to the party, Jane also will. M J If Mary does not go to the party, Jane will. M J { M  J, M  J} should entail {J} because either M is true, or M is true and either way J is true. But we cannot prove J using modus ponens. We need a more general rule to cover such situations.

Resolution Unit resolution {p  q, q} entails {p} Generalized resolution {p  q, q  r} entails {p  r} Example 1. M  J M  J 2. M  J M  J Resolution on 1 and 2 3. J  J J proven!

Resolution refutation What we just did was to resolve the sentences in the KB (an any new sentences added) to see if they entail a particular sentence. The general technique is to add the negation of the sentence to be proven to the KB and see if this leads to a contradiction. In other words, if the KB becomes inconsistent with the addition of the negated sentence, then the original sentence must be true. This is called resolution refutation.

Resolution refutation (cont’d) Redo the example: KB contains 1. M  J M  J 2. M  J M  J Question: Is J entailed? Add its negation to the KB: 3.  J Resolve 1 and 2: 4. J  J J Resolve 4 and 3: 5. Contradiction (null result) Hence J must be true.

Resolution refutation (cont’d) Pictorially: 1.  M  J 2. M  J 3.  J 4. J 5. 

Steps for Resolution Refutation proofs Put the premises or axioms into clause form (12.2.2) Add the negation of what is to be proved, in clause form, to the set of axioms Resolve these clauses together, producing new clauses that logically follow from them (12.2.3) Produce a contradiction by generating the empty clause The substitutions used to produce the empty clause are those under which the opposite of the negated goal is true (12.2.4)

Putting sentences into clause form 1. Eliminate  using a  b   a  b 2. Reduce the scope of negations. Transformations include:  ( a)  a  (X) a(X)  (X)  a(X)  (X) a(X)  ( X)  a(X)  (a  b)  a  b  (a  b)  a  b

Putting sentences into clause form (cont’d) 3. Standardize variables apart: rename all variables so that variables bound by different quantifiers have unique names 4. Move all quantifiers to the left without changing their order 5. Eliminate all existential quantifiers using Skolemization. It’s the process of giving a name to an object that must exist. 6. Drop all universal quantifiers (allright to do so now)

Putting sentences into clause form (cont’d) 7. Convert the expression into a conjunct of disjuncts form Eventually each part of an ’ed sentence will be separated, and we want the separated sentences to be disjuncts. So, a  (b  c) is fine, whereas a  (b  c) must be distributed to form (a  b)  (a  c)

Putting sentences into clause form (cont’d) 8. Call each conjunct a separate clause. 9. Standardize the variables apart again. Using this procedure, any set of statements can be converted to the canonical form. Resolution refutation is complete, i.e., if a sentence can be entailed (proven) it will be.

More on Skolemization It is a simple matter to replace every existentially quantified variable with a unique, new constant and drop the quantifier: X (happy (X)) may be replaced by any of the following: happy(no-name) happy(X#123) happy(k1) no-name, X#123, and k1 are Skolem constants. They should not appear in any other sentence in the KB .

Example All people who are graduating are happy. All happy people smile. John-doe is graduating. Is John-doe smiling? First convert to predicate logic X graduating(X)  happy(X) X happy(X)  smiling(X) graduating (john-doe) smiling(john-doe) negate this:  smiling(john-doe) Then convert to canonical form

Example (cont’d) 1. X graduating(X)  happy(X) 2. X happy(X)  smiling(X) 3. graduating (john-doe) 4. smiling(john-doe) Then convert to canonical form: Step 1. Eliminate  1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4. smiling (john-doe)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4. smiling (john-doe) Step 2. Reduce the scope of  Step 3. Standardize variables apart 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. smiling (john-doe)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. smiling (john-doe) Step 4. Move all quantifiers to the left Step 5. Eliminate  Step 6. Drop all  1.  graduating (X)  happy (X) 2.  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. smiling (john-doe)

Example (cont’d) 1.  graduating (X)  happy (X) 2.  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. smiling (john-doe) Step 7. Convert to conjunct of disjuncts form Step 8. Make each conjunct a separate clause. Step 9. Standardize variables apart again. Ready for resolution!

Example (cont’d) 4. smiling (john-doe) 2.  happy (Y)  smiling (Y) {john-doe/Y} 5.  happy (john-doe) 1.  graduating (X)  happy (X) {john-doe/X} 6.  graduating (john-doe) 3. graduating (john-doe) 7. 

Proving an existentially quantified sentence All people who are graduating are happy. All happy people smile. Someone is graduating. Is someone smiling? First convert to predicate logic X graduating(X)  happy(X) X happy(X)  smiling(X)  X graduating (X)  X smiling(X) negate this:   X smiling(X) Then convert to canonical form

Example 1. X graduating(X)  happy(X) 2. X happy(X)  smiling(X) 3.  X graduating (X) 4.  X smiling (X) Then convert to canonical form: Step 1. Eliminate  1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X smiling (X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X smiling (X) Step 2. Reduce the scope of negation. 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X  smiling (X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X  smiling (X) Step 3. Standardize variables apart 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  W  smiling (W)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  W  smiling (W) Step 4. Move all quantifiers to the left Step 5. Eliminate  1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (no-name1) 4.  W  smiling (W)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (no-name1) 4.  W  smiling (W) Step 6. Drop all  1.  graduating (X)  happy (X) 2.  happy (Y)  smiling (Y) 3. graduating (no-name1) 4.  smiling (W) Step 7. Convert to conjunct of disjuncts form Step 8. Make each conjunct a separate clause. Step 9. Standardize variables apart again.

Example (cont’d) 4. smiling (W) 2.  happy (Y)  smiling (Y) {W/Y} 5.  happy (W) 1.  graduating (X)  happy (X) {W/X} 6.  graduating (W) {no-name1/W} 3. graduating (no-name1) 7. 

Proving a universally quantified sentence All people who are graduating are happy. All happy people smile. Everybody is graduating. Is everybody smiling? First convert to predicate logic X graduating(X)  happy(X) X happy(X)  smiling(X) X graduating (X) X smiling(X) negate this:   X smiling(X) Then convert to canonical form

Example 1. X graduating(X)  happy(X) 2. X happy(X)  smiling(X) 3. X graduating (X) 4.   X smiling (X) Then convert to canonical form: Step 1. Eliminate  1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. X graduating (X) 4.   X smiling (X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. X graduating (X) 4.   X smiling(X) Step 2. Reduce the scope of negation. 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X  smiling (X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3.  X graduating (X) 4.  X  smiling (X) Step 3. Standardize variables apart 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  W  smiling (W)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  W  smiling (W) Step 4. Move all quantifiers to the left Step 5. Eliminate  1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  smiling (no-name1)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3.  Z graduating (Z) 4.  smiling (no-name1) Step 6. Drop all  1.  graduating (X)  happy (X) 2.  happy (Y)  smiling (Y) 3. graduating (Z) 4.  smiling (no-name1) Step 7. Convert to conjunct of disjuncts form Step 8. Make each conjunct a separate clause. Step 9. Standardize variables apart again.

Example (cont’d) 4. smiling (no-name1) 2.  happy (Y)  smiling (Y) {no-name/Y} 5.  happy (no-name1) 1.  graduating (X)  happy (X) {no-name1/X} 6.  graduating (no-name1) 3. graduating (Z) {no-name1/Z} 7. 

Exercise All people who are graduating are happy. All happy people smile. Prove that all people who are graduating smile.

More on Skolemization (cont’d) If the existentially quantified variable is in the scope of universally quantified variables, then the existentially quantified variable must be a function of those other variables. We introduce a new, unique function called Skolem function. X Y (loves (X,Y)) may be replaced with any of the following: X loves (X, no-name(X)) X loves (X, loved-one(X)) X loves (X, k1(X)) no-name, loved-one, k1 are Skolem functions. They should not appear in any other sentence in the KB. They should also not have any other parameter than X.

Resolution refutation algorithm Resolution-refutation (KB, ) KB  KB U {   } repeat until the null clause is derived find two sentences to resolve (should have opposite terms under the mgu) KB  KB U { the result of resolution }

Example All people who are graduating are happy. All happy people smile. John-doe is graduating. Who is smiling? First convert to predicate logic X graduating(X)  happy(X) X happy(X)  smiling(X) graduating (john-doe) X smiling(X) negate this:  X smiling(X) Then convert to canonical form

Example (cont’d) 1. X graduating(X)  happy(X) 2. X happy(X)  smiling(X) 3. graduating (john-doe) 4.  X smiling(X) Then convert to canonical form: Step 1. Eliminate  1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4.  X smiling(X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4.  X smiling(X) Step 2. Reduce the scope of  1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4. X  smiling(X)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. X  happy (X)  smiling (X) 3. graduating (john-doe) 4. X  smiling(X) Step 3. Standardize variables apart 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. Z  smiling (Z)

Example (cont’d) 1. X  graduating (X)  happy (X) 2. Y  happy (Y)  smiling (Y) 3. graduating (john-doe) 4. Z  smiling (Z) Step 4. Move all quantifiers to the left Step 5. Eliminate  Step 6. Drop all  1.  graduating (X)  happy (X) 2.  happy (Y)  smiling (Y) 3. graduating (john-doe) 4.  smiling (Z) Ready for resolution.

Example (cont’d) 4. smiling (Z) 2.  happy (Y)  smiling (Y) {Z/Y} 5.  happy (Z) 1.  graduating (X)  happy (X) {Z/X} 6.  graduating (Z) {john-doe/Z} 3. graduating (john-doe) 7.  The substitution for Z is the answer. John-doe is smiling!

Question Which one of the following is a “search problem?” 1) conversion into canonical form 2) proof by resolution Answer: a. only 1 b. only 2 c. both 1 and 2 d. none

Strategies/heuristics for searching for resolution proofs breadth-first search: each clause in the clause space is compared for resolution with every clause in the clause space in the first round. The clauses at the second level of the search space are generated by resolving the clauses at the first level with all the original clauses. For level n: resolve level (n -1) with the original set and all clauses previously produced. the set of support: For a set of input clauses, S, we can specify a subset, T of S, called the set of support. The strategy requires that one of the resolvents in each resolution have an ancestor in the set of support.

Strategies/heuristics for searching for resolution proofs (cont’d) unit preference: each clauses with one literal or as few literals as possible (why?) Note that unit resolution where one of the resolvents is required to be a unit clause is not complete the linear input form: Take the negated goal and resolve with one of the original clauses. Take the result and resolve with another axiom. Continue taking the result and resolving with another axiom until the null clause is produced.

Strategies/heuristics for searching for resolution proofs (cont’d) Example: Choose one as the negation of the goal  a   b a   b  a  b a  b Both unit resolution and linear input form would fail to produce a proof.