Information Technology Reference
In-Depth Information
If john is a child of sue then sue is a parent of john.
If john is a child of gina then gina is a parent of john.
If gertrude is a child of heathcliff then heathcliff is a parent of gertrude.
and all the (infinitely many) other sentences of this form. So one needs to be able to
draw the same conclusions from the one sentence with variables as would be drawn
from all the other sentences with constants in them.
From the point of view of back-chaining, here is what this use of variables amounts
to. Suppose the query
Q
is
george is a parent of sue.
Step 2 in figure 2.2 says to check whether the KB has a sentence of the form
If . . . then george is a parent of sue.
The KB does not have a conditional sentence for this particular
Q
, but it does have a
sentence
If . . . then Y is a parent of X.
This is considered to
match
the
Q
at step 2, so at step 3, the relevant
Y
is
george
and
the relevant
X
is
sue
. Here is the result:
The query
Q
at step 2 is
george is a parent of sue.
The KB contains
If X is a child of Y then Y is a parent of X
.
This is considered to match for
Y=george
and
X=sue
.
The query
P
1
at step 3 is
sue is a child of george
.
2.3.2 Tracing the back-chaining
The following four examples simulate the execution of the back-chaining procedure
on four sample queries. This is called
tracing
the procedure and is very similar to
what was done with arithmetic in chapter 1. Note the step numbers as you follow the
procedure.
Example 1
Establish the query
jane is a child of sue
.
1.
Look for
jane is a child of sue
in the KB.
Found.
Return
success
for
jane is a child of sue
.