Expert System Shells - Examples
Expert System Shells - Examples
EMYCIN: Shell taken from MYCIN, backward chaining, uncertainty factors, explanation facility CLIPS: Public doman ESS from NASA, combines three paradigms: rule-base, object-oriented, procedural JESS: Successor to CLIPS, entirely in Java, can execute Java code
JESS
LISP-like notation expressions are written as whitespace separated lists delimited by parentheses, e.g., (a b c), (+ 2 3) Variables are identifiers that begin with a question mark, e.g., ?color Every fact has a template (something like a Java class). Fields are called slots and are unordered.
Template Example
The template construct creates templates:
(deftemplate automobile a specific car (slot make) (slot model) (slot year (type INTEGER)) (slot color (default white)))
Jess (cont'd)
To add a fact to working memory, we assert it, e.g., (assert (spicy chili)) To assert several facts at once, we can use the deffacts construct:
Jess (cont'd)
To add a fact to working memory, we assert it, e.g., (assert (spicy chili)) To assert several facts at once, we can use the deffacts construct:
Defining Rules
Note that the if-part is not executed, but is a pattern that is matched against the working memory.
Special Functions
The printout function is used to print out information: (printout t I chose ?x . crlf) The t means standard output. The reset function re-initializes the working memory. The run function cause the inference engine to start. (watch all) traces rule execution.
which would restrict the firing of this rule to a particular stage in the inference.
Heuristic Control
Similarly, heuristic control of the rules could be built in. Rules can be group, and only certain rules fired under given conditions by asserting the appropriate facts in the working memory (and retracting them when necessary).
Uncertainly
Some expert systems allow for uncertainty in their deductions. Both evidence and rules have uncertainly factors. The uncertainty of the facts that trigger a rule is combine with the uncertainty of the rule itself to derive the uncertainty of the conclusion. See MYCIN.
Model-Based Reasoning
An alternative to rule-based reasoning is model-based reasoning. Here, a model or simulation is used to test hypotheses under different conditions. The model is using a computer program whose parameters are accessible and changeable by the expert system. An example might be a computer simulation of a logic device where a faulty component may be creating an error.
Case-Based Reasoning
An alternative approach to both rule- and modelbased reasoning in case-based reasoning. A library, or database, of previously solved cases is kept. The current problem is compared to the database by matching salient features. The best match or matches are used. The previous solution is adapted to the present case.
CBR (cont'd)
The steps in case-bases reasoning are: Retrieve appropriate cases from memory Modify a retrieved case to apply to the current problem Apply the transformed case Save the new solution along with a record of success or failure
CBR (cont'd)
Difficulties include: How do you match cases? Do the features have to be identified beforehand and indexex? What does similarity mean? Slows down past a point when cases are added.
CBR - Example
ARCHIE is an interactive design-aiding system for architectural design. It supports construction and evaluation of solutions. Users specify their problem descriptions and/or solution descriptions; the system retrieves and displays past designs and provides suggestions and warnings. (Kolodner)