Lecture 9a: Resolution Strategies Heshaam Faili University of Tehran Restriction strategies for resolution Horn clauses.

Slides:



Advertisements
Similar presentations
Resolution Proof System for First Order Logic
Advertisements

Russell and Norvig Chapter 7
Inference Rules Universal Instantiation Existential Generalization
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
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.
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.
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.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Proof methods Proof methods divide into (roughly) two kinds: –Application of inference rules Legitimate (sound) generation of new sentences from old Proof.
Midterm Review CMSC421 – Fall CH1 Summary: Intro AI Definitions: dimensions human/rational think/act Three Major Components of AI Algorithms Representation.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
ITCS 3153 Artificial Intelligence Lecture 11 Logical Agents Chapter 7 Lecture 11 Logical Agents Chapter 7.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Inference and Resolution for Problem Solving
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Methods of Proof Chapter 7, second half.
Knoweldge Representation & Reasoning
Chapter 3 Propositional Logic
Plan for the rest of the quarter TuesdayThursday Week 7ResolutionProof carrying code Week 8No class (Sorin in DC for workshop) Predicate abstraction (Mystery.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
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.
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.
Logical Inference 2 rule based reasoning
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.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
S P Vimal, Department of CSIS, BITS, Pilani
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,
Automated Theorem Proving: Resolution and Davis-Putnam Intermediate Logic.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 17 Wednesday, 01 October.
Resolution Strategies One common strategy for applying resolution is called level saturation. Here you try to resolve every pair of clauses from the original.
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.:
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 23 Friday, 17 October.
Computing & Information Sciences Kansas State University Lecture 15 of 42 CIS 530 / 730 Artificial Intelligence Lecture 15 of 42 William H. Hsu Department.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 18 of 41 Friday, 01 October.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
For Wednesday Finish reading chapter 10 – can skip chapter 8 No written homework.
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
Automated Reasoning in Propositional Logic Problem Given: KB: a set of sentence  : a sentence Answer: KB  ?
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part B Propositional Logic.
Backward chaining Assume the same representation of rules as in forward chaining, i.e. If is true, is true, … is true Then is true. Rule interpretation.
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.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
Automated Reasoning in Propositional Logic Russell and Norvig: Chapters 6 and 9 Chapter 7, Sections 7.5—7.6 CS121 – Winter 2003.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
EA C461 Artificial Intelligence
Knowledge Representation and Reasoning
Resolution in the Propositional Calculus
Propositional Resolution
Biointelligence Lab School of Computer Sci. & Eng.
CS 416 Artificial Intelligence
Back to “Serious” Topics…
Biointelligence Lab School of Computer Sci. & Eng.
Automated Reasoning in Propositional Logic
Reasoning in Artificial Intelligence
Methods of Proof Chapter 7, second half.
Resolution Proof System for First Order Logic
Presentation transcript:

Lecture 9a: Resolution Strategies Heshaam Faili University of Tehran Restriction strategies for resolution Horn clauses

Resolution can be very inefficient… 1. {p,q} KB 2. {~p,r} KB 3. {~q,r} KB 4. {~r} prove 5. {q,r}1, 2 6. {p, r}1, 3 7. {¬ p}2, 4 8. {¬ q}3, 4 9. {r}3, {q}4, {r}3, {p}4, {q}1, {r}6, {p}1, {r}5, { }4, {r}3, { }8, { }4, {r}2, { }7, {r}3, { }8, { }4, {r}2, { }7, { }4, { }4, { }4, { }4, { }4, 26 short proof: {1,2,3,4,5,9,17 }

3 Resolution Strategies: key issues How to choose the next two clauses to resolve? In the worst case we need to generate a very large number of redundant, often irrelevant conclusions. Note: the size of KB grows, so more resolutions! How to avoid useless work by not performing certain unnecessary deductions. The goal is to decrease the size of the resolution graph that leads to a conclusion. Can we restrict FOL to obtain an efficient resolution strategy: trade-off expressivity/efficiency?

4 Horn Clauses Def: A Horn clause is a clause with at most one positive (negative) literal (either form for all KB) {p 1,p 2,….,p n,~q} {~p 1,~p 2,….,~p n,q} usually comes from sentences that describe rules q => (p 1  p 2  …  p n ) (p’ 1  p’ 2  …  p’ n ) => q’ the general form is the implicative normal form (p 1  p 2  …  p n ) => (q 1  q 2  …  q m ) Advantages: efficient and complete resolution strategies! Trade off expressiveness for efficiency

5 Deletion strategies Eliminate unnecessary clauses from KB so as to avoid wasted resolutions: 1. pure literal elimination 2. tautology elimination 3. subsumption elimination The deletions are always sound and complete by definition!

1. {~p, ~q, r} 2. {~p, s} 3. {~q, s} 4. {p} 5. {q} 6. {~r} 1. Pure literal elimination Remove any clause containing a “pure literal”— a literal that has no complementary instance in the data base: “s” is a pure literal, so these 2 clauses can be “thrown away.” This preserves soundness and completeness since we cannot derive the empty clause with pure literals

2. Tautology elimination Eliminate clauses that contain identical complementary literals -- these are tautologies which do not change the satisfiability of KB Ex1: {p(g(a)),~p(g(a))} {p(X), q(Y),~q(Y),r(Z)} can all be eliminated! Ex2: {p(a),~p(X)} cannot be eliminated! {p(a)} {~p(b)} with the first clause, {} is derivable; without, it is not

8 3. Subsumption elimination Delete all subsumed clauses. A clause  is said to subsume clause  iff there is a substitution U such that  [U] =>  Ex: 1. {p(X), q(Y)} subsumes 2. {p(a), q(V), r(W)} since the substitution U = {X/a, Y/V} makes the first a subset of the second. So we can “throw away” the second. The same set of clauses that resolve 2. will resolve 1.

9 Resolution strategies How to choose the next two clauses to resolve: unit resolution input resolution linear resolution set-of-support resolution directed resolution What is the complexity of each strategy? Are these strategies sound and complete? If not, for what subset of FOL they are?

Unit Resolution (1) When choosing two clauses to resolve, at least one of the clauses being resolved at every step contains a single literal (unit clause). The idea: produce shorter and shorter sentences Ex:1. {p, q} KB 2. {~p, r} KB 3. {~q, r}KB 4. {~r}KB 5. {~p}2, 4 6. {~q}3, 4 7. {q}1, 5 8. {p} 1, 6 9. {r}3, { }6, {r}2, { }5, 8

Unit Resolution (2) Unit resolution refutation is complete for Horn clauses but incomplete in general: Ex: 1. {p, q} 2. {~p, q} 3. {p, ~q} 4. {~p, ~q} Cannot perform a single unit resolution since all clauses are of size 2!

Input Resolution At least one of the clauses being resolved at every step is a member of the initial (i.e., input) knowledge base. Input refutation is complete for Horn clauses but incomplete in general: Ex: 1. {p, q}KB 2. {~p, q}KB 3. {p, ~q} KB 4. {~p, ~q}KB Cannot perform input resolution!

Linear Resolution At least one of the clauses being resolved at every step is either in the initial data knowledge base or is an ancestor of the other clause (generalization of input resolution) Linear resolution refutation complete for all clauses Ex: {p, q} {~p, q} {p, ~q} {~p, ~q} {q} {p} {~q} {q} { }

Set of Support Resolution A subset  of a set  is called a “set of support” for  iff  is satisfiable. Set of support resolution: at least one of the clauses being resolved at every step is selected from a set of support . The idea: use only a subset of the KB for new clauses set of support refutation is complete for all clauses often,  is chosen to be the clauses derived from the negated goal can be seen as working backwards from the goal

1. {p, q}KB 2. {~p, r}KB 3. {~q, r}KB 4. {~r}  5. {~p}2, 4 add to  6. {~q}3, 4 add to  7. {q}1, 5 add to  8. {p}1, 6 add to  9. {r}3, { }6, {r}2, { }5, 8 Set of Support resolution example

Ordered Resolution Each clause is treated as a linearly ordered set. Resolution is permitted only on the first literal of each clause. Literals in the conclusion preserve parent clauses' order:“positive parent” clauses followed by “negative parent” clauses. Refutation by ordered resolution is complete for Horn clauses but incomplete in general

1. {p, q}KB 2. {~p, r}KB 3. {~q, r}KB 4. {~r}KB 5. {q,r}1, 2 6. {r}3, 5 7. { }4, 6 The conclusion was quickly reached! Example of Ordered Resolution

Directed Resolution Use of ordered resolution on a knowledge base of “direction” clauses— i.e., Horn clauses with any positive literal either at the beginning or the end of the clause: {~p 1,~p 2,….,~p n,q} (p 1  p 2  …  p n ) => q

19 Forward and Backward Resolution Forward deduction first prove p 1, p 2, …,p n then conclude q try to reach the goal starting from the rules Backward deduction to prove q, try to p 1, p 2, …,p n work from the goal back to the starting rules Directed resolution can be used in forward, backward, or mixed direction. Which is best depends on the branching factor.

20 Forward deduction 1. {~m(X), p(X)}  m(X) =>p(X) 2. {m(a)}  m(a) 3. {~p(Z)}KB p(Z) => 4. {p(a)}1, 2p(a) 5. { }3, 4{ } Backward deduction 1. {p(X),~m(X)}  p(X) <= m(X) 2. {m(a)}  m(a) 3. {~p(Z)}KB <= p(Z) 4. {~m(Z)}1, 3~m(Z) 5. { }2, 4{ }

21 Forward reasoning: example 8. zebra(zeke)given 9. ~animal(zeke) concl. 10. mammal(zeke). 1,8 11. animal(zeke) 2,10 12 {} 9,11 1. insect(X) => animal(X) 2. mammal(X) => animal(X) 3. ant(X) => insect(X) 4. bee(X) => insect(X) 5. spider(X) => insect(X) 5. lion(X) => mammal(X) 6. tiger(X) => mammal(X) 7. zebra(X) => mammal(X) Original KBDerivation

22 Backward reasoning: example 1. insect(X) => animal(X) 2. mammal(X) => animal(X) 3. ant(X) => insect(X) 4. bee(X) => insect(X) 5. spider(X) => insect(X) 5. lion(X) => mammal(X) 6. tiger(X) => mammal(X) 7. zebra(X) => mammal(X) Original KB 8. zebra(zeke)given 9. ~animal(zeke) concl. 10. ~insect(zeke). 1,9 11. ~mammal(zeke) 2,9 12. ~ant(zeke) 3, ~bee(zeke) 4, ~spider(zeke)5, ~lion(zeke) 6, ~tiger(zeke) 7, ~zebra(zeke) 8, {} Derivation

23 s 1 => p s 2 => p … s n => p ~s n ~p forward: 2 steps backward: n+1 steps p => s 1 p => s 2 … p => s n ~s n ~p forward: n+1 steps backward: 2 steps Forward and Backward Resolution The problem of deciding whether the forward or backward direction (or some mixture) is best is NP-complete.

24 Rule-based systems A variety of theorem provers and rule-based systems have been programmed. Most restrict the type of rules and clauses that can be input to the system. Most are refutation-based. Most provide some control over search strategy to be used: backward, forward, cut entire branches of the search tree.

25 ?