Information Technology Reference
In-Depth Information
The names of the variables in the sentences of the knowledge base do not really
matter; they can be changed at any time.
For example,
If X is a child of Y then Y is a parent of X.
says exactly the same thing as
If U is a child of V then V is a parent of U.
and exactly the same thing as
If Var13 is a child of Var19 then Var19 is a parent of Var13.
All these sentences make precisely the same connection between child and parent .
So to keep variables in a query distinct from those used in a KB, the variables in the
KB can be renamed without changing what the sentences are saying. Thus, during
back-chaining, whenever there is a query with variables, the variables in the sentences
of the KB will be renamed to ensure that they differ from the ones in the query. (They
could be renamed in the query instead, but this is not done here.)
To see this renaming in action, consider the trace shown in figure 2.3 for the query
george is a father of Y . Let us review the steps:
1.
There is nothing in the KB that matches this query.
2.
There is a conditional to consider. However, the names of its variables conflict
with Y in the query, so first change them to U and V . After this renaming, there
is a match as before with U=Y and V=george .
3.
After U and V are replaced by their matching values, there are two subqueries
remaining: Y is a child of george and george is male . Note that after replacing the
variables by their matching values, there is still the variable Y to deal with.
1.
Look for Y is a child of george in the KB. The KB does not contain this sentence
literally. But it does contain a matching sentence, from which Y gets the value
sue . So this query succeeds with Y=sue .
2.
The query george is male then succeeds straightforwardly.
Since both of these queries succeed, the query george is a father of Y succeeds
with Y=sue . This means that george is a father of sue has been established and is
logically entailed by the KB.
 
Search WWH ::




Custom Search