Download presentation
Presentation is loading. Please wait.
Published byAlban Lindsey Modified over 8 years ago
1
Lecture 9a: Resolution Strategies Heshaam Faili hfaili@ece.ut.ac.ir University of Tehran Restriction strategies for resolution Horn clauses
2
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, 5 10. {q}4, 5 11. {r}3, 6 12. {p}4, 6 13. {q}1, 7 14. {r}6, 7 15. {p}1, 8 16. {r}5, 8 17. { }4, 9 18. {r}3, 10 19. { }8, 10 20. { }4, 11 21. {r}2, 12 22. { }7, 12 23. {r}3, 13 24. { }8, 13 25. { }4, 14 26. {r}2, 15 27. { }7, 15 28. { }4, 16 29. { }4, 18 30. { }4, 21 31. { }4, 23 32. { }4, 26 short proof: {1,2,3,4,5,9,17 }
3
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
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
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!
6
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
7
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
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
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?
10
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, 7 10. { }6, 7 11. {r}2, 8 12. { }5, 8
11
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!
12
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!
13
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} { }
14
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
15
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, 7 10. { }6, 7 11. {r}2, 8 12. { }5, 8 Set of Support resolution example
16
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
17
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
18
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
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
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
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
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,10 13. ~bee(zeke) 4,10 14. ~spider(zeke)5,10 15. ~lion(zeke) 6,11 16. ~tiger(zeke) 7,11 17. ~zebra(zeke) 8,11 18. {} Derivation
23
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
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
25 ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.