82
Formal Logic
The database in an expert system attempts to capture the knowledge (“elicit
the expertise”) of a human expert in a particular field, including both the facts
known to the expert and the expert’s reasoning path in reaching conclusions
from those facts. The completed expert system not only simulates the human
expert’s actions but can be questioned to reveal why it made certain choices and
not others.
Expert systems have been built that simulate a medical specialist’s diagnosis
from a patient’s symptoms, a factory manager’s decisions regarding valve control
in a chemical plant based on sensor readings, the decisions of a fashion buyer for a
retail store based on market research, the choices made by a consultant specifying
a computer system configuration based on customer needs, and many more. The
challenging part of building an expert system lies in extracting all pertinent facts
and rules from the human expert.
S e c t I o n 1 . 5 Review
tecHnIQueS
• Formulate Prolog-like facts and rules.
• Formulate Prolog-like queries.
• Determine the answer(s) to a query using a Prolog
database.
MAIn IdeA
• A declarative language incorporates predicate wffs
and rules of inference to draw conclusions from
hypotheses. The elements of such a language are
based on predicate logic rather than instructions
that carry out an algorithm.
W
W
eXeRcISeS 1.5
Exercises 1–8 refer to the database of Example 39; find the results of the query in each case.
1. ?animal(wildcat)
2. ?plant(raccoon)
3. ?eat(bear, littlefish)
4. ?eat(fox, rabbit)
5. ?eat(raccoon, X )
6. ?eat(X, grass)
7. ?eat(bear, X ) and eat(X, rabbit)
8. ?prey(X ) and not eat(fox, X )
9. Formulate a Prolog rule that defines “herbivore” to add to the database of Example 39.
10. If the rule of Exercise 9 is included in the database of Example 39, what is the response to the query
?herbivore(X )
11. After infoodchain is added to the database of Example 39, add the facts eat(wolf, fox) and eat(wolf, deer).
What is the result of the query
?eat(wolf, X ) and not eat(X, grass)
12. After the modifications in Exercise 11, what is the result of the query
?infoodchain(wolf, X )
Précédent

- 99/986

Suivant