0% found this document useful (0 votes)
3 views

07 Resolution Annot

The document discusses the principles of deductive inference methods in artificial intelligence, focusing on the resolution method for determining the validity of knowledge bases (KB). It explains how to transform formulas into conjunctive normal form (CNF) and the process of deriving new clauses through resolution. Additionally, it covers implications of clauses, the correctness of resolution, and the handling of first-order logic with quantifiers.

Uploaded by

leimu.864
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

07 Resolution Annot

The document discusses the principles of deductive inference methods in artificial intelligence, focusing on the resolution method for determining the validity of knowledge bases (KB). It explains how to transform formulas into conjunctive normal form (CNF) and the process of deriving new clauses through resolution. Additionally, it covers implications of clauses, the correctness of resolution, and the handling of first-order logic with quantifiers.

Uploaded by

leimu.864
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Resolution

Introduction to Artificial Intelligence


© G. Lakemeyer

G. Lakemeyer

Winter Term 2024/25


Deduction at the Knowledge Level
What should a deductive inference method compute?
Given a KB and ↵, determine whether KB|=↵ holds, or, given an open wff
↵(x1 , x2 , . . . , xn ), find t1 , t2 , . . . , tn such that

KB|=↵(t1 , t2 , . . . , tn ).

(ti are closed terms)

A KB is usually finite, i.e., KB = {↵1 , . . . , ↵k }. Hence,


© G. Lakemeyer

KB|=↵ iff |=[(↵1 ^ . . . ^ ↵k ) ↵]


iff KB [ {¬↵} is unsatisfiable
iff KB [ {¬↵}|=FALSE
--fx(X x)
=

Hence we are looking for a mechanism which either tests for validity, satisfiability,
or checks whether FALSE can be inferred.
We will now look at just such a method, using a language very close to FOL
(ignoring quantifiers for now).
AI/WS-2024/25 2 / 38
Clausal Form

Formulas: are sets of clauses.


Clauses: are sets of literals.
are atomic sentences or their negation
Literals:
(positive or negative literals).

Notation:
© G. Lakemeyer

If l is a literal, then ⇠ l is its complement:

⇠ p ) ¬p , ⇠ (¬p) ) p

To distinguish clauses from formulas:


use [ and ] for clauses: [p, ⇠ r , s]
use { and } for formulas: {[p, ⇠ r , s], [p, r , s], [⇠ p]}
[ ] is the empty clause, {} the empty formula.

AI/WS-2024/25 3 / 38
Interpreting clauses as FOL-formulas
t
first-orde logic
A formula is understood as a conjunction of clauses.
A clause is understood as a disjunction of literals.
Literals have their usual meaning.

Hence,
© G. Lakemeyer

{[p, ⇠ q ], [r ], [s]} represents ((p _ ¬q ) ^ r ^ s).


[ ] represents FALSE.
{} represents TRUE.

In general, every formula (in the new sense) represents a wff in conjunctive
normal form.

AI/WS-2024/25 4 / 38
CNF and DNF

Tranformation to CNF
Every propositional wff ↵ can be converted to an ↵0 in conjunctive normal
form (CNF) such that |=↵ ⌘ ↵0 .
1 Eliminate and ⌘ with ↵ ) (¬↵ _ ) etc. up)
Push ¬ “inwards” with ¬(↵ ^ ) ) (¬↵ _ ¬ ) etc. En(ang) = (av
© G. Lakemeyer

3 Distribute _ over ^ with ((↵ ^ ) _ ) ) ((↵ _ ) ^ ( _ )).


4 Simplify: (↵ _ ↵) ) ↵, ¬¬↵ ) ↵, etc.

The result is a conjunction of disjunctions of literals.


Similarly, any wff can be transformed into an equivalent disjunctive normal
form (DNF).
Note : Rule 3 can lead
to an exponential
blauhp
AI/WS-2024/25 5 / 38
CNF and Clausal Form

CNF wffs can be identified with clausal forms:

(p _ ¬q _ r ) ^ (s _ ¬r ) ) {[p, ⇠ q , r ], [s, ⇠ r ]}.


© G. Lakemeyer

