Artificial Intelligence 8. The Resolution Method: Course V231 Department of Computing Imperial College, London Jeremy Gow
Artificial Intelligence 8. The Resolution Method: Course V231 Department of Computing Imperial College, London Jeremy Gow
should be sound: if A
Want
B then A
R to be complete: if A
B then A
Proof by Refutation
1.
2.
Binary
resolution rule
AB, BC
AC
The
resolution rule
AB, CD
Subst(, AD)
How
do we find substitution ?
But
if KB contains non-disjuncts?
of clauses
No
Any
Kowalski
form
(A1 An) (B1 Bn)
Binary
resolution
AB, BC
AC
Resembles
Skolemisation
Replace
by all preceeding U
Known as a unifier
Unifying Predicates
We
For
Unification
Want
an algorithm which:
Example:
isa_list(x)
head(x)
head([a,b,c]) = a
tail(x)
tail([a,b,c]) = [b,c]
args(x)
op(x)
unify(x,y) = unify_internal(x,y,{})
unify_internal(x,y,mu)
unify_variable(var,x,mu)
var is a variable
finds a single substitution (which may be in mu already)
unify_internal
unify_internal(x,y,mu)
---------------------Cases
1.if (mu=failure) then return failure
2.if (x=y) then return mu.
3.if (isa_variable(x)) then return unify_variable(x,y,mu)
4.if (isa_variable(y)) then return unify_variable(y,x,mu)
5.if (isa_compound(x) and isa_compound(y)) then return
unify_internal(args(x),args(y),unify_internal(op(x),op(y),mu))
6.if (isa_list(x) and isa_list(y)) then return
unify_internal(tail(x),tail(y),unify_internal(head(x),head(y),mu))
7.return failure
unify_variable
unify_variable(var,x,mu)
-----------------------Cases
1. if (a substitution var/val is in mu) then
return unify_internal(val,x,mu)
2. if (a substitution x/val is in mu) then
return unify_internal(var,val,mu)
3. if (var occurs anywhere in x) return
failure
4. add var/x to mu and return
An Example Unification
Unification
Q 1 Qn
Arbitrary
number of disjuncts
Relies on preprocessing into CNF
already in CNF
two clauses
P and N missing
Apply to the new clause
Topic
On