Computers in Industry 20 (1992) 153-161 Elsevier
153
Knowledge Engineering
Default logic: A practical approach to expert systems Mario T. Tabucanon
a, viias Wuwongse b and Naresh Juneja a
a Division of Industrial Engineering and Management, t, Division of Computer Science, Asian Institute of Technology, Bangkok, Thailand Received January 2, 1992 Accepted February 10, 1992 This work views the task of diagnosis as a case of implementing defaults. We describe an integrated environment, in which a diagnostic problem is decomposed thiough the use of Least Exception Logic (LEL) and the solution to the resulting problem is obtained using Integer Linear Programming (ILP). A causal modelling procedure further enumerates the solution to verify whether the assumptions made in formulating the problem are consistent with the solution. The procedure cycles with an advanced set of assumptions (derived as a cumulative result of previous diagnostic cycles) each time to generate more solutions in case no fault can be isolated. The developed system is used in diagnosis of CNC machines.
Keywords: Expert systems; Default logic; Causal modeling; Knowledge engineering; Least exception logic; CNC
1. Introduction Expert systems (ES) for diagnosis represent a new generation of software which is directed towards devising a pragmatic solution to a very complex task. The work, especially in the area of technical diagnosis, has gained tremendous impetus in recent years. The confentrated effort from various research groups towards developing effective and efficient problem solvers and the fact Correspondence to: Prof. Mario T. Tabucanon, Division of Industrial Engineering and Management, Asian Institute of Technology, P.O. Box 2654, Bangkok 10501, Thailand. Fax: 66-2-5245697.
that many of these projects are funded by manufacturing organizations is a clear indication that these systems are the only answer to complexities involved in the dynamically changing manufacturing world [1]. Systems like DART [2], DIGS [3], CHECK[4], RM [5], DESm [6], and GDE [7] have ushered in a new era of "second generation" expert systems. These systems are based on the representation of the precise structure and behavior (causal models) of the device being modelled. The architecture for these systems is based on a heuristic focussing component, augmented by a causal modelling phase for detailed investigation. Hence, this forms a two-layered problem solving methodology which has been accepted as a standard approach towards addressing the issues involved in a diagnostic task. Some salient requirements for a diagnostic task, as effected through expert systems, are: (i) knowledge elicitation from experts, (ii) reasoning in the face of uncertainty, i.e, reasoning based on making the retracting assumptions, (iii) the need to make decisions by revising the problem and generating alternate paths of reasoning each time, and (iv) diagnosing multiple faults.
2. Existing approach We further distinguish between the reasoning paradigms under the "second generation" as two
0166-3615/92/$05.00 © 1992 - Elsevier Science Publishers B.V. All rights reserved
154
KnowledgeEngineering
different approaches: (i) based on "first principles", where causality is represented in the form of electronic components, like adders, which are integrated to build the device (e.g. DART [2]), and (ii) based on structure and behavior of the device being modelled in the causal modeling process (e.g. CHECK[4]). All these approaches use some sort of graphor network-based technique for knowledge representation, and then employ detailed inference strategies like test generation [8], establishing conflict sets [4], and examining signal ways [5,6], to establish the fault. These systems involve very complex knowledge representation and inference techniques making it imperative that the task of developing an expert system be done by knowledge engineers.
Mario T. Tabucanon is Professor of Industrial Engineering and Management at the Asian Institute of Technology. He has published extensively in the areas of production management, manufacturing systems modeling, and multiple criteria decision making. He is Asia-Pacific Editor of the International Journal of Production Economics and a Member of the Editorial Board of four other reputable international journals.
Vilas Wuwongse is an Associate Professor of Computer Science at the Asian Institute of Technology. He gained his D Eng in Systems Science from the Tokyo Institute of Technology in 1982. His research interests include knowledge engineering, natural language processing and decision support systems.
Naresh Juneja is a Systems Engineer at the Asian Institute of Technology. He obtained his graduate study in Industrial Engineering and Management and for many years he has worked as a Maintenance Engineer in an industrial company in India. His present areas of interests are in expert systems and modeling of production systems.
Computers in Industry
3. Proposed framework
We now propose a reasoning methodology which not only addresses all the issues involved in performing a diagnostic task, but also simplifies the knowledge elicitation and representation tasks. The first step towards establishing a practical approach to diagnosis is to realize that diagnosis is a problem of defaults. A default [9] corresponds to the process of deriving conclusions based upon patterns of inference of the form "in absence of any information to contrary, assume... ". Reasoning of this kind then allows representing a form of plausible inference whenever conclusions must be drawn despite the absence of total knowledge about a world. It is in the framework of default reasoning that we propose the use of Least Exception Logic (LEL) [10] as a tool for effecting a solution to a diagnostic problem. The system also incorporates a causal modelling [11] component which performs the detailed test phase for a diagnostic problem. If the problem is not solved in the causal modelling phase, the process of diagnosis cycles back to effect more feasible solutions based on a revised set of beliefs.
4. Problem definition
An ES application starts by defining the problem, i.e, a domain for which the ES offers a practical solution. The objective for the study carried out [11] was to effect a diagnosis, where the domain was compromised by CNC machines. The two important features of a diagnostic problem which need to be highlighted here are as follows: (i) it is an ill defined problem, i.e, mapping from symptoms to fault locations may not be clearly defined; (ii) it is an open problem, i.e, the problem definition would span both the problem formulation and the solution stage. For the study carried out, a local company was used as knowledge source. This company had a job shop type of setup, employing roughly 100 CNC machines. The company was in the fourth year of its operation, employing 700 people. The significance of this information becomes evident as we go into the actual implementation details of the ES.
Computers in Industry
M.T. Tabucanon et al. / Default logic
5. Identifying the methodology
INTEGERLINEARPROGRAMMING(ILP)
The Least Exception Logic, as conceived by Post and Sage [10], provides a very convenient tool for representing empirical knowledge in the framework of default reasoning [9]. Given a hypothetical conflict set of plausible diagnoses, the methodology explicitly identifies defaults and exceptions as a first step towards narrowing the search space for problem solution. The defaults identified are possible faults which are assumed as true in ease there is no evidence which explicitly contradicts the selection of the default. Exceptions are only enforced when there is evidence to the exception being effective for the problem being addressed. The problem is a vector of all symptoms identified by the technician working on the machine. This representation in the form of defaults and exceptions then forms the basis for the knowledge elicitation process. The basic task now is to do the following: (i) identify possible diagnoses associated with each symptom, and (ii) differentiate between defaults and exceptions. The solution methodology for modelling defaults, in the framework of LEL and Integer Linear Programming (ILP), involves both a prob-
LEASTEXCEPTIONLOGIC
LEL DEFAULTREASONING
"1
I UNIFICATIONi PROCESS
I
SOLUTION PROCESS
t
I r[
155
I ADDS NEW OBJECTIVE FUNCTIONTERMS
I
ADJUSTSTHE SOLUTION TO THE NEWLY INSTANTIATEDDATA Fig. 1. Least Exception Logic (LEL): One-step solution.
I
MAKES CONCLUSIONS MAINTAINSLOGICALCONSISTENCY
,-I
ORDERS MULTIPLEEXTENSIONS
II
1'
~A
EXTN.WITH LEASTEXCEPTION IS SELECTED (IN THE FORMOF DEFEATEDBELIEFS)
v COST HEURISTIC GUIDANCE NEURAL NETWORK ARC WEIGHTS DEMPSTERSHAFER BELIEF PROBABIUTY
Fig. 2. Integer Linear Programming(ILP) as inferencemechanism.
lem formulating and a problem solving phase. In other words, the problem formulated by LEL is solved as a 0-1 ILP to effect a solution. The cycle repeats if the problem is not solved, with more constraints and objective function terms added to the ILP phase. Thus each cycle addresses a revised problem which reflects the change in an expert's decision based on newly instantiated conditions. Figures 1 and 2 give a layout of the solution methodology as effected through LEL.
5.1. LEL / I L P general model The one-step solution strategy, as described in Fig. 1, involves reasoning at two different levels. LEL, as a problem formulating strategy, identifies constraints and the objective function terms, with the solution being revised incrementally at every step to the newly instantiated conditions. The ILP maintains consistency of the system of constraints and orders all extensions. The extension with the least exceptions in the form of defeated beliefs is enforced as the solution. Figure 3 shows the different levels and the interaction between them for the proposed solution methodology using the L E L / I L P link.
156
KnowledgeEngineering
Computers in Industry
0 or 1, depending on the fact whether the element from the sample space is a valid outcome of an event s / i n the set SS; DD is an m x k matrix, whose elements are elements of set D. It is reasonable to assume that this matrix is a logical outcome of the scenario as set up in the previous phase. The problem has now been defined. It has the form of events and a hypothetical set of outcomes. A feasible solution to the problem defined is one which emerges from consistent truth value assignments to the elements in the scenario. A binary semantic tree is a very useful representation for checking the validity of a set of consistent truth value assignments [13]. Figure 4 shows a binary semantic tree and the logic behind using this representation. The branches left open represent the valid interpretations, and " x " indicates as inconsistent truth value assignment. This representation has much more significance than what probably is apparent at this stage of the problem solving process. The branch and bound strategy used to effect a
A general model for reasoning through L E L / I L P then involves: (i) sample space of symptoms and diagnoses, and (ii) a scenario which is the framework for problem definition in the form of identified symptoms and instantiated diagnoses (unification phase of the solution through LEL). Let S be the set of all possible symptoms. Let D be the set of all diagnoses. The sample space is then constituted by the union of S and D. Let SS be the matrix that represents the identified symptoms which form the pre-requisite to starting a diagnostic task. Let D O be the matrix which corresponds to the possible faults associated with symptoms is SS. A mathematical representation of the reasoning logic as conceived in the framework of LEL wc',ld be as follows:
[1
× SS - A X D D ] ,
where 1 is a unit k x k matrix; SS is a k × 1 matrix, where each element is an event, A is a k × m matrix whose elements can take the value
I
PROBLEM DEFINITION
IDENTIFY L SYMPTOMS -
NO
I
REFORMULATE I
ILP .J........ SOLUTION "1__ 0
PROELEM
l
CONFLICT
1~ NO
RESOLUTION
LEL I UNIFICATION I PHASE I
j
I
.I
SENSITIVITY
"i
ANALYSIS NO
~PRO~L~q~ CAUSAL MODELLING
I
I
I REFORMULATE I [ PROBLEM
A
YES
Fig. 3. Layout of the expert system.
YES
Computers in Industry
M.T. Tabucanon et al. / Default logic
solution in ILP works on similar lines. It prunes those which are not consistent with the sets of constraints (constraints which define the scenario or the problem at hand). The process of inference then involves identification of the m o s t likely interpretation for a given scenario. LEL thus provides a very effective and efficient strategy for problem formulation in the form of production rules (predicate calculus) and solution as an ILP problem. The mathematical model formulated is of the form
needs addressing two important issues, namely (i) knowledge elicitation, representation and solution, and (ii) actual development and testing of the application being designed. We take up the issue of knowledge elicitation first. It involves extracting the relevant knowledge from experts and other sources. In our study the knowledge elicitation was done at two different levels: the experts from the factory, and the trouble shooting manuals available with the machines. The manuals were used to identify the symptoms. The experts were then required to identify the possible set of diagnoses associated with each symptom as the first step towards problem formulation. This step was not very difficult as the association from symptoms to diagnosis could be verified from the trouble shooting manual for the machine. The task of differentiating between the defaults and exceptions was the next step towards formulating the problem. The differentiation of defaults and exceptions was done through a paired ranking on a scale of 0 to 1. (This task is where an expert's knowledge is actually tested and forms the major area of interaction with the experts.) The manual was then used to cross-check if the fault locations identified as a mapping for any symptom was complete, i.e, to identify other diag-
Min Z = A' x [DD] T, subject to
[Ix SS-A xDD]
6. The implementation framework Having decided on the methodology, the implementation of an expert system for diagnosis
S~ { P, P ~ Q , Q }
~Q)
Eil
157
°I l ,~, X
Consistent truth value assignments Inconsistent solutions
Fig. 4. A semantic tree.
158
KnowledgeEngineering
Computers in Industry
noses which would be a part of the mapping from any given symptom into the set of all possible diagnoses. The incompleteness of the expert's knowledge could be attributed to the lack of experience of the plant experts. The factory was a new setup and the technicians where still in the process of learning. The trouble shooting manual proved to be a very valuable guide in augmenting the expert's knowledge and also in enhancing the capability of the expert system to account for faults that are difficult to isolate. Having set up the basic framework for knowledge elicitation, the next task in building an expert system is to identify a convenient knowledge representation scheme. A rule structure of the following form was used for this purpose: IF SYMPTOM
(S,) THEN
DIAGNOSIS (D,, Pi) OR EXCEPTION (Dj, PPj).
The problem formulated in the general framework of the model developed is solved as a 0-1 minimization problem of ILP. The solution was effected in the form of an extension with least exceptions (in the form of defeated beliefs). The ILP also orders all consistent extensions. In other words it makes an ordered list of solutions which can be made effective in case the user is ready to pay a higher penalty in the form of accepting exceptions. 6.1. The CNCEXPERT
The expert system developed during this study has been named CNCEXPERT. It has been implemented using LPA PROLOG as the AI language. The rules defined have the following format: DIAGNOSIS( Sj, ( D k , P ) ):SYMPTOM(S i, PP), P is A.
where i = 1 to n for n symptoms identified, and j = 1 to k identifies possible exceptions associated with each symptom.
I I I I
where P is a numerical factor to indicate the expert's confidence in the diagnosis being en-
I USER INTERFACE
SYMPTOM IDENTIFICATION
I I I
RULE BASED KNOWLEDGE BASE ....
SET UP SEARCH SPACE SYMPTOM CONFLICTRESOLUTION
.
t C INTERFACE
PROLOG PROGRAM
ANALYSE RESULTS
1 1
I_ II
FORMULATEPROBLEM FOR ILP
CONTROL SOLUTION FOR PROBLEMSET UP BY LEL
XA ILP PACKAGE
FRAME STHUCTURES
i
L_
SENSITIVITY ANALYSIS
CAUSAL MODELLING
Fig. 5. The CNCEXPERT.
I I. i" I
Computers in Industry
forced; PP dictates the expert's confidence in the symptom identified, i.e, if PP is less than 1, it indicates that the associated symptom may be a manifestation of some other fault condition; S i is a symptom; and D k is a diagnosis which is a valid mapping for the symptom Si. The symptoms identified have been categorized into three different levels: (i) Major symptoms identify a major system failure condition, like NO POWER TO NC, DIFF O V E R ALARM etc. (ii) Minor symptoms: are the ones identified after a major fault is indicated, like a tripped B R E A K E R , o r a n A L A R M light, etc. (iii) Symptoms which may be manifestations of other symptoms, like cPu ALARM may be a manifestation of NO POWER TO NC. They basically come under the category of minor symptoms. This differentiation is very useful in case the ILP fails to identify a feasible solution and there is a need to withdraw certain symptoms which, in the expert's opinion, are either redundant or contradictory. A very important requirement during implementation of the system was to identify all the diagnoses possible for the symptom identified as a major symptom. At level (i) the associated diagnosis in the form of defaults and exceptions should be comprehensive, i.e, it should be able to explicitly identify the fault locations. As mentioned earlier this knowledge was available in the trouble shooting manual which provided complete trouble shooting charts and related details. After the symptom identification (see Fig. 5), the next task in building an expert system is to generate a conflict set of possible fault locations. In the CNCEXPERTthe rule-based knowledge base then sets up the search space in which the diagnosis is to be effected. A c-language interface then sets up the system of equations and the objective function to be minimized as a 0-1 ILP. The LP package XA is used to effect a solution from the system of equations as set up by the c-language interface. The CNCEXPERT at this stage may encounter any of the following situations: (i) a feasible solution acceptable to the user, (ii) a feasible solution not acceptable to the user, or (iii) a non-feasible solution. The first case would mean that the problem is solved, or the user can go further into a detailed
M.T. Tabucanon et al. / Default logic
159
modelling phase of causal modelling (see Fig. 5) to ascertain the actual fault location. In case (ii), the user may use sensitivity analysis and ask the system to provide alternate paths of reasoning, i.e, an alternate feasible solution. In case (i~i), the system goes into automatic conflict resolution for symptoms and reformulates the problem for the ILP phase to effect a solution. It is evident from the above discussion that the CNCEXPERT, in the framework of default reasoning, is able to address all the critical issues involved in the diagnostic task. It is capable of: (i) reasoning under uncertainty, (ii) of being nonmonotonic, i.e, generating alternate paths of reasoning, and (iii) identifying multiple faults. The complexities of knowledge representation have been resolved through the use of a very simple classification structure based on defaults and exceptions. A very crude ranking scheme coupled to the in-built sensitivity analysis for the ILP phase is able to develop a very powerful reasoning application for reasoning under uncertainty.
7. Results
The basic assumptions which were made in implementing the solution strategy through the L E L / I L P link, are as follows: (i) Fault identification was carried out at the sub-system level, i.e, at NC POWER UNIT, LDU UNIT, etc. (ii) All connections were assumed to be working normally, i.e, the faults were assumed to be those that were localized to the components only. The~e assumptions were relaxed later in the causal moddii~,g phase of the CNCEXPERT, with reasons based o,l modelling the structure and behavior of the c evice under diagnosis [11]. The work on 2NCEXPERT has shown that default logic is able to provide a very practical framework for p~oblem solving. The issues addressed by this reasoning procedure not only simplify the knowledge elicitation and knowledge representation process, but also make the inference mechanism semi-automated, a procedure based on algorithms.
160
Knowledge Engineering
8. Conclusions In developing the CNCEXPERT, there were some areas to which we were unable to direct the desired level of effort, although these areas would be able to provide much deeper insight into the methodology, for reasoning based on the L E L / I L P process. Hence some recommendations for further investigation are as follows: (i) The weighted ranking of diagnosis on a 1-point scale has no justification. What is warranted here is a detailed ranking scheme based on techniques which have their roots either the probability theory or certain neural network based schemes. (ii) Sensitivity analysis would be a very powerful tool in providing a much deeper insight into the strengths of this solution methodology. (iii) No work was done in this study to specifically ascertain the size of the problem which would be handled in practical time. A diagnostic problem needs to be solved in the shortest possible time and therefore an estimate of the time needed to solve it must be made. (iv) The ILP solution process using XA is not an efficient technique as would be desired for a problem solving task. A more mature and efficient solution would be effected through a solution procedure based on matrices (see the Appendix).
References [1] V.D. Majstrorovi~, "Expert systems for diagnosis and maintenance: State-of-the-art", Computers in Industry, Vol. 15, 1990, pp. 43-68. [2] M.R. Genesereth, "The use of design description in automated diagnosis", Artif Intell., Vol. 24, 1984, pp. 411-436. [3] V. Sugrev, D. Dochev, C. Dicht,v, G. Agre and Z. Markov, "An approach to building technical diagnostic expert systems", Comput. Artif. Intell., Vol. 5, 1986, pp. 103-105. [4] L. Console and P. Torasso, "Hypothetical reasoning in causal models", Int. J. Intell. Syst., Vol. 5, 1990, pp. 83-124. [5] N.S. Lee, "A computational paradigm that integrates rule-based and model-based reasoning in expert systems", Int. J. lntell. Syst., Vol. 5, 1990, pp. 135-151. [6] A. Storr and A. Wiedmann, "DESlS--An expert system shell for diagnosis", Computers in Industry, Vol. 15, 1990, pp. 69-81.
Computers in Industry [7] J. de Kleer and B.C. Williams, "Diagnosing multiple faults", Artif Inteil., Vol. 32, 1987, pp. 97-130. [8] R. Davis, "Diagnostic reasoning based on structure behaviour", Artif. Intell., Vol. 24, 1984, pp. 347-410. [9] R. Reiter, "A logic for default reasoning", Artif. Intell., Vol. 13, 1980, pp. 81-132. [10] S. Post and A.P. Sage, "Default reasoning using least exception logic", Inf. Decis. Technol., Vol. 16, 1990, pp. 43-68. [11] N. Juneja, "An expert system for diagnosis of CNC machines: Using default reasoning", Master's Thesis, Division of Industrial Engineering and Management, AIT, Bangkok, Thailand. [12] S. Post, "Simultaneous evaluation of expert system rules to find most likely solutions", Government Syrup. on Expert System Applications, McLean, Virginia, 1986, pp. 298-302. [13] N.J. Nilsson, "Probabilistic logic", Artif. Intell., Vol. 28, 1986, pp. 71-87.
Appendix In this section we formulate a small problem to illustrate the problem formulation and solution
process as effected by the L E L / I L P solution process. We further reason as to why a solution process effected through the use of matrices would be a :lit,re effective and efficient solution process than using the ILP. In L E L / I L P the problem is defined when the matrix SS of symptoms identified has been formed. Let the matrix SS be [S~, $2, Sa]. Here S~ is a major symptom and S 2 and S 3 are symptoms at a higher level of refinement than S~. Let the matrix D' be completely defined by [DI, D2, D 3, D 4, D 5,/)6]. D ' is the pre-enumerated matrix in which the solution in the form of a diagnosis is to be found. The problem formulated would have the form, S l - D l - D 2 - D 3 - D 4 - D 5 - D 6<0, S2 - D I S3 -
D ! -
- D 3 - D4 D 2
-
D 4
- D~ < 0, -
D 6
<0.
We see that all the diagnoses in D' are associated with S~, while with S 2 and S 3, only the ones which are direct consequences of these symptoms have been defined. This then forms the system of equations which need to be solved to effect a solution for the given problem. The next task would be to define the associated matrix of weighted rankings associated with
Computers in Industry
M.T. Tabucanon et al. / Default logic
each of these diagnosis. Let A' represent this matrix: 0.1 0.7 0.4
0.6 0.0 0.2
0.8 0.2 0.0
0.4 0.5 0.5
0.7 0.0 0.0
0.9 0.7 0.7
(the lower figures indicate the more likely faults). The objective function which needs to be minimized is now defined by Z = 1.2D~ + 0.8D 2 + 1.0D 3 + 1.4D 4 + 0.7D 5 + 2.3D 6. The solution as effected by ILP would be D l at a cost of 1.2, as the other diagnoses D 2, D 3, and D 5 are not consistent solutions. The sensitivity analysis would effect D 4 and D 6 as other consistent and feasible solutions.
161
A similar solution could be effected using a matrix notation and the two matrices needed are shown below: 1 1 1 0.1 0.7 0.4
1 0 1
1 1 0 0.6 0.0 0.2
1 1 1 0.8 0.2 0.0
1 0 0
1 1 1 0.4 0.5 0.5
0.7 0.6 0.0
0.9 0.7 0.7
We see that D~, D 4 and 0 6 a r e the only consistent solutions, while D 2, D 3 and D 5 are inconsistent solutions. The associated are available from the matrix A', and hence we can directly effect a solution for the problem. Similarly sensitivity analysis may be carried for the consistent solutions for the above problem.