Computer Physics Communications 61 (1990) 13—21 North-Holland
13
Domain modelling in second-generation expert systems J. McDonnell Department of Computer Science, Brunel University, Uxbridge UB8 3PH, England
The attractions of incorporating explicit domain models within an expert system are summarised. The essential aspects of qualitative models suitable for reasoning about physical systems in particular are introduced. The form and use of such models is demonstrated through examples. Current limitations of these modelling techniques for reasoning about physical systems are identified. The paper concludes by stating some of the main issues relevant to domain modelling activities.
1. Introduction It has been suggested that many of the limitations of first-generation expert systems can be overcome by systems which incorporate explicit domain models [1]. There is a widely held view that in domain models facts about the domain should be represented without bias towards their use within the system [2]. By including explicit domain models in second-generation expert systems the following benefits might be accrued: • Increased problem-solving flexibility and better system robustness through support for more than one type of problem-solving activity (through provision of appropriate varied knowledge structures). In first-generation expert systems facts are embedded in heuristics in such a way that domain knowledge is not available outside the context of its use in a specific task as part of a particular heuristic association. • The exploitation of the intuitive notion that experts resort to “first principles” when their experience is lacking or when it fails them. • Greater scope for knowledge structuring if facts are grouped into conceptual higher-level components which form an identifiable part of the domain knowledge for a particular system; components could be re-used by other tasks to which they are pertinent, in addition, controlled expan001O-4655/90/$03.50 © 1990
—
sion within a particular task could be handled in a more manageable fashion. • Explicit representation of domain facts could be used to explain or justify conclusions even in situations where heunstics (compiled associations of facts with solutions) are actually used to solve the problem.
2. Qualitative models of physical systems In some knowledge domains it is useful to be able to reason about the behaviour of physical systems. The idea of constructing a mathematical model (e.g. sets of differential equations) to model a physical system is a familiar one, and one not specifically associated with the expert systems building community. In these models numerical or analytical calculations (which will be referred to as quantitative reasoning) are made. A mathematical solution or result is obtained which in some way models the actual behaviour of the physical systern. During the last decade work has been carried out on the development of qualitative models of physical systems. In these the mathematical model is replaced by a structural description of the physical system. Qualitative reasoning is used to provide a behavioural description which reflects the actual behaviour of the physical system itself.
Elsevier Science Publishers B.V. (North-Holland)
J. McDonnell / Domain modelling in second-generation expert systems
14
MATHEMATICAL numerical/analytical 50 MODEL (quantitative reasoning)
j
trepresented by exhibits
PHYSICAL SYSTEM
qualitative
represents
~ ACTUAL BEHAVIOUR
represented
STRUCTURAL DESCRIPTION
MATHEMATICAL ~ SOLUTION
reasoning
I
represents
BEHAVIOURAL DESCRIPTION
Fig. 1. Qualitative and quantitative approaches to modelling. Adapted from ref. [3].
Qualitative and quantitative approaches to modelling are depicted in fig. 1 which is adapted from ref. [3]. The motivation for using qualitative reasoning rather than a quantitative approach may arise in the following situations: • When it is necessary to make inferences on the basis of little information (in such cases a quantitative approach would not be feasible). • In order to be able to express justifications in appropriate terms from the perspective of the human user, there is evidence that in some situations humans reason in terms of qualitative values [4—6]. More natural interaction between system and user may be achieved if the system also expresses its reasoning in this fashion. • Where complete information necessary for quantitative modelling is unavailable or unobtamable, where it is too complex to be used usefully, or where it is irrelevant to the purpose of the modelling exercise. The simple examples of qualitative reasoning which follow illustrate its effectiveness in cornmonplace situations. Firstly, consider the situation when someone forgets to turn off the headlights in a car and leaves the car parked with the lights on overnight. The following morning when the driver realises what he has done he is likely to conclude that the battery of the car will be flat as a result. To reach this conclusion, the driver needs no quantitative information about the number of headlight bulbs, their electrical resistance, the
voltage of the battery or the properties of the connecting wires in the circuit. The second (and often cited) example concerns predicting what will happen when a ball is thrown up into the air. Commonsense allows an average person to predict without difficulty that the ball downrise will again. up in Tothe make air this and prediction then begin no to quantitafall back tive details about the force of gravity, coefficients of friction, force exerted on the ball, etc. is required and yet an adequate qualitative behavioural description can be given. (Much of the work on qualitative reasoning has been motivated from a desire to identify and capture commonsense knowledge about the physical world such as that used in this second example.) Qualitative reasoning operates on a structural description of the physical system being modelled. Any adequate structural description must be suitable for characterising the salient aspects of the physical system’s behaviour. Structural descriptions are commonly cornposed of descriptions of system components, their behaviours, and the connections between components i.e. their relationship with respect to one another in the form of constraints (sometimes which holdexpressed between component behaviours). The behaviour of the system as a whole is described through the interaction of component behaviours propagating through the connections. (This often gives rise to a strong causal flavour in the explanations of behaviour provided from such systems which are based on locally propagated effects.) Currently, the most popular approaches to the representation of physical systems through structural descriptions are characterised by their central emphasis on components [7], processes (changes which occur in physical systems) [8], or constraints [9]. Recently, there has been a move to integrate these approaches to provide a modelling environment which can make use of the strengths of each perspective where appropriate in a given domain [10]. The examples adapted below have been chosen to illustrate the main elements of any qualitative reasoning system rather than to review or compare approaches from different perspectives.
J. McDonnell / Domain modelling in second-generation expert systems
15
2.1. Spatial kinematics
(R3, FLY, DOWN LEFT)
(S5,COLLIDE,DOWN LEFT)
The first example, from the work of Forbus [11] on spatial reasoning and motion, is chosen to illustrate how a qualitative descnption of a physical system can be devised and used to perform a range of reasoning tasks. Figure 2 which is adapted from ref. [11] depicts a 2-dimensional space in which a ball (considered to be a point mass) can bounce and fly around colliding with surfaces in a restricted area. 2.1.1. Qualitative descriptions of behaviour Qualitative descriptions are approximations chosen to make useful behavioural distinctions. In order to describe the state of the ball in qualitative terms it is necessary to choose adequate means of representing both where the ball is in the 2-dimensional space and what it is doing there. The space has to be divided into places of interest which are useful for making the behavioural distinctions relevant to the task (e.g. it may be of interest to distinguish whether or not the ball ever enters the rectangular well). Forbus divides the space into regions (where the ball may fly about), surfaces and boundaries (these are labelled R1—R4, S1—55, and B1—B3, respectively, in fig. 2). The qualitative description of the action of the ball is divided into what it is doing (e.g. it may be flying through a region or across a boundary, it may be colliding with a surface or it may have stopped) and the direction in which this his happening (e.g. up, down, left, right, or combinations of these such as up left). Using this vocabulary the state of the ball at any time may be described. At the arrow head in fig. 2 the ball is colliding with S3 and travelling in the direction down and right (S3, COLLIDING, DOWN RIGHT). .
Ri
p3
Si
S5 S2~
R4
S4
Fig. 2. 2-D space in which a ball can bounce and fly around. Adapted from ref. [11].
(S5,FLY,UP LEFT) (P3, FLY, UP LEFT)
~ ,.—,~———•r•~ sl
fr
(
s2~\ R4
(B3, FLY, UP LEFT) (R2 FLY UP LEFT) (R2, FLY, LEFT)
_~
~
S5 S4
(P.2,FLY,DOWN LEFT)
~
(32, FLY, DOWN
LEFT)
(R4,FLY,DOWN LEFT) (S2,COLLIDE,DOWN LEFT)
S3
(s2, FLY, DOWN
RIGHT)
(R4,FLY, DOWN RIGHT)
Fig. 3. Motion of the ball in the 2-D space of fig. 2.
It is important to observe that a qualitative state description, such as the one just given, describes the state of the system for some period of time. Although the ball may be moving continuously, the state description only captures qualitative changes in behaviour. To illustrate this, fig. 3 shows some motion of the ball and the sequence of qualitative state descriptions which characterise its motion. The sorts of reasoning tasks that a system such as this can be used for are as follows: • Interpreting observations, e.g. describing the current state of the system, answering the question “What is happening?” • Interpreting observations and inferring other values, answering the question “What else is happening?” • Planning tasks such as suggesting how to resolve ambiguities with questions of the form “How can more observations or inferences be made?” S Evaluation of propositions to test for consistency with questions like “Is this situation feasible?” • Investigation of causes of a particular state through questions such as “What happened?” or “What causes this behaviour to happen?” • Prediction of behaviour, simulation of possible .
.
.
.
,,
states with questions like What will happen? [8]. In the example of the ball in the 2-dimensional space some prediction of behaviour is possible if allowable states are identified and if the valid transitions between states are specific. In this example given partial information about a particular
16
J. McDonnell / Domain modelling in second-generation expert systems
state of the ball in terms of its location and direction of motion, it is possible to determine what the ball is doing currently from a table of allowable states. For example, given that the ball is in place S3 (at a surface) and is moving in the direction DOWN, the action of the ball (COLLIDING) is determined. Prediction of future behaviour can be achieved by describing allowable state transitions (e.g. by listing possible after states for each state). For example, given the state of the ball as (R4, FLYING, DOWN LEFT), the set of after states which can follow on (the next qualitatively different states) can be determined. Either the ball will collide with surface S3 or with surface S2 giving possible after states (S3, COLLIDING, DOWN LEFT) and (S2, COLLIDING, DOWN LEFT). To continue the prediction, each of these possible behaviours must be explored (by following each one’s set of possible after states), and so on for the desired number of qualitative state transitions. Clearly, this sort of prediction characteristically results in the generation of many possible behaviours through successive branching. Branching is a serious problem when using qualitative reasoning to predict possible behaviours. However, some local pruning of possible behaviour paths can be achieved by applying compatibility constraints between candidates for temporally adjacent states. Also where there is any additional information relating to any of the states in a sequence (e.g. specific observations or general assumptions which can be applied) it can be used to eliminate behaviour sequences which do not conform to the constraints that this information imposes. The qualitative representation for the 2-dimensional world of the ball which has been described here is insufficient as it stands to reason usefully about the activity of the ball. Some quantitative information is needed to reason effectively. However, the example has served the purpose of introducing several of the key features of any qualitative reasoning system which are: an adequate qualitative description of the state of the system able to capture significant and interesting behavioural characteristics; the notion of a qualitative state existing for a period of time during
which the qualitative description of the system remains unchanged; the specification of permitted state transitions; and the kinds of reasoning which are supportable. 2.2. Equilibrium mechanism The second example illustrates a different formalism which has been applied with some success to expert-system problems where quantitative information is not available and, furthermore, where qualitative reasoning is seen to be most appropriate from observation of the methods used by human experts in the field. 2.2.1. Constraint propagation The example concerns the structural description of a one-tank system (a ubiquitous example in qualitative reasoning) which is the work of Kuipers [12]. A tank has an inlet through which water may enter it and an outlet which when open allows water to drain from the tank but when closed prevents the water from draining. Figure 4 shows the tank system. The structural description of the tank system which is to be used for reasoning qualitatively is given in terms of the cornponents, their behaviours (in terms of physical parameters) and the connections among components (i.e. in terms of constraints among the parameters). The components are the inlet, the tank itself, and the outlet. The inlet is characterised by the parameter “inflow” which has some water flow, i, 1 m OW 1. The tank is charactensed in terms of the water it holds by three related parameters “level”, “pres.
—. —
inlet
I tank
outlet Fig. 4. The tank system.
J. McDonnell / Domain modelling in second-generation expert systems
17
sure” and “amount”. Constraints hold among these three parameters. These are described by a qualitative functional relationship thus; the level of water in the tank monotomcally increases (MI) with an increase in the amount of water held, and the pressure in the tank monotomcally increases with the level of the tank. These may be expressed as
qualitative landmark (specially designated) value for the parameter “amount” giving it the possible values
MI0 (amount, level),
(2)
possible qualitative values
M10(level, pressure).
(3)
(o0, 0, TOP,
The zero subscript introduces a useful further qualification of these constraint relationships, namely that level and amount will have zero values simultaneously, i.e. corresponding values of zero. A similar observation applies to pressure and level, The outlet is characterised by the parameter “outflow”. When the outlet is open, outflow is constrained by its relationship with the parameter “pressure” as follows, MI0 (pressure, outflow) [outlet(open)],
(4a)
whereas when the outlet is closed, outflow
+
oo).
Corresponding zero values have already been introduced, here it can be seen that level and amount have additional corresponding values “TOP” and “FULL”. These provide useful constraints when propagation of change through the network of constraints which now describe the system is carned out to simulate a process occurring. To represent a process (change) occurring in the physical system, the current qualitative value of a parameter is qualified by an indication of the direction in which the change to the parameter’s value is being effected, so that amount(0, mc)
(4b)
indicates that the tank is beginning to fill from
Two further connections between parameters, providing further constraints, can be recorded through the introduction of the parameter “netfiow” (into the tank) since
empty. Qualitative reasoning by simulation proceeds from an initial starting state description forming a constraint network. A parameter is perturbed and is assumed to move towards a limit point (the next identified qualitative value in the direction of
netflow
=
=
0[outlet(closed)}.
oo, 0, FULL, + co). Further, it can be noted that when the tank is full the parameter “level” may have the qualitative landmark value “TOP” giving that parameter the (—
inflow
—
outflow,
(5)
and there is a derivative functional relationship (D) between netfiow and amount, D(amount, netfiow).
(6)
As in the case of the ball in the 2-dimensional world (section 2.1.1) descriptions which are adequate to qualitatively describe the state of the system are needed. In this case qualitative values for the parameters are chosen. For each parameter critical or interesting qualitative vales are selected within the extremes of ±oo. Zero is often useful and in the one-tank system zero is appropriate as a qualitative value for each parameter. It may be of interest to distinguish when the tank is full. This can be catered for by choosing “FULL” as a
change). The effect of the change to this parameter is propagated through the constraint network formed from the structural description. Consider the situation for the tank when the outlet is closed and a steady flow of water, i, enters through the inlet. The constraint network for this situation is given in fig. 5 (from ref. [12]). Given the initial conditions of the system in terms of known parameter values, namely inflow = (i, steady), outflow = (0, steady), and the initial state of the tank amount
=
(0,
?),
J. McDonnell / Domain modelling in second-generation expert systems
18
amount
Using the same one-tank system with different initial conditions illustrates one of the major prac______ ______
~o]
D
level
[M
I
I
inflow
outflow
pressure
M
+
tical aproblems qualitative models are which is that number ofwith behavioural predictions likely to result from simulation. Consider thea situation where the outlet is open and there is a steady inflow of water as before, namely
I
inflow = (i, steady) and the tank is empty
netfiow
amount
=
(0,
?).
Fig. 5. The constraint network for the tank system.
Using the constraint equations as before gives amount(0, mc) simulation proceeds by propagating constraints among the parameters described by the network, moving to limit points and using corresponding values where known to supply additional information. A study of fig. 5 in conjunction with relations (1)—(6) shows that the following activity must be taking place, amount(0, mc) level(0, mc)
from (6),
from (2),
pressure(0, mc)
from (3),
netflow((0, cc), steady)
from (5),
with inflow and outflow as given for the initial conditions. The next identified value for amount in the direction of change is FULL, giving amount(FULL, mc) and level(TOP, mc) as valid behaviour prediction. Although this is the simplest of examples it can be seen that given some information about the state of the system the constraints described permit the question “What is happening?” to be answered and further prediction of future behaviour with “What will happen next?”. Specifically, the questions “Will the tank fill?” and “Will it subsequently overflow?” can be answered.
from (6),
level(0, mc) from (2), pressure(0, mc) from (3), outflow(0, mc)
from (4a),
netflow((0, cc), dec)
from (5).
The question is “Will the tank overflow?” Moving amount to its next limit point (FULL) gives three possible behaviours depending on when the equilibrium is reached. If amount gets to FULL before netfiow gets to zero, the answer will be “yes”. However, if outflow = inflow before amount gets to FULL or if netflow reaches zero when amount gets to FULL, the answer will be “no”. The one-tank system illustrates the constraint propagation approach to the modelling of possible behaviours of physical systems. 2.2.2. Explaining behaviour The constraint-centred approach, illustrated by the example of the one-tank system given above, has been applied to a number of expert-system problems, in particular to domains where interacting equilibrium mechanisms are at work. Kuipers, the originator of the formalism, has applied the constraint-propagation technique on qualitative models devised to explain observations about water imbalance in the human kidney [4]. Analysis of how expert physicians reason about physiological mechanisms, specifically the normal and abnormal response of the human kidney to changes in its environment and its response to
J. McDonnell / Domain modelling in second-generation expert systems associated
with
OBSERVATIONS
(generates) match
~
HYPOTHESES
j described by qualitative
PREDICTIONS
-~
19
that it is constrained to decrease under another, it is not possible without further qualification of the qualitative influences to determine whether the net influence on the parameter causes it to increase or decrease. S Systems which have components or sub-sys-
FAULT MODEL
simulation Fig. 6. The problem-solving architecture of the kidney modeL (and EXPLANATIONS)
therapy, showed that physicians appear to reason qualitatively and further that they regularly use a hypothesis driven approach to diagnosis [13]. Models of the structure of the mechanism for maintaining salt and water balances have been used to predict the normal response of this mechanism in the kidney to a changed environment, the response of abnormal diseased mechanisms to the normal environment, and the response of a diseased mechanism to therapy. These models are being incorporated in an expert system which will generate and test hypotheses triggered by medical observations using qualitative simulation on fault models. The results of the simulations are descriptions of observable and internal parameter changes over time which can be used to evaluate hypotheses and explain observed findings. The problemsolving architecture of this system is shown in fig. 6 [13]. 2.2.3. Limitations of the formalism Structural descriptions in the form of qualitative differential equations of the kind described have been developed for a variety of physical systems for diverse applications and qualitative simulation by propagation of constraints has been used to generate possible system behaviours. Although the applications have been diverse a number of limitations seem to surface regularily in reports of trial applications. These have to be overcome on an individual basis for each situation in which they are significant [14]. These limitations are briefly outlined below: S The result of application of conflicting qualitative influences on a parameter is difficult to determine, e.g. if a parameter is constrained to increases under one influence at the same time
tems with significantly different response times, i.e. time periods between steady states, can be awkward to handle in a simulation; abstraction based on relative time scales needs to be applied to approach simulation of processes in a system with this kind of complexity. S Where system behaviour results in a constraint model containing loops, valid analysis of the behaviour at a particular point in a loop is difficult. S Comparison of the relative values of parameters, e.g. how they are increasing or decreasing relative to one another, is very limited. S A problem common to all qualitative simulation techniques is how to handle the combinatorial explosion caused by the branching paths generated in the production of all possible behaviours; this problem has to be tackled using domainspecific knowledge to prune the number of plausible behaviours. 2.3. Benefits of qualitative models Qualitative models incorporated as components of expert systems may contribute to the provision of the improvements suggested in the introduction in the following ways. Problem solving flexibility: Qualitative models can be used for a selection of reasoning tasks. These have been described in section 2.1.1. If a qualitative model were to be incorporated in an expert system which also included heuristic knowledge, the qualitative model could be used as a resource for reasoning about situations in which heuristic rules useful for solving common problem cases were inadequate, thus contributing to an increase in robustness of the system as a whole. The qualitative model would provide a means of increasing problem solving flexibility by providing an alternative means of handling cases which are difficult or unusual.
20
J. McDonnell / Domain modelling in second-generation expert systems
Knowledge structuring: Once components and component behaviours have been modelled for parts of a physical system, it is possible for these components to be re-used to construct models for other systems which contain similar components. In this way a library of re-useable components can be built up and a particular system (e.g. an electronic circuit) can be modelled by an appropriate selection of the pre-defined components with the particular system-dependent description of component connections added to them. Explanations: Qualitative simulation has been used to provide interpretations of observed behaviour of physical systems and as the basis of causal explanations. The ability to provide these could be used to enhance the explanation and justification capabilities of an expert system which contained such models,
3. Main issues in domain modelling The first and the key task is the identification of the domain knowledge which is to be modelled. Techniques, methods and tools have been developed to assist in this task and theories have been applied to the identification and representation of knowledge at the elicitation stage [15]. These are beyond the scope of this paper, but this task naturally leads to the one of choosing modelling primitives which are appropriate for the identified structures of the components of the domain knowledge and which can facilitate the kinds of reasoning that needs to be possible. This task, like knowledge elicitation, is by no means a trivial one. At present there is little help for the modeller who must rely on knowledge gained from studying the work of others in other domains and on his or her own experience. The modelling of knowledge in a task-independent form to provide a basis for reasoning from “first principles” has to be resolved with the need to be able to use task specific expertise, i.e. “experience”, for efficiency. Furthermore what is needed is the ability to use heuristic knowledge to guide recourse to “first principles” when experience fails or is lacking. There is a suggestion that an expert
system capable of this should be able to compile the results of an application of “first principles” to create a heuristic for future use, thus effectively learning from its experience [16]. None of the modelling approaches described here remove the need for retraction mechanisms to support truth maintenance permitting pursuit of a conjecture or a hypothesis which can be later revoked if contradicted or otherwise found to be of no value. There is a need for systems to incorporate multiple-domain models which are integrated and in which there is support for movement from one model to another as appropriate to progress the solution of the particular problem presented to the expert system. Finally, it is pertinent to address the suggestion given at the start of this paper that domain models should represent facts about a domain without bias towards their use. In qualitative models of physical systems the selection of qualitative descriptions depends on the chosen perspective which focuses upon particular states and state changes which are interesting. (Although a refinement of the formalism introduced in section 2.2 supports discovery of new interesting parameter values during use of the model [13] this does not extend to the identification of new parameters.) The effectiveness of qualitative models rests on the choice of the modelling primitives. In expert systems the choice of these is guided by observation of the way the human expert identifies, organises and uses domain knowledge for a particular purpose. For example, the model of the operation of the human kidney which is described in section 2.2.2 was developed from the perspective of how experts reason about a particular syndrome. The aspiration is to capture expertise and it is this desire which directs the choice of the qualitative state descriptions and the modelling primitives. It can be argued that separation of facts from their use is an impossible task as it requires that a model be devised without taking a perspective. The argument that it is simply possible to do this is not supported from the domain-modelling viewpoint. Using a modelling approach, therefore, it is
J. McDonnell / Domain modelling in second-generation expert systems
not possible to construct a system which will make creative and novel use of the knowledge at its disposal and which will be capable of exhibiting ingenuity.
References [1] E.T. Keravnou, Comput. Phys. Commun. 61 (1990) 3, this volume. [2] C. Price and M. Lee, Deep Knowledge Tutorial and Bibliography, Alvey Report IKBS3/26/048, University College of Wales (1988). [3] B. Kuipers, Artif. Intel. 29 (1986) 289. [4] B. Kuipers and J.P. Kassirer, Cognitive Sci. 8 (1984) 363. [5] L. Johnson and E.T. Keravnou, Expert Systems Architectures (Kogan Page, London, 1988) Ch. 13. [6] J. Sinclair, Knowledge Acquisition and Implementation of a Prototype for an Expert System to Design Biochemical Reactors, M.Sc. thesis, Dept. Computer Science, Umversity College, London (1986).
21
[7] J.H. Dc Kjeer and J.S. Brown, Artif. Intel. 24 (1984) 7. [8] K.D. Forbus, Artif. Intell. 24 (1984) 85. [9] B. Kuipers, Artif. Intell. 24 (1984) 169. [10] B. Bredeweg, GARP k4 mini-study, Esprit Project P1098: Task K4, Dept. SociaL Science Informatics, University of Amsterdam (1989). [11] K.D. Forbus, IEEE Trans. Syst. Man Cybern. 17 (3) (1987) 350. [12] B. Kuipers, Alvey IKBS Research Theme Deep Knowledge Workshop 2, April 1986 (lEE, Hitchen, Herts, 1986). [13] B. Kuipers, IEEE Trans. Syst. Man Cybern. 17 (3) (1987) 432. [14] J. McDonnell, Notes on Reports of Experience of Participants at Alvey IKBS Research Theme Deep Knowledge Workshop 6, March 1989, unpublished. [15] B. Gaines and J. Boose, Knowledge Acquisition for Knowledge-Based Systems, vols. 1 and 2 (Academic Press, New York, 1988). [16] W. Van de Velde, Learning heuristics in second-generation expert systems, in: Proc. 6th Int. Workshop on Expert Systems and their Applications, Avignon (EC2, Nanterre, 1986).