Here's the "proud" problem, in First Order Logic : forall (adult,baby) parent(adult,baby) and newborn(baby) => proud(adult) forall (adult, baby) father(adult,baby) => parent(adult,baby) forall (adult, baby) mother(adult,baby) => parent(adult,baby) father(adam,mary) newborn(mary) And the question to be resolved is exists (adult) proud(adult) i.e., is there a proud parent? And if so, who? ------------------------------------------------------ Here are the steps, as described in the text, pg 296 and following, to convert a first order logic sentence to CNF form and then apply our resolution procedure. (1) eliminate implications. * as in predicate logic, (A => B) becomes ((not A) or B) (2) move "not" inwards * rules are (not (forall (x) S)) becomes (exists (x) (not S)) (not (exists (x) S)) becomes (forall (x) (not S)) * and from predicate logic (not (A and B)) becomes ((not A) or (not B)) (not (A or B)) becomes ((not A) and (not B)) (3) make sure there are no duplicate dummy variable names in sentences * this ((forall (x) funky(x)) or (forall (x) weird(x))) becomes ((forall (x) funky(x)) or (forall (y) weird(y))) (4) skolemize * replace all "exists" variables with a newly-invented function that depends on the "forall" variables around it. If there are no forall's around it, replace with a newly-invented constant. * (exists (x) P(x)) becomes P(A) where A is a newly-invented constant. * (forall (y) (exists (x) P(x))) becomes (forall (y) P(A(y))) where A(y) is the newly-invented function (5) drop all the universal quantification. (forall (y) P(A(y))) becomes P(A(y)) (6) distribute "and", "or" so its (... or ... or ...) and (... or ...) * the rule is A or (B and C) becomes (A or B) and (A or C) "The sentence is now in CNF." "It is quite unreadable." Given all this, how do we prove something? As before: * add the negation of the proposition to the logic base, and * try to infer a contradiction. What are the inference rules? Again, pretty much as before, we want add new "facts" by combining existing ones where one term is the negation of the other. So if our knowldge base has (A or B) and (C or not B) then we want to add a new conclusion (A or C) The complication is now that these terms may contain variables and skolemization functions - the procedure needs to recognize that they may be unified, find the subsitution that unifies them, apply the substitution, and then add the new "fact". The variable substitution (the "unification") must be applied to the whole line. For example, if the database is Animal(F(x)) or Loves(G(x),x) not Kills(u,v) or not Loves(u,v) then the unification is (u -> G(x), v -> x) and the new sentence to add to the database is Animal(F(x)) or not Kills(G(x), x)) Be clear that doing this means looping over all pairs in two different lines and searching for any possible unification - this is in general a big search. If a proof exists, this procedure must find it ... eventually, if the search is completed. In practice, in may not be practical to search the whole space.