Information Technology Reference
In-Depth Information
This version of est now handles almost all of Prolog. (It does not yet work with
numbers or built-in operations like write and assert . Also, it does not do the right
thing when the same variable appears in both the query and knowledge base.) With
a bit more work, any Prolog program and any query can be represented as terms and
used as arguments to a predicate like est . So this program is a language processor for
Prolog: a program that can take a symbolic representation of a Prolog program and
execute it. What takes some getting used to, perhaps, is the fact that this processor
for Prolog is written in the Prolog language itself.
11.2 Explanation
Explanation involves finding an atomic sentence such that if it were true, it would
account for a given sentence's being true. For example, assuming it is known that all
polar bears are white, one would like to be able to explain Thornton's being white by
abducing that he is a polar bear. As it turns out, the final version of the est predicate
from figure 11.6 makes this possible by using a variable A to stand for the new atomic
sentence to be abduced:
?- est([[A],[white(X),polar_bear(X)]],[white(thornton)]).
A = white(thornton)
;
A = polar_bear(thornton)
;
No
The query asks for an atomic sentence A such that if A is added to the knowledge
base, the desired conclusion then follows. There are two such atoms. The first one,
white(thornton) is technically correct but only in a trivial way, so one might not
want to consider it as a possible explanation.
11.2.1 Diagnosis
Imagine that a knowledge base has the following facts:
A person will have sore elbows if she has a tennis elbow or sore joints in general.
Arthritis will also lead to sore joints. A person will have sore hips if she has sore
joints in general or a hip fracture. Only a tennis player will get tennis elbow.
A representation of this knowledge base is shown in figure 11.7. (The predicate
background indicates that this list represents background knowledge.) One can then
look for an explanation for a person Sue's having a sore elbow:
 
Search WWH ::




Custom Search