Running the Export tool with the contact lens dataset generates a knowledge base which may be loaded and run in shells such as NEXPERT (Rappaport, 1987a,b) and Babylon (Christaller, Primio & Voss, 1989) as a complete expert system. Figure 9 shows three class definitions for the NEXPERT shell which classify the rules produced by Induct as a class concerned with determining the value of the lens recommendation attribute, which is a sub-class of those concerned with the domain of contact lens prescription, which is a subclass of the general class of Rules. The class of rules has one property, a Boolean hypothesis, which is inherited by its subclasses. This class structure makes the rules and their hypotheses themselves knowledge structures subject to the addition of further properties as required for more complex control structures. The objective is for the tool to generate model code, not just output that will run, but knowledge that is well-structured for further development and embedding in larger systems.
Figure 9 Rule class and subclass definitions from contact lens dataset
Figure 10 shows the top level control rule generated. It uses the class of Rules defined in Figure 9 in a pattern-matching clause that tests whether the hypothesis of any rule is true. The global hypothesis of this rule is also put on the list of suggestions in the shell so that this rule may be triggered very simply.
Figure 10 The top level control rule
Figure 11 shows the class definition that transfers the primary knowledge structure about the class of cases defined by the dataset. It is followed by meta-slot definitions, of which one is shown, giving the prompts that the shell should use in requesting the values of attributes. These are followed by the instantiation of one object in the class that may be used as a test case.
Figure 11 Case class definition, prompting and instantiation
Figure 12 shows the first of the rules of Figure 7 generated by Induct translated into NEXPERT knowledge base format. The first line instantiates a rule object for the rule. The left hand side tests the premise of the rule with an added test to determine whether the value of the attribute to be set on the right hand side of the rule is already known.
Figure 12 Induced rule transferred to NEXPERT
The meta-slot INFCAT (inference category) of the hypothesis for the rule is set in the final line to 10098. This is generated from the probability of the rule being correct times 100 plus the lowest priority of the attributes tested in the left hand side of the rule (98 for the expensive to test attribute, tear production--rest are set to 99). When executing the top level control rule defined in Figure 8, the shell prioritizes the pattern-matching based on the value of this meta-slot, testing hypotheses with the highest values first. Thus rules with the greatest probability of being correct are tested first, and among those of equal probability the ones that require the values of only higher priority attributes are tested first.
This priority system, together with the test for the value of an attribute being known, ensures that values of attributes are set by the rules most likely to be correct and that the values of low priority attributes are not asked unnecessarily. In particular, this strategy implements default reasoning since default rules are usually of high occurrence but with some probability of being incorrect, while exception rules are of lower occurrence but higher probability of being correct.
gaines@cpsc.ucalgary.ca 19-Sep-95