Hence: given a finite KB and ↵, in order to test whether KB|=↵ holds, it


suffices to do the following:
1 Transform (KB ^ ¬↵) into CNF.
2 Test whether this CNF is satisfiable.
Let KB = Ex , , ..., Las

CNF (KB1 + 2) = CNF / :


)n (NF(k) n ...
-
(NECGic)n(NF(na)
AI/WS-2024/25 6 / 38
The Inference Rule of Resolution
Resolvent
Given two clauses, infer a new clause:
From {p} [ C1 and {⇠ p} [ C2 infer C1 [ C2 .
C1 [ C2 is called the resolvent of the input clauses relative to p.
© G. Lakemeyer

AI/WS-2024/25 7 / 38
The Inference Rule of Resolution
Resolvent
Given two clauses, infer a new clause:
From {p} [ C1 and {⇠ p} [ C2 infer C1 [ C2 .
C1 [ C2 is called the resolvent of the input clauses relative to p.

Example:
The resolvent of [w , p, q ] and [w , s, ⇠ p] relative to p is [w , q , s].
© G. Lakemeyer

Special case:
[p] and [⇠ p] resolve to [ ]. (C1 and C2 are empty.)

AI/WS-2024/25 7 / 38
The Inference Rule of Resolution
Resolvent
Given two clauses, infer a new clause:
From {p} [ C1 and {⇠ p} [ C2 infer C1 [ C2 .
C1 [ C2 is called the resolvent of the input clauses relative to p.

Example:
The resolvent of [w , p, q ] and [w , s, ⇠ p] relative to p is [w , q , s].
© G. Lakemeyer

Special case:
[p] and [⇠ p] resolve to [ ]. (C1 and C2 are empty.)

Derivation
A derivation of a clause c from a set of clauses S is a sequence c1 , c2 , . . . , cn of
clauses, where cn = c and for all ci ,
1 ci 2 S or
2 ci is a resolvent of cj and ck with j , k < i.

We write S ! c for the derivation of c from S.


AI/WS-2024/25 7 / 38
Why is Resolution Ok?

While resolution is an inference rule at the symbol level, there is a simple


connection to logical interpretations at the knowledge level.
Resolvents are implications of the input clauses.

Suppose I |=(p _ ↵) and I |=(¬p _ ).


Case 1: Let I |=p. Then I |= and hence I |=(↵ _ ).
© G. Lakemeyer

Case 2: Let I |6=p Then I |=↵ and hence I |=(↵ _ ).


Therefore, in any case, I |=(↵ _ ). Thus {(p _ ↵), (¬p _ )}|=(↵ _ ).

AI/WS-2024/25 8 / 38
Why is Resolution Ok?

While resolution is an inference rule at the symbol level, there is a simple


connection to logical interpretations at the knowledge level.
Resolvents are implications of the input clauses.

Suppose I |=(p _ ↵) and I |=(¬p _ ).


Case 1: Let I |=p. Then I |= and hence I |=(↵ _ ).
© G. Lakemeyer

Case 2: Let I |6=p Then I |=↵ and hence I |=(↵ _ ).


Therefore, in any case, I |=(↵ _ ). Thus {(p _ ↵), (¬p _ )}|=(↵ _ ).

Special case:
[p] and [⇠ p] resolve to [ ].
Hence {[p], [⇠ p]}|=FALSE, or, {[p], [⇠ p]} is unsatisfiable.

AI/WS-2024/25 8 / 38
Derivation and Implication (1)

Theorem:
The previous theorem can be generalized to derivations:
If S ! c then S |=c.

Proof idea: Induction over the length of a derivation. Show, using case
© G. Lakemeyer

analysis as above, that S |=c.

AI/WS-2024/25 9 / 38
Derivation and Implication (1)

Theorem:
The previous theorem can be generalized to derivations:
If S ! c then S |=c.

Proof idea: Induction over the length of a derivation. Show, using case
© G. Lakemeyer

analysis as above, that S |=c.

Note:
The converse does not hold, that is, sometimes S |=c holds, yet S ! c does
not hold.
Example: {[⇠ p]}|=[⇠ p, ⇠ q ], i.e. ¬p|=(¬p _ ¬q ). But there is no derivation!

AI/WS-2024/25 9 / 38
Derivation and Implication (2)

On the other hand. . .

Theorem:
Resolution is correct and complete for [ ].

S ! [ ] iff S |=FALSE. LiffS is unsat . )


© G. Lakemeyer

[Theorem can be generalized to formulas with quantifiers (see later)].

Hence we have for arbitrary sets of clauses S:


S is unsatisfiable iff S ! [ ].
Can be turned into a method to test for unsatisfiability (and, therefore,
implication):
Search through the space of derivations and check if [ ] obtains.

AI/WS-2024/25 10 / 38
Computing implications
To determine whether KB|=↵ holds:
transform KB and ¬↵ into CNF (results in S);
test whether S ! [ ] (If KB = {}, then test if ↵ is valid.)

Non-deterministic method:
1 Test if [ ] in S is.
© G. Lakemeyer

If so, then return unsatisfiable.


2 Test if there are clauses c1 , c2 in S resolving to c3 where c3 62 S.
If not, then return satisfiable.
3 Add c3 to S and goto 1.

Note: KB needs to be converted to CNF only once.


Handles multiple queries with the same KB.
If KB is extended by ↵, then only the CNF of ↵ needs to be computed.
AI/WS-2024/25 11 / 38
Example 1
KB = {First_Grade, First_Grade
Kindergarden
& Child, Child ^ Male
Child, Child ^ Female
Boy,
Girl, Female}


Show: KB|=Girl

[First_Grade] [~Child,~Male,Boy]

[~First_Grade,Child] [~Kindergarden,Child]
© G. Lakemeyer

[~Child,~Female,Girl]

[Child]
[Female]

[Girl,~Female]
[~Girl]
(Negation of the query)

[Girl]

AI/WS-2024/25 [] 12 / 38
Quantifiers

Clauses as before, but atoms are P (t1 , . . . , tn ), where ti may contain


variables. (Equality atoms (ti = tj ) are excluded.)

Interpretations as wffs as before, but variables are implicitly understood to be


universally quantified.
Example: {[P (x ), ⇠ R (a, f (b, x ))], [Q (x , y )]}
© G. Lakemeyer

stands for 8x 8y {[R (a, f (b, x )) P (x )] ^ Q (x , y )}.

Substitutions: ✓ = {x1 /t1 , x2 /t2 , . . . , xn /tn }.

Notation: If l is a literal and ✓ a substitution, then l ✓ is the result of the


substitution. (Analogously we define c ✓ for clauses c.)
Ex.: ✓ = {x /a, y /g (x , b, z )}: P (x , z , f (x , y ))✓ = P (a, z , f (a, g (x , b, z ))).
A ground literal is a literal without variables.
A literal l is an instance of l 0 if there is a ✓ such that l = l 0 ✓ .

AI/WS-2024/25 13 / 38
Generalizing CNF

To generalize resolution, we first show how to convert FOL wffs into CNF.

FOL ! CNF
1 Eliminate and ⌘.
2 Push ¬ inside. (¬8x ↵ ) 9x ¬↵ etc.)
3 Rename variables to make them syntactically distinct.
(E.g. 9x [P (x )] ^ Q (x ) ) 9z [P (z )] ^ Q (x ), z a new variable)
© G. Lakemeyer

4 Eliminate 9’s (deferred to later).


5 Move 8’s to the left.
(exampleE.g. ↵ ^ 8x ) 8x [↵ ^ ], where ↵ does not contain x.)
b
6 Distriute _ over ^. (from stop 3)
7 Simplify.

. . . results in quantified conjunctions of disjunctions. (prenex (NF)


To obtain clausal form simply eliminate all 8’s.

AI/WS-2024/25 14 / 38
Clauses with Variables

Main idea:
A literal with variables represents all its instances. We allow inference over all
instances.
Hence, given
[P (x , a), ⇠ Q (x )] and [⇠ P (b, y ), ⇠ R (b, f (y ))],
© G. Lakemeyer

we would like to infer


[⇠ Q (b), ⇠ R (b, f (a))]
because
[P (b, a), ⇠ Q (b)] is an instance of [P (x , a), ⇠ Q (x )] and
[⇠ P (b, a), ⇠ R (b, f (a))] of [⇠ P (b, y ), ⇠ R (b, f (y ))].

AI/WS-2024/25 15 / 38
First-Order Resolution

Given: clauses {l1 } [ C1 and {⇠ l2 } [ C2 .

Rename the variables so that they are different in both clauses.


For every ✓ with l1 ✓ = l2 ✓ we can infer (C1 [ C2 )✓.
=>

We say that l1 and l2 are unifiable or that ✓ is a unifier of the literals.


© G. Lakemeyer

Derivations are defined as before. Then,

Theorem
S ! [ ] iff S |=FALSE.

AI/WS-2024/25 16 / 38
Example 2
KB= {8x CS_Student (x ) Student (x ), 8x Student (x ) WorksHard (x ),
CS_Student (susi )}
Question: WorksHard (susi )

[~Student(x),WorksHard(x)] [~WorksHard(susi)]

x/susi
© G. Lakemeyer

[~CS_Student(x),Student(x)]

x/susi [~Student(susi)]

[CS_Student(susi)]
[~CS_Student(susi)]

(each step can be labelled


AI/WS-2024/25
with a unifier) [] 17 / 38
The 3-Blocks Example Revisited
KB = {On(a, b), On(b, c ), Green(a), ¬Green(c )} (is in CNF!)
F = 9x 9y [On(x , y ) ^ Green(x ) ^ ¬Green(y )]
Note: there are no 9 to eliminate in ¬F,

:
results in {[⇠ On(x , y ), ⇠ Green(x ), Green(y )]} in CNF.

[On(b,c)] [~On(x,y),~Green(x),Green(y)]

[x/b,y/c]
© G. Lakemeyer

[~Green(b),Green(c)] [On(a,b)]
[x/a,y/b]

[~Green(c)] [~Green(a),Green(b)]

[Green(a)]
[~Green(b)]

[(Green(b)]

Note: On(x,y) is needed twice,


corresponds to the two cases
AI/WS-2024/25
[] 18 / 38
Arithmetic +he (+ 1)
O+X = X
(fx + y
= 2 + y =
zt)

KB= {8x Plus(null , x , x ), 8x 8y 8z Plus(x , y , z ) Plus(succ (x ), y , succ (z ))}


F = 9uPlus(2, 3, u ) (here 0 stands for null, 1 for succ (null ), etc.)
[~Plus(x,y,z),Plus(succ(x),y,succ(z))] [~Plus(2,3,u)]

[Plus(0,x,x)] G
x/1,y/3,u/succ(v),z/v


© G. Lakemeyer

[~Plus(1,3,v)]

I
x/0,y/3,v/succ(w),z/w

Note: Not only the [~Plus(0,3,w)]


existence, but also the value
of u (5) is derivable!
x/3,w/3 rename variables
to make them distinct
5
[] u=

AI/WS-2024/25 19 / 38
Answer Extraction

In FOL it is possible to infer 9xP (x ) without inferring P (t ) for any t.


e.g. in the 3-blocks problem:
9x 9y [On(x , y ) ^ Green(x ) ^ ¬Green(y )] follows,
yet we cannot say which block it is.
© G. Lakemeyer

Solution: Answer-predicates
Replace the query 9xP (x ) by 9x [P (x ) ^ ¬A(x )],
where A (the answer predicate) occurs nowhere else.
Instead of inferring [ ] infer a clause which contains only the answer predicate.
Still results in a sound and complete inference method.

AI/WS-2024/25 20 / 38
Example Using an Answer Predicate

KB= {Student (jack ), Student (susi ), Happy (jack )}


Query: 9x [Student (x ) ^ Happy (x )]

[Happy(jack)] [~Student(x),~Happy(x),A(x)]
© G. Lakemeyer

[Student(jack)]
[~Student(jack),A(jack)]

[A(jack)] An answer: Jack

AI/WS-2024/25 21 / 38
Disjunctive Answers
Example: KB= {Student (jack ), Student (susi ), Happy (jack ) _ Happy (susi )}

Query: 9x [Student (x ) ^ Happy (x )]

[Student(susi)] [~Student(x),~Happy(x),A(x)] [Student(jack)]

x/susi x/jack
© G. Lakemeyer

[~Happy(susi),A(susi)] [~Happy(jack),A(jack)]

[Happy(jack),Happy(susi)]

[Happy(jack),A(susi)]

Susi
i
o

[A(susi),A(jack)]
Note: Variables may appear in the answer.
AI/WS-2024/25 for the blocks world : [Ala bl Alb c)
.
,
,
22 / 38
Skolemization

So far we ignored 9 when converting into CNF.


e.g: 9x 8y 9zP (x , y , z )
Idea: Make up names for those individuals. These are called
Skolem-constants and -functions.
There is an x: call it a.
For all y there is an z: call them f (y ).
© G. Lakemeyer

Then we get 8yP (a, y , f (y )).


In general:
8x1 (8x2 (. . . 8xn (. . . 9y [. . . y . . .] . . .) . . .))
is replaced by
8x1 (8x2 (. . . 8xn (. . . [. . . f (x1 , x2 , . . . , xn ) . . .] . . .) . . .)),
where f is a function symbol occurring nowhere else.

AI/WS-2024/25 23 / 38
Why Skolemization is Ok

Skolemizations is not equivalence preserving.


e.g.: |6=9xP (x ) ⌘ P (a). FP(a) > Fx P(x)
# 7x P(x)3P(a)
Let <D .>
© G. Lakemeyer

Let I' be like I


D 21 24 = .

& (a) = 2 except that(a) = I

& (M) = G(k) the If Ex(X)

If 7 x P(X) and I'f P(a)


IHP(a)
AI/WS-2024/25 24 / 38
Why Skolemization is Ok

Skolemizations is not equivalence preserving.


e.g.: |6=9xP (x ) ⌘ P (a).

But satisfiability is retained:


© G. Lakemeyer

Theorem
↵ is satisfiable iff ↵0 is satisfiable, where ↵0 is the result of Skolemization.

That is sufficient for resolution!

AI/WS-2024/25 24 / 38
A Problem the
it X+ 1 <
y Xy
KB= {8x 8yLessThan(succ (x ), y ) LessThan(x , y )}
F = LessThan(null , null ) should fail because KB|6=F .
[LessThan(x,y),~LessThan(succ(x),y)]

[~LessThan(0,0)]
© G. Lakemeyer

x/0,y/0

[~LessThan(1,0)]

... x/1,y/0

[~LessThan(2,0)]

x/2,y/0

...
An infinite branch of resolvents! Simple DFS won’t work to derive [ ].
AI/WS-2024/25 25 / 38
Undecidability

Is it possible in general to detect infinite branches?

No! FOL is too powerful.


FOL is as expressive as Turing machines.
The above problem is as hard as the Halting Problem.
© G. Lakemeyer

There is no function which does the following:


Function FOL-Sat [clauses] =
If clauses are unsatisfiable
then return YES
else return NO.

AI/WS-2024/25 26 / 38
Resolution is Complete
If the set of clauses is unsatisfiable, then there is a branch with [ ] as a leaf
node.
© G. Lakemeyer

...
...
infinite
... []
branches

Hence Breadth-First Search guarantees that [ ] will be found if derivable.


Search does not necessarily terminate if the clauses are satisfiable.

) Satisfiability in FOL is semi-decidable.

AI/WS-2024/25 27 / 38
Too Specific Unifiers
Termination or even efficiency cannot be guaranteed in general,
. . . but there is room for improvement.

One possibility:
Reduce search redundancy by keeping the search as general as possible.

Example:
© G. Lakemeyer

[. . . , P (g (x ), f (x ), z )] [⇠ P (y , f (w ), a), . . .] is unifiable with


✓1 = {x /b, y /g (b), z /a, w /b}
yields: P (g (b), f (b), a)
but also with
✓2 = {x /f (z ), y /g (f (z )), z /a, w /f (z )}
yields: P (g (f (z )), f (f (z )), a)

Sometimes [ ] is not derivable because of too specific substitutions.


AI/WS-2024/25 28 / 38
Most General Unifier
MGU
✓ is a most general unifier (MGU) of the literals l1 and l2 iff
1 ✓ unifies l1 and l2
2 for every unifier ✓0 there is a substitution ✓⇤ such that ✓0 = ✓✓⇤

Example:
© G. Lakemeyer

In the previous example the MGU is


✓ = {x /w , y /g (w ), z /a}
and therefore
✓1 = ✓{w /b}
✓2 = ✓{w /f (z )}

The MGU in unique up to

names
of variables .
AI/WS-2024/25 29 / 38
Most General Unifier
MGU
✓ is a most general unifier (MGU) of the literals l1 and l2 iff
1 ✓ unifies l1 and l2
2 for every unifier ✓0 there is a substitution ✓⇤ such that ✓0 = ✓✓⇤

Example:
© G. Lakemeyer

In the previous example the MGU is


✓ = {x /w , y /g (w ), z /a}
and therefore
✓1 = ✓{w /b}
✓2 = ✓{w /f (z )}

Theorem
Resolution is complete when restricted to MGUs.
AI/WS-2024/25 29 / 38
Computing the MGU

Computing the MGU for a set of literals li :


1 Start with ✓ = {}.
2 If all li ✓ are identical, then success: ✓ is the MGU.
Otherwise look for the disagreement set DS,
e.g. P (a, f (a, g (z ), . . . P (a, f (a, u , . . .
DS = {u , g (z )}.
© G. Lakemeyer

3 Find a variable v 2 DS and a term t 2 DS which does not contain v (occur


check). Otherwise abort: not unifiable. DS =
,
X
(f(x) g(yi3
✓ = ✓{v /t } DS 4X
f(xX
4 =

5 Goto 2.

AI/WS-2024/25 30 / 38
Computing the MGU g(x ,, y ..., Xn)

J(xn- Xml)

of
9)f(x ,
Yo) , .. ..
. ..

Computing the MGU for a set of literals li :


1 Start with ✓ = {}.
X .
/f(x0 ,
Xo)

2 If all li ✓ are identical, then success: ✓ is the MGU. X2(f(f(X0 x0) f(x x) , , ,

Otherwise look for the disagreement set DS, E


e.g. P (a, f (a, g (z ), . . . P (a, f (a, u , . . .
DS = {u , g (z )}.
© G. Lakemeyer

3 Find a variable v 2 DS and a term t 2 DS which does not contain v (occur


check). Otherwise abort: not unifiable.
4 ✓ = ✓{v /t }
5 Goto 2.
is
this
alg. exponential in 19 .... On

Note:
There are faster linear MGU-algorithms.

(never used because


of orehead
AI/WS-2024/25 30 / 38
Example t .
=

j(f(x ,
g(x y)) ,
,
h(z , x)
ta =

j) z
, h(f(n - v) , flaid)
1 .
DS =
g(x y)))
Gz , f(x , ,

0 : =
(z)f(x g(x y))) ,

Sy
,

<, 0 =

j(f(x g(x y)) h(f(x y(x y))


, ,
, , , ,

t20
j(f(x g(x h(ffabs)
© G. Lakemeyer

=
,
, 3) ,

2 .
DS =
EX u),

0 : =
0(u/X]
3 .
DS =
(v g(x y)) , ,

0 : =
04r(g(x y) ,

4 .
DS = y , Scably
AI/WS-2024/25 31 / 38
Herbrand Theorem

Sometimes FOL theories (sets of FOL sentences) can be transformed into


propositional sentences.

Let S be a set of clauses.


The Herbrand universe of S is the set of all terms which can be formed from the
the functions and terms in S.
© G. Lakemeyer

e.g.: if S contains the unary function f and constants c and d, then


U = {c , d , f (c ), f (d ), f (f (c )), f (f (d )), f (f (f (c ))), . . .}.
the Herbrand base of S is
{c ✓ | c 2 S and ✓ replaces variables by terms from the Herbrand univ.}.

AI/WS-2024/25 32 / 38
Herbrand Theorem

Sometimes FOL theories (sets of FOL sentences) can be transformed into


propositional sentences.

Let S be a set of clauses.


The Herbrand universe of S is the set of all terms which can be formed from the
the functions and terms in S.
© G. Lakemeyer

e.g.: if S contains the unary function f and constants c and d, then


U = {c , d , f (c ), f (d ), f (f (c )), f (f (d )), f (f (f (c ))), . . .}.
is s does not mention constant
the Herbrand base of S is if the invent
{c ✓ | c 2 S and ✓ replaces variables by terms from the Herbrand univ.}.
one

Theorem
S is satisfiable iff the Herbrand base is satisfiable.

AI/WS-2024/25 32 / 38
Data
When is This Useful?
Hom clause

clans wat
f
=
most 1 P

Herbrand bases have no variables and are therefore propositional, but they
are generally infinite.
finite if the Herbrand universe is finite;
© G. Lakemeyer

sometimes type restrictions can be used to obtain a finite Herbrand basis.


) use f (t ) only if t is of the right type.
Exty Father(x) =

y Perm(x)
> - Male(y) +X + y
Fy Male(s) (g-johnvy ben ...
Eyes
=
: =

Ey Perm(x) = (x =
johnr
+
X

..
V
= mayvX = ben
-
sles out "silly" substitutions

AI/WS-2024/25
Sathe (favorite
mans) >
wrong
type33 / 38
Resolution is Hard!

First-order resolution does not always terminate.

What about the propositional case? -usedthe nenciple


Armin Haken showed that there are clauses {c1 , . . . , cn } such that the shortest
derivation of [ ] contains 2n clauses.
Methods based on Resolution run in exponential time (in the worst case).
© G. Lakemeyer

(and space
Is that a problem only of resolution?
Probably not!
Testing satisfiability of propositional clauses (SAT) is NP-complete [Cook 1971].
While not proven it seems unlikely that NP-complete problems can be solved in
polynomial time.
exist
but SAT-Solven
that can handle millions of
causes ,

AI/WS-2024/25 34 / 38
What Does That Mean for KR?

Problem: The entailments of a KB are usually only useful when they can be
derived fast.
Entailment in FOL is probably too hard for KR.
What to do?
Leave search control to the user.
© G. Lakemeyer

Use less expressive languages (examplee.g. Horn clauses)

Note: Sometimes it’s ok to wait a long time (e.g. when proving mathematical
theorems).

In any case, it is important to avoid redundancies, or in general, to tune


resolution in order to shorten the search.

AI/WS-2024/25 35 / 38
Strategies for Resolution

1. Eliminating clauses
Pure clauses
A clause contains a literal l, and ⇠ l occurs nowhere.
Such a clause can never help to derive [ ].
Tautologies [p -p]
© G. Lakemeyer

Clauses which contain both a literal and its negation


are useless in deriving [ ].
Subsumed clauses
A clause which contains a superset of the literals of another clause:
- only the shorter clause is needed to derive [];
- can be generalized to allow for substitutions.

[a ,
b ,
~c] subsumes [b ,
a
,
ud ,
~c
,
e]

AI/WS-2024/25 36 / 38
Strategies 2

2. Ordering strategies
There are many ways to vary the order of search; a simple and effective way is
the unit clause preference Cclauses with I literal
Always try to resolve with unit clauses first, since those always “shorten” the
resolvent.
© G. Lakemeyer

3. Set of support
KB is usually satisfiable. Thus it makes little sense to resolve two clauses whose
ancestors are from the KB only.
Contradictions result from the interaction with the negation of the query (¬F).
Hence it is appropriate to require that one of the input clauses has an ancestor in
¬F.

AI/WS-2024/25 37 / 38
Strategies 3

4. Operators with a sense of direction


[⇠ p, q ] can be interpreted in two ways.
from p infer q (forward)
to derive q first derive p (backward)
© G. Lakemeyer

In the first case


one would only resolve [⇠ p, q ] with [p, . . .] to obtain [q , . . .].
In the second case
one would only resolve [⇠ p, q ] with [⇠ q , . . .] to obtain [⇠ p, . . .].

Ex Battle Ship (x)


a any
>Gray
Vx HasFlu > Has Fever(x
use backward to explain fewer
AI/WS-2024/25 38 / 38

You might also like