IF614 – Inteligensia Semu 07 / 01 - 10 5.4 Resolution 5.4.1 Conversion to Clause Form Problem : x:[Roman(x)know(x,Marcus)] [hate(x,Caesar) (y:z:hate(y,z)thinkcrazy(x,y)] Solution : Flatten Separate out quantifiers Conjunctive Normal Form : Roman(x)know(x,Marcus) hate(x,Caesar) hate(y,z) thinkcrazy(x,z) Clause Form : Conjunctive Normal Form No instances of BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 02 - 10 Algorithm : Convert to Clause Form 1. Eliminate ,using : a b= a b. 2. Reduce the scope of each to a single term, using : (p) = p de morgan’s laws : (ab) = a b (ab) = a b x : P(x) =x : P(x) x : P(x) = x : P(x) 3. Standardize variables. 4. Move all quantifiers to the left of the formula without changing their relative order. 5. Eliminate existential quantifiers inserting Skolem functions. by 6. Drop the prefix. 7. Convert the matrix into a conjuction of disjuncts, using associativity and distributivity. BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 8. Create a conjuct. separate 07 / 03 - 10 clause for each 9. Standardize 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) Examples of Conversion to Clause Form Example : x : [Roman(x) know(x,Marcus)] [hate(x,Caesar)(y :z:hate(y,z) thinkcrazy(x,z))] 1. Eliminate . x :[Roman(x)know(x,Marcus)] [hate(x,Caesar)(y : (z : hate(y,z)) thinkcrazy(z,y))] 2. Reduce scope of . x :Roman(x) know(x,Marcus)] [hate(x,Caesar) (y : z : hate(y,z) thinkcrazy(x,y))] BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 04 - 10 3. Standardize variables. x : P(x) x : Q(x) will be convert to x : P(x) y : Q(y) 4. Move quantifiers. x : y : z :[Roman(x) know(x,Marcus)] [hate(x,Caesar) (hate(y,z) thinkcrazy(x,y))] 5. Eliminate existential quantifiers. y : President(y) will be convert to President(S1) while x : y : father-of(y,x) will be converted to x : father-of(S2(x),x) 6. Drop the prefix. [Roman(x) know(x,Marcus)] [hate(x,Caesar) (hate(y,z) thinkcrazy(x,y))] 7. Convert to a conjuction of disjuncts. Roman(x) know(x,Marcus) hate(x,Caesar) hate(y,z) thinkcrazy(x,y) BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 05 - 10 5.4.2 The Basis of Resolution Given : winter summer winter cold We can conclude : summer cold 5.4.3 Resolution in Propositional Logic A Few Facts in Propositional Logic Given Axioms P (P Q)R (S T)Q Clause Form P P Q R S Q T Q T T (1) (2) (3) (4) (5) BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 06 - 10 Resolution in Propositional Logic P Q R R P Q T Q P Q T T BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 07 - 10 5.4.4 The Unification Algorithm Unification Q(x) P(x) FAIL P(x) P(y) x/y P(Marcus) P(y) Marcus/y P(Marcus) P(Julius) FAIL P(x,x) P(y,z) (y/x) P(y,y) (z/y)(y/x) BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 08 - 10 Finding General Substitution Given : hate(x,y) hate(Marcus,z) We could produce : (Marcus/x, z/y) (Marcus/x, y/z) (Marcus/x, Caesar/y, Caesar/z) (Marcus/x, Polonius/y, Polonius/z) 5.4.5 Resolution in Predicate Logic Example : 1. man(Marcus) 2. man(x1) mortal(x1) Yields the substitution : Marcus/x1 So it does not yield the resolvent : mortal(x1) It does yield : mortal(Marcus) BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 09 - 10 Algorithm : Resolution 1. Convert all the proposition of F to clause form. 2. Negate P and convert the result to clause form. Add it to the set of clause in step 3. Repeat until either a contradiction is found or no progress can be made,or a predetermined amount of effort has been expended. (a) Select two clause. Call these the parent clauses. (b) Resolve them together. The resolvent will be the disjunction of all of the literals of both parent clauses with appropriate substitutions performed and with the following exception: If there is one pairs 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 ommitted 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 clause available to the procedure. BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999 IF614 – Inteligensia Semu 07 / 010 - 10 5.4.6 The Need to Try Several Substitutions 5.4.7 Question Answering 5.5 Natural Deduction BINA NUSANTARA Edisi : 1 Revisi : 3 Sept - 1999