190 likes | 375 Views
Resolution. http://users.encs.concordia.ca/~c474_4/Resolution_in_FOL.ppt http ://users.encs.concordia.ca/~ c474_4/ResolutionTheoremProving.ppt. Resolution Principle.
E N D
Resolution http://users.encs.concordia.ca/~c474_4/Resolution_in_FOL.ppt http://users.encs.concordia.ca/~c474_4/ResolutionTheoremProving.ppt
Resolution Principle • Resolution refutation proves a theorem by negating the statement to be proved and adding this negated goalto the set of axioms that are known to be true. • Use the resolution rule of inference to show that this leads to a contradiction. • Once the theorem prover shows that the negated goal is inconsistent with the given set of axioms, it follows that the original goal must be consistent.
Resolution Principle • Prove that “Fido will die.” from the statements “Fido is a dog.”, “All dogs are animals.” and “All animals will die.” • Changing premises to predicates • dog(fido) • "(x) (dog(X) ® animal(X)) • "(Y) (animal(Y) ® die(Y)) • Modus Ponens and {fido/X} • animal(fido) • "(Y) (animal(Y) ® die(Y)) • Modus Ponens and {fido/Y} • die(fido)
Resolution Principle • Equivalent Reasoning by Resolution • Convert predicates to clause form Predicate formClause form 1.dog(fido) dog(fido) 2."(x) (dog(X) ® animal(X)) Ødog(X) Ú animal(X) 3. "(Y) (animal(Y) ® die(Y)) Øanimal(Y) Ú die(Y) • Negate the conclusion 4.Ødie(fido) Ødie(fido)
Converting to Clause Form • Eliminate , using: a b= a v b. • Reduce the scope of each to a single term, using: • ( p) = p • deMorgan's laws: (a b) = a V b (a V b) = a b • x P(x) = x P(x) • xP(x) = x P(x) • Standardize variables. • Move all quantifiers to the left of the formula without changing their relative order. • Eliminate existential quantifiers by inserting Skolem functions. • Drop the prefix. • Convert the expression into a conjunction of disjuncts, using associativity and distributivity. • Create a separate clause for each conjunct. • Standardize apart the variables in the set of clauses generated in step 8, using the fact that: (x: P(x) Q(x)) = x: P(x) x: Q(x)
Skolem Functions in FOL • Skolem’s Theorem Every existentially quantified variable can be replaced by a unique Skolem function whose arguments are all the universally quantified variables on which the existential depends, without changing FOL. • Examples • “Everybody likes something” (x) (y) [Person(x) & Likes(x,y)] (x) [Person(x) & Likes(x, S1(x))] Where S1(x) = “that which x likes” • “Every philosopher writes at least one book” (x) (y)[Philosopher(x) & Book(y)) => Write(x,y)] (x)[(Philosopher(x) & Book(S2(x))) => Write(x,S2(x))]
Examples of Conversion to Clause Form • Example: x: [Roman(x) know(x, Marcus)] [hate(x,Caesar) V (y: z: hate(y,z) thinkcrazy(x,y))] • Eliminate x: [Roman(x) know(x, Marcus)] V[hate(x,Caesar) V (y: z: hate(y,z) Vthinkcrazy(x,y))] • Reduce scope of . x: [ Roman(x) V know(x, Marcus)] V[hate(x,Caesar) V (y: z: hate(y,z) Vthinkcrazy(x,y))] • “Standardize” variables: x: P(x) Vx: Q(x) converts to x: P(x) Vy: Q(y) • Move quantifiers. x: y: z: [Roman(x) Vknow(x, Marcus)] V[hate(x,Caesar) V (hate(y,z) Vthinkcrazy(x,y))]
Examples of Conversion to Clause Form • Eliminate existential quantifiers. y: President(y) will be converted to President(S1) x: y: father-of(y,x) will be converted to x: father-of(S2(x),x)) • Drop the prefix. [ Roman(x) Vknow(x,Marcus)] V [hate(x, Caesar) V (hate(y,z) Vthinkcrazy(x,y))] • Convert to a conjunction of disjuncts. Roman(x) Vknow(x,Marcus) Vhate(x,Caesar) Vhate(y,z) Vthinkcrazy(x,y)
Algorithm: Resolution • Convert all the propositions of F to clause form. • Negate P and convert the result to clause form. Add it to the set of clauses obtained in 1. • Repeat until either a contradiction is found, no progress can be made, or a predetermined amount of effort has been expended. a) Select two clauses. Call these the parent clauses. b) Resolve them together. The resolvent will be the disjunction of all the literals of both parent clauses with appropriate substitutions performed and with the following exception: If there is one pair of literals T1 and T2 such that one of the parent clauses contains T1 and the other contains T2 and if T1 and T2 are unifiable, then neither T1 nor T2 should appear in the resolvent. If there is more than one pair of complementary literals, only one pair should be omitted from the resolvent. c) If the resolvent is the empty clause, then a contradiction has been found. If it is not, then add it to the set of clauses available to the procedure.
Resolution in Propositional Logic • Resolution in Propositional Logic 1. a ¬ b Ù c a Ú ØbÚ Øc 2. b b 3. c ¬ d Ù e c ÚØdÚØe 4. e Ú f e Ú f 5. d ÙØ f d Ø f
Resolution in Propositional Logic • First, the goal to be proved, a , is negated and added to the clause set. • The derivation of indicates that the database of clauses is inconsistent. Øa a ÚØbÚ Øc ØbÚ Øc b Øc c Ú ØdÚ Øe e Ú f ØdÚ Øe d f ÚØd f Øf
Resolution on the predicate calculus • A literal and its negation in parent clauses produce a resolvent only if they unify under some substitution s. s Is then applied to the resolvent before adding it to the clause set. • C1 = Ødog(X) Ú animal(X) C2 = Øanimal(Y) Ú die(Y) Resolvent : Ødog(Y) Ú die(Y) {Y/X}
Resolution Proof • Axioms in clause form: 1. man(marcus) 2. pompeian(marcus) 3. pompeian(X1) v roman(X1) 4. ruler(caesar) 5. roman(X2)vloyalto(X2, caesar)v hate(X2, caesar) 6. loyalto(X3, f1(X3)) 7. man(X4) v ruler(Y1) v tryassassinate(X4, Y1) v loyalto(X4, Y1) 8. tryassassinate(marcus, caesar)
Resolution Proof Prove: hate(marcus, caesar) hate(marcus, caesar) 5 marcus/X2 3 roman(marcus) Vloyalto(marcus,caesar) marcus/X1 pompeian(marcus) Vloyalto(marcus,caesar) 2 7 loyalto(marcus,caesar) marcus/X4, caesar/Y1 1 man(marcus) Vruler(caesar) V tryassassinate(marcus, caesar) ruler(caesar) V tryassassinate(marcus, caesar) 4 tryassassinate(marcus, caesar) 8
Resolution Proof • “Lucky student” 1. Anyone passing his history exams and winning the lottery is happy • "X(pass(X,history) Ù win(X,lottery) ® happy(X)) 2. Anyone who studies or is lucky can pass all his exams. • "X"Y(study(X) Ú lucky(X) ® pass(X,Y)) 3. John did not study but he is lucky • Østudy(john) Ù lucky(john) 4. Anyone who is lucky wins the lottery. • "X(lucky(X) ® win(X,lottery))
Resolution Proof • Clause forms of “Lucky student” 1. Øpass(X,history) ÚØwin(X,lottery) Ú happy(X) 2. Østudy(X) Ú pass(Y,Z) Ølucky(W) Ú pass(W,V) 3. Østudy(john) lucky(john) 4. Ølucky(V) Ú win(V,lottery) 5. Negate the conclusion “John is happy” Øhappy(john)
Resolution Proof • “Exciting Life” 1. All people who are not poor and are smart are happy. • "X(Øpoor(X) Ù smart(X) ® happy(X)) 2. Those people who read are not stupid. • "Y(read(Y) ® smart(Y)) • {assume "X(smart(X) ºØstupid(X))} 3. John can read and is wealthy. • read(john) Ù Øpoor(john) • {assume "Y(wealthy(Y) ºØpoor(Y))} 4. Happy people have exciting lives. • "Z(Happy(Z) ® exciting(Z)) 5. Negate the conclusion. • “Can anyone be found with an exciting life?” • $X(exciting(W))
Resolution Proof • Clause forms of “exciting life” 1. poor(X) Ú Øsmart(X) Ú happy(X) 2. Øread(Y) Ú smart(Y) 3. read(john) Øpoor(john) 4. Øhappy(Z) Ú exciting(Z) 5. Øexciting(W)
Summary of this lecture • In this lecture we have • Converting Clause Form • Resolution Proof