Using Polymorphism to Improve Expert Systems Maintainability

Abstract

One of the major problems in maintaining large rule-based expert system is that the functions performed by rules usually are not well specified, which makes rules difficult to comprehend and modify. Polymorphism in object-oriented programming suggests a promising approach for separating the function of a rule from its implementation details, which can be described by methods. However, there are two major difficulties in in tegrating methods and rules. First, methods in conventional object-oriented systems can not describe complex conditions regarding their applicability in an expert system. Second, method dispatching does not provide the flexibility of control that is often desirable for an expert system. To alleviate these difficulties, we have generalized methods in two ways. First, the situation about a method's applicability is described by a conjunctive pattern. Second, each generic operation could specify its own control strategy for the selection of methods. To enable specificity-based method dispatching, we have developed an algorithm for computing a well-defined specificity relation among the generalized methods. Based on these enabling technologies, we have developed a production system where the function of each rule is merely invoking a generic function (i.e., sending a message). Furthermore, we use an advanced knowledge representation language for defining classes. Our approach improves the maintainability of expert systems in several important ways. First, it enhances the modularity of rule-based systems because rules and methods can be easily grouped based on their functions. Second, the automatic classification capability of the knowledge representation language assists the user in main taining a consistent class taxonomy. Finally, it improves the predictability of rules because implicit, heuristic conflict resolution strategies are replaced by explicit control strategies and a principled specificity measure computed by the system.

In IEEE Expert, Vol. 6, No. 2, pp. 48-55, 1991.