logging in or signing up Resolution_in_FOL aSGuest4427 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 22 Category: Business & Fin.. License: All Rights Reserved Like it (0) Dislike it (0) Added: November 28, 2008 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Artificial Intelligence—15-381Unification and Resolution in FOL : Artificial Intelligence—15-381Unification and Resolution in FOL Jaime Carbonell 11-February-2003 OUTLINE: Q/A by matching (partial unification) Full term unification in FOL FOL in clause form (with Skolemization) FOL Robinson Resolution Uses and limitations of Resolution Answering Questions by Matching : Answering Questions by Matching Full Unification (variables on both sides) : Full Unification (variables on both sides) Variable-Variable Matching P(x) P(y) Q(x,x) Q(y,z) P(f(x),z) P(y, Fido) Unifiers: Variable Substitutions P(x) P(y) {y/x} Q(x,x) Q(y,z) {y/x, z/x} P(f(x),z) P(y,Fido) {y/f(x), z/Fido} Consistent Variable Assignments P(Mary,John) P(y,y) # R(x,y,y) R(y,y,z) {y\z, x\y} W(P(x),y,z) W(Q(x),y,Fido) # Advantages of Full Unification Query and data => both fully allow variables Permits full FOL Resolution (next) Unification : Unification Q(x) P(y) FAIL P(x) P(y) x/y P(Marcus) P(y) Marcus/y P(Marcus) P(Julius) FAIL P(x,x) P(y,y) (y/x) P(y,z) (z/y , y/x) Finding General Substitutions : Finding General Substitutions 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) Algorithm: Unify(L1,L2) : Algorithm: Unify(L1,L2) A Predicate Logic Example : A Predicate Logic Example Marcus was a man. man(Marcus) Marcus was a Pompeian. Pompeian(Marcus) All Pompeians were Romans. x: Pompeian(x)Roman(x) Caesar was a ruler. ruler(Caesar) All Romans were either loyal to Caesar or hated him. x: Roman(x) loyalto(x, Caesar) V hate(x,Caesar) Everyone is loyal to someone. x: y: loyalto(x,y) People only try to assassinate rulers they aren't loyal to. x:y:person(x) ruler(y) tryassassinate(x,y) loyalto(x,y) Marcus tried to assassinate Caesar. tryassassinate(Marcus, Caesar) All men are people. x: man(x) person(x) Conversion to Clause Form : Conversion to Clause Form Problem: x: [Roman(x) know(x,Marcus)] [hate(x,Caesar) V (y:z: hate(y,z) thinkcrazy(x,y))] Solution: Flatten Separate out quantifiers Conjunctive Normal Form: Roman(x) v know(x,Marcus) v hate(x,Caesar) v hate(y,z) v thinkcrazy(x,z) Clause Form Conjunctive normal form No instances of Algorithm: Convert to Clause Form : Algorithm: Convert 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) x P(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 Functions in FOL Objective Want all variables universally quantified Notational variant of FOL w/o existentials Retain implicitly full FOL expressiveness 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 : 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) V thinkcrazy(x,y))] Reduce scope of . x: [ Roman(x) V know(x, Marcus)] V [hate(x,Caesar) V (y: z: hate(y,z) V thinkcrazy(x,y))] “Standardize” variables: x: P(x) V x: Q(x) converts to x: P(x) V y: Q(y) Move quantifiers. x: y: z: [Roman(x) V know(x, Marcus)] V [hate(x,Caesar) V (hate(y,z) V thinkcrazy(x,y))] Examples of Conversion to Clause Form : 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) know(x,Marcus)] V [hate(x, Caesar) V ( hate(y,z) V thinkcrazy(x,y))] Convert to a conjunction of disjuncts. Roman(x) V know(x,Marcus) V hate(x,Caesar) V hate(y,z) V thinkcrazy(x,y) The Basis of Resolution and Herbrand's Theorem : The Basis of Resolution and Herbrand's Theorem Given: winter V summer winter V cold We can conclude: summer v cold Herbrand's Theorem: To show that a set of clauses S is unsatisfiable, it is necessary to consider only interpretations over a particular set, called the Herbrand universe of S. A set of clauses S is unsatisfiable if and only if a finite subset of ground instances (in which all bound variables have had a value substituted for them) of S is unsatsifable. Algorithm: Propositional Resolution : Algorithm: Propositional 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 step 1. Repeat until either a contradiction is found or no progress can be made: a) Select two clauses. Call these the parent clauses. b) Resolve them together. The resolvent will be the disjunction of all of the literals of both of the parent clauses with the following exception: If there are any pairs of literals L and L such that one of the parent clauses contains L and the other contains L, then select one such pair and eliminate both L and L 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. A Few Facts in Propositional Logic : A Few Facts in Propositional Logic Given Axioms Clause Form P P (1) (P Q) R P V Q V R (2) (S V T) Q S V Q (3) T V Q (4) T T (5) Resolution in Propositional Logic : Resolution in Propositional Logic P V Q V R R P V Q Q P T V Q T T Algorithm: Resolution : 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. A Resolution Proof : A Resolution Proof Axioms in clause form: 1. man(Marcus) 2. Pompeian(Marcus) 3. Pompeian(x1) v Roman(x1) 4. Ruler(Caesar) 5. Roman(x2) v loyalto(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 cont. : Resolution Proof cont. Prove: hate(Marcus, Caesar) hate(Marcus, Caesar) Roman(Marcus) V loyalto(Marcus,Caesar) Marcus/x2 5 3 2 7 1 4 8 Marcus/x1 Pompeian(Marcus) V loyalto(Marcus,Caesar) loyalto(Marcus,Caesar) Marcus/x4, Caesar/y1 man(Marcus) V ruler(Caesar) V tryassassinate(Marcus, Caesar) ruler(Caesar) V tryassassinate(Marcus, Caesar) tryassassinate(Marcus, Caesar) An Unsuccessful Attempt at Resolution : An Unsuccessful Attempt at Resolution Prove: loyalto(Marcus, Caesar) loyalto(Marcus, Caesar) Roman(Marcus) V hate(Marcus,Caesar) Marcus/x2 5 3 2 Marcus/x1 Pompeian(Marcus) V hate(Marcus,Caesar) hate(Marcus,Caesar) Marcus/x6, Caesar/y3 (a) hate(Marcus,Caesar) 10 persecute(Caesar, Marcus) hate(Marcus,Caesar) 9 Marcus/x5, Caesar/y2 (b) : : Using Resolution with Equality and Reduce : Using Resolution with Equality and Reduce Axioms in clause form: man(Marcus) Pompeian(Marcus) Born(Marcus, 40) man(x1) V mortal(x1) Pompeian(x2) V died(x2,79) erupted(volcano, 79) mortal(x3) V born(x3, t1) V gt(t2—t1, 150) V dead(x3, t2) Now=2002 alive(x4, t3) V dead (x4, t3) dead(x5, t4) V alive (x5, t4) died (x6, t5) V gt(x6, t5) V dead(x6, t6) Prove: alive(Marcus, now) Issues with Resolution : Issues with Resolution Requires full formal representation in FOL (for conversion to clause form) Resolution defines a search space (which clauses will be resolved against which others define the operators in the space) search method required Worst case: resolution is exponential in the number of clauses to resolve. Actual: exponential in average resolvable set (= branching factor) Can we define heuristics to guide search for BestFS, or A* or B*? (Not in the general case) You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
Resolution_in_FOL aSGuest4427 Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: (To copy code, click on the text box) Embed: URL: Thumbnail: WordPress Embed Customize Embed The presentation is successfully added In Your Favorites. Views: 22 Category: Business & Fin.. License: All Rights Reserved Like it (0) Dislike it (0) Added: November 28, 2008 This Presentation is Public Favorites: 0 Presentation Description No description available. Comments Posting comment... Premium member Presentation Transcript Artificial Intelligence—15-381Unification and Resolution in FOL : Artificial Intelligence—15-381Unification and Resolution in FOL Jaime Carbonell 11-February-2003 OUTLINE: Q/A by matching (partial unification) Full term unification in FOL FOL in clause form (with Skolemization) FOL Robinson Resolution Uses and limitations of Resolution Answering Questions by Matching : Answering Questions by Matching Full Unification (variables on both sides) : Full Unification (variables on both sides) Variable-Variable Matching P(x) P(y) Q(x,x) Q(y,z) P(f(x),z) P(y, Fido) Unifiers: Variable Substitutions P(x) P(y) {y/x} Q(x,x) Q(y,z) {y/x, z/x} P(f(x),z) P(y,Fido) {y/f(x), z/Fido} Consistent Variable Assignments P(Mary,John) P(y,y) # R(x,y,y) R(y,y,z) {y\z, x\y} W(P(x),y,z) W(Q(x),y,Fido) # Advantages of Full Unification Query and data => both fully allow variables Permits full FOL Resolution (next) Unification : Unification Q(x) P(y) FAIL P(x) P(y) x/y P(Marcus) P(y) Marcus/y P(Marcus) P(Julius) FAIL P(x,x) P(y,y) (y/x) P(y,z) (z/y , y/x) Finding General Substitutions : Finding General Substitutions 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) Algorithm: Unify(L1,L2) : Algorithm: Unify(L1,L2) A Predicate Logic Example : A Predicate Logic Example Marcus was a man. man(Marcus) Marcus was a Pompeian. Pompeian(Marcus) All Pompeians were Romans. x: Pompeian(x)Roman(x) Caesar was a ruler. ruler(Caesar) All Romans were either loyal to Caesar or hated him. x: Roman(x) loyalto(x, Caesar) V hate(x,Caesar) Everyone is loyal to someone. x: y: loyalto(x,y) People only try to assassinate rulers they aren't loyal to. x:y:person(x) ruler(y) tryassassinate(x,y) loyalto(x,y) Marcus tried to assassinate Caesar. tryassassinate(Marcus, Caesar) All men are people. x: man(x) person(x) Conversion to Clause Form : Conversion to Clause Form Problem: x: [Roman(x) know(x,Marcus)] [hate(x,Caesar) V (y:z: hate(y,z) thinkcrazy(x,y))] Solution: Flatten Separate out quantifiers Conjunctive Normal Form: Roman(x) v know(x,Marcus) v hate(x,Caesar) v hate(y,z) v thinkcrazy(x,z) Clause Form Conjunctive normal form No instances of Algorithm: Convert to Clause Form : Algorithm: Convert 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) x P(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 Functions in FOL Objective Want all variables universally quantified Notational variant of FOL w/o existentials Retain implicitly full FOL expressiveness 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 : 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) V thinkcrazy(x,y))] Reduce scope of . x: [ Roman(x) V know(x, Marcus)] V [hate(x,Caesar) V (y: z: hate(y,z) V thinkcrazy(x,y))] “Standardize” variables: x: P(x) V x: Q(x) converts to x: P(x) V y: Q(y) Move quantifiers. x: y: z: [Roman(x) V know(x, Marcus)] V [hate(x,Caesar) V (hate(y,z) V thinkcrazy(x,y))] Examples of Conversion to Clause Form : 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) know(x,Marcus)] V [hate(x, Caesar) V ( hate(y,z) V thinkcrazy(x,y))] Convert to a conjunction of disjuncts. Roman(x) V know(x,Marcus) V hate(x,Caesar) V hate(y,z) V thinkcrazy(x,y) The Basis of Resolution and Herbrand's Theorem : The Basis of Resolution and Herbrand's Theorem Given: winter V summer winter V cold We can conclude: summer v cold Herbrand's Theorem: To show that a set of clauses S is unsatisfiable, it is necessary to consider only interpretations over a particular set, called the Herbrand universe of S. A set of clauses S is unsatisfiable if and only if a finite subset of ground instances (in which all bound variables have had a value substituted for them) of S is unsatsifable. Algorithm: Propositional Resolution : Algorithm: Propositional 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 step 1. Repeat until either a contradiction is found or no progress can be made: a) Select two clauses. Call these the parent clauses. b) Resolve them together. The resolvent will be the disjunction of all of the literals of both of the parent clauses with the following exception: If there are any pairs of literals L and L such that one of the parent clauses contains L and the other contains L, then select one such pair and eliminate both L and L 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. A Few Facts in Propositional Logic : A Few Facts in Propositional Logic Given Axioms Clause Form P P (1) (P Q) R P V Q V R (2) (S V T) Q S V Q (3) T V Q (4) T T (5) Resolution in Propositional Logic : Resolution in Propositional Logic P V Q V R R P V Q Q P T V Q T T Algorithm: Resolution : 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. A Resolution Proof : A Resolution Proof Axioms in clause form: 1. man(Marcus) 2. Pompeian(Marcus) 3. Pompeian(x1) v Roman(x1) 4. Ruler(Caesar) 5. Roman(x2) v loyalto(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 cont. : Resolution Proof cont. Prove: hate(Marcus, Caesar) hate(Marcus, Caesar) Roman(Marcus) V loyalto(Marcus,Caesar) Marcus/x2 5 3 2 7 1 4 8 Marcus/x1 Pompeian(Marcus) V loyalto(Marcus,Caesar) loyalto(Marcus,Caesar) Marcus/x4, Caesar/y1 man(Marcus) V ruler(Caesar) V tryassassinate(Marcus, Caesar) ruler(Caesar) V tryassassinate(Marcus, Caesar) tryassassinate(Marcus, Caesar) An Unsuccessful Attempt at Resolution : An Unsuccessful Attempt at Resolution Prove: loyalto(Marcus, Caesar) loyalto(Marcus, Caesar) Roman(Marcus) V hate(Marcus,Caesar) Marcus/x2 5 3 2 Marcus/x1 Pompeian(Marcus) V hate(Marcus,Caesar) hate(Marcus,Caesar) Marcus/x6, Caesar/y3 (a) hate(Marcus,Caesar) 10 persecute(Caesar, Marcus) hate(Marcus,Caesar) 9 Marcus/x5, Caesar/y2 (b) : : Using Resolution with Equality and Reduce : Using Resolution with Equality and Reduce Axioms in clause form: man(Marcus) Pompeian(Marcus) Born(Marcus, 40) man(x1) V mortal(x1) Pompeian(x2) V died(x2,79) erupted(volcano, 79) mortal(x3) V born(x3, t1) V gt(t2—t1, 150) V dead(x3, t2) Now=2002 alive(x4, t3) V dead (x4, t3) dead(x5, t4) V alive (x5, t4) died (x6, t5) V gt(x6, t5) V dead(x6, t6) Prove: alive(Marcus, now) Issues with Resolution : Issues with Resolution Requires full formal representation in FOL (for conversion to clause form) Resolution defines a search space (which clauses will be resolved against which others define the operators in the space) search method required Worst case: resolution is exponential in the number of clauses to resolve. Actual: exponential in average resolvable set (= branching factor) Can we define heuristics to guide search for BestFS, or A* or B*? (Not in the general case)