AI-09-Resolution in FOL
AI-09-Resolution in FOL
Resolution in FOL
By: 1
Boreshban [email protected]
Outline
• Theorem Proving in First Order Logic
• Unification
• Resolution
Resolution in FOL
4. Replace existentials
Consider: (Y X p(X,Y))
The identity of X depends on the value of Y.
We can replace X by a function of Y:
(Y p(g(Y),Y)) where g is a Skolem function
Skolemization
• Replace each occurrence of an existentially
quantified variable by a Skolem function.
• The function’s arguments are the universally
quantified variables that are bound by universal
quantifiers whose scope includes the scope of the
existential quantifier being eliminated.
• The Skolem functions must be new, i.e., not
already present in any other sentences.
• If the existential quantifier is not within a
universal quantifier, use a Skolem function of no
arguments, i.e., a constant.
Examples of Skolemization
6. Distribute disjunctions
Write the formula in conjunctive normal form
(the conjunction of sets of disjunctions) with:
j \/ (y /\ q) becomes (j \/ y) /\ (j \/ q)
7. Replace operators
• Replace the conjunction
S1 /\ S2 /\ …. /\ Sn
with the set of clauses S1 , S2 , …, Sn
• Convert each Si into a set of literals (that is, get
rid of the disjunctions symbols “ \/”, and write
them in clause notation.
Ex: (p(X) \/ q(Y)) /\ (p(X) \/ ~r(X,Y))
becomes two clauses:
{p(X), q(Y)}
{p(X), ~r(X,Y)}
8. Rename variables
Change variable names so that no variable symbol
appears in more than one clause:
Ex: {p(X), q(Y)} and {p(X), ~r(X,Y)}
becomes {p(X), q(Y)} and {p(Z), ~r(Z,W)}
we can do this because:
X Y(p(X) \/ q(Y)) /\ (p(X) \/ ~r(X,Y))
is equivalent to
X Y(p(X) \/ q(Y)) /\ Z W(p(Z) \/ ~r(Z,W))
Example
Example
Unification -- Substitution
• Unification is the process of determining whether
two expressions can be made identical by
appropriate substitutions for their variables.
• The substitution applies to variables of both
expressions and makes them syntactically
equivalent. The result is a substitution instance
{q} {~q}
{~p,r}