[Attr]. Using DCG in this fashion, it is easy to implement as friendly a syntax for the knowledge base as desired. The same approach could also be used for the Native system, with DCG that translated English-like rules into Prolog syntax. Now that we have a customized knowledge base and inference engine, it is possible to add other features to the system. The next chapter shows how to add explanations. 1 Add attribute object value triples to the knowledge representation of Clam.
The goal driven approach is practical when there are a reasonable number of possible final answers, as in the case of a diagnostic or identification system. The system methodically tries to prove or disprove each possible answer, gathering the needed information as it goes. The data driven approach is practical when combinatorial explosion creates a seemingly infinite number of possible right answers, such as possible configurations of a machine. 1 Production Systems Forward chaining systems are often called “production” systems.
It serves the same diagnostic purpose as program tracing for conventional programs. When the system is not behaving correctly, the expert can use the explanations to find the rules that are in error. The knowledge Building Expert Systems in Prolog 35 engineer uses the explanations to better tune the knowledge base to have more realistic dialogs with the user. Types of Explanation There are four types of explanations commonly used in expert systems. We will implement most of these in both the Clam shell and the Native shell: • a rule trace, which reports on the progress of a consultation; • explanation of how the system reached a given conclusion; • explanation of why the system is asking a question; • explanation of why not a given conclusion.