Academia.eduAcademia.edu

Approaches to qualitative reasoning

1989, Artificial Intelligence Review

The main approaches to qualitative reasoning are surveyed, compared and contrasted. These are the constraint based, component centred and processed based approaches. Later sections consider the efficiency of the reasoning techniques and possible applications (for instance in diagnosis and measurement interpretation). The paper concludes with a number of sections which consider representation of space and time, order of magnitude reasoning, hierarchical and multiple models and the method by which qualitative models might be generated.

Artificial Intelligence Review (1989) 3, 177-232 Approaches to qualitative reasoning A. G. Cohn Department of Computer Science, University of Warwick, Coventry, CV4 7AL, England, UK Abstract. The main approaches to qualitative reasoning are surveyed, compared and contrasted. These are the constraint based, component centred and processed based approaches. Later sections consider the efficiency of the reasoning techniques and possible applications (for instance in diagnosis and measurement interpretation). The paper concludes with a number of sections which consider representation of space and time, order of magnitude reasoning, hierarchical and multiple models and the method by which qualitative models might be generated. 1. I n t r o d u c t i o n The purpose of this paper is to introduce the field of Qualitative Reasoning and survey the state of the art as it appears in the s u m m e r of 1987 (this paper is a slightly revised version of a paper which appears in the proceedings of ACAI87 (Cohn, 1988). The field is presently exploding and inevitably I shall not be able to cover all relevant work or even everything to the same level of detail. First we m u s t make clear what is meant by the term 'Qualitative Reasoning'. In view of the often-repeated claim that AI is not (principally) concerned with quantitative reasoning but with symbolic reasoning it might seem that all, or at least most of AI, might be viewed as qualitative reasoning. However the term has come, in some quarters at least, to have a more precise meaning. In particular, for domains which have a standard quantitative treatment (such as physics), the aim of the enterprise we are discussing here is to provide a purely qualitative approach to problem solving in the domain. Some examples m a y be of help in explaining what we intend by the term qualitative reasoning; m u c h of the work to date has been concerned with building models of naturally occurring physical situations or (more usually) constructed physical systems and performing various kinds of reasoning tasks on such models and the four simple examples below are all taken from this literature. Forbus (1984b) cites the example of a super heated steam boiler (see Fig. 1): if the input water temperature is increased what happens to output temperature? 177 178 A . G . Cohn IIII I I ~ Super heater 7 ~ oiler Fig. 1 Super heated steam boiler: what will happen if the inlet water temperature increases? A l t h o u g h the a n s w e r (which is left as an exercise for the reader) m a y a p p e a r counter-intuitive at first, it does not require any quantitative k n o w l e d g e or reasoning. A n e x a m p l e w h i c h appears frequently in the l i t e r a t u r e - - for e x a m p l e Forbus (1984b) or Kuipers (1986) - - is that of a mass on a spring sliding on a frictionless surface in one d i m e n s i o n (see Fig. 2): we w a n t to be able to a n s w e r the question ' w h a t h a p p e n s if the mass is e x t e n d e d and then released?' We w o u l d expect a qualitative reasoner to be able to predict an oscillation even t h o u g h the precise period c o u l d not be determined. I Fig. 2 Mass on a spring sliding on a frictionless surface: what happens if it is extended and then released? Figure 3 s h o w s a rather different kind of situation: w h a t h a p p e n s w h e n a mixture of water, sand a n d pebbles is p o u r e d t h r o u g h a sieve? C o m m o n sense tells us that the water will fall through, the pebbles will stick and the sand m a y fall t h r o u g h or Fig. 3 What happens when a mixture of water, sand and pebbles is poured through the sieve? Approaches to qualitative reasoning 179 not depending on the sand grain size relative to the sieve grain and that in order to get the sand to fall through it may be necessary to agitate the sieve. The final example we will present here is again one that is cited frequently, for example de Kleer & Brown (1984). Figure 4 depicts a pressure regulator: we want our qualitative reasoning program to be able produce an explanation of how it works such as: An increase in source pressure increases the pressure drop across the valve. Since the flow through the valve is proportional to the pressure across it, the flow through the valve also increases. This increased flow will increase the pressure at the load. However, this increased pressure is sensed, causing the diaphragm to move downward against the spring pressure. The diaphragm is mechanically connected to the valve, so the downward movement of the diaphragm will tend to close the valve thereby pinching off the flow. Because the flow is now restricted the output pressure will rise much less than it otherwise would have. (de Kleer & Brown 1984, p.10) Other examples in the literature include reasoning about electronic circuits (for example Williams, 1984) and physiological systems (for example Kuipers & Kassirer, 1983). m Fig. 4 How does this device act as a regulator? In each of the above examples, both the problem and the output are expressed in qualitative terms, even though the problem might traditionally be described using continuous real valued parameters and differential equations, which might then be solved analytically or numerically. However, it is clear that one does not need to have a knowledge of differential equations in order to be able to provide answers at the level of abstraction which we are considering. Of course one might be able to provide an answer purely on the basis of experience (i.e. inductively); however, in order to explain why the answer is correct would seem to require a deeper, structural model of the system and the ability to reason about such a model. The techniques we shall discuss below are certainly able to reason about the 180 A . G . Cohn second and fourth examples above. As far as I know, no-one has attempted to build a system capable of reasoning about the sieve and we will discuss later why no existing system can handle the first problem yet. It is worth rehearsing here the arguments as to why traditional physics may be inadequate in order to provide further motivation for the sequel. There are m a n y situations where one can reason from 'first principles' about likely futures but without knowing precise data about the scenario. Forbus (Badii, 1987) gives the example of seeing someone throw an aerosol into a fire; qualitative reasoning can tell us that since the container is pressurized, it is possible that it may explode upon being heated. We can make this prediction without knowing the dimensions of the canister, the temperature of the fire, the material from which the canister is constructed or h o w thick it is, o r . . . Unless we can model the situation mathematically, (say) with differential equations which can be solved analytically we will not have the numerical data in order solve the equations numerically. Thus traditional quantitative techniques may be insufficient for problem solving because we may not be able to build a precise model (for example the exact relationship between two variables may not be known). Further difficulties may be caused because the initial values of some or all of the parameters are u n k n o w n or too expensive or difficult to obtain. If the initial conditions for all variables are not precisely given then one will have to guess a precise initial value and the resulting behaviour prediction may be very dependent on this; moreover usually only a single behaviour is predicted at a time. By contrast the qualitative techniques we shall look at may predict several behaviours depending on different assumptions about the value of variables and their relationships. A quantitative solution by successive approximation or simulation will give an exact answer or behaviour prediction, but there may be an error coefficient due to rounding or too large interval steps. By contrast, qualitative reasoning should give a less precise, but totally accurate answer; for example, to the question 'what is the temperature of the substance in the container?' a quantitative reasoner might say 91.47°C_ 10% whilst a qualitative reasoner might respond ' s o m e w h e r e between freezing and boiling'. If the boiling point of the substance is 100°C then the two responses are very different. As we shall see though, qualitative simulation will in general predict m a n y behaviours, not all of which correspond to a real behaviour, so the problem of inaccuracy has not gone away, but merely surfaces in a different way. In s u m m a r y therefore we may say that quantitative techniques may be unsatisfactory because of the requirement for a very detailed model, the need for precise initial conditions to be k n o w n and the computational expense typically engendered by numeric problem solving techniques. Further motivation for studying qualitative reasoning comes from the observation that people seem to be able to reason qualitatively, thus it is a valid AI or Cognitive Science task to investigate this. There is a growing literature (for example Gentner & Stevens, 1983; Falkenheiner et al., 1986; Roshelle, 1987) on applying representation schemes such as we shall describe below to the task of mental modelling. As with other formal approaches to mental modelling, one may take the strong view Approaches to qualitative reasaning 181 that there is a fairly direct correspondence between elements of the computer model and a human mental model, or the weaker view that the formal model merely circumscribes the possible mental models a human might have. However, we shall not particularly address ourselves to the mental modelling applications of qualitative reasoning here. As Forbus (Badii, 1987) has pointed out, most researchers in the field do not view qualitative reasoning as a replacement for quantitative reasoning but rather as a complementary technique. For example, one might use qualitative reasoning to discover if a dangerous outcome is possible and only then use more computationally expensive numerical techniques to investigate the situation in more detail. Or qualitative reasoning might be used to guide the application of numerical techniques by helping with quantitative model selection or parameter setting, though it must be said that both of these ideas are largely unexplored. We shall return to the relationship between qualitative and quantitative techniques in a later section. As has already been stated what we mean here by qualitative reasoning is something more specific than merely symbolic reasoning. It should now be apparent that we are particularly interested in reasoning when precise numerical values are not known. However by qualitative reasoning we also mean something more specific than just any approximate reasoning scheme; in particular it is not anything to do with 'fuzzy' reasoning (Zadeh, 1983), at least at present. The value of any particular qualitative variable will not be at all 'fuzzy' but will be a precise (possibly interval) value, though there may be several parallel 'worlds' in which the same variable may have different values. The fact that different possible values for a qualitative variable do not overlap is used crucially when building and reasoning about an envisionment. Also worth commenting on at this juncture is the variety of terminology used to describe the field. The following terms all seem to be very closely linked: qualitative reasoning, qualitative simulation, qualitative physics, qualitative analysis, qualitative modelling, deep knowledge, naive physics, commonsense reasoning; and there are no doubt other similar terms in the literature. The author's present view is that qualitative reasoning usually operates on a qualitative model; that qualitative simulation is a particular kind of qualitative reasoning (the most common in the literature); that qualitative analysis is another kind of qualitative reasoning; that qualitative physics is qualitative reasoning in the physics domain; that qualitative modelling is a technique for encoding deep knowledge; that the emphasis in naive physics is to build a model of a layman's understanding of everyday physics: this might be done using qualitative modelling and reasoning techniques. What is certainly true is that all these fields are quite young though rapidly expanding; this is not a mature subject with a well agreed theory, approaches and methodology. An early collection of Qualitative Reasoning papers appears in a special issue of Artificial Intelligence (Volume 24) which has also been published as a book (Bobrow, 1984). Another collection of papers is Hobbs & Moore (1985) and the recent IJCAI and AAAI conferences, amongst others, also have many relevant papers. 182 A.G. Cohn Qualitative modelling and deep models Most current expert systems are very specific in the kind of problems they can solve. Typically, if they do diagnosis they cannot predict or tutor as well. Moreover they can not solve simpler or more abstractly stated versions of the problems they were designed to solve. This is often because the knowledge is all 'compiled'; much knowledge is implicitly represented and no irrelevant knowledge for the particular task is present. Usually there is no justification or supporting knowledge, each fact or rule stands on its own as an underivable 'axiom' and it is not possible to question the validity or the basis of it. Such systems are unable to reason from 'first principles'; for example a typical medical expert system for diagnosis will have rules which enable it to conclude about (say) the presence of a particular organism from particular lab data and other observations without any underlying knowledge or reasoning about the physiological pathways, processes or causal connections involved. Now, although diagnostic problem solving can be and normally is conducted in such a manner by using so called 'surface' or 'compiled' knowledge, other problem solving activities in the same domain are not usually possible with the same knowledge base as has been found (for example Clancey & Letsinger, 1981). Moreover the inadequacy and lack of satisfaction frequently expressed with the explanations proffered by such systems is endemic to a system which has no deeper level of understanding or knowledge than the pure 'how to do it' know how of surface rules. Much of the interest in qualitative reasoning systems and qualitative modelling comes from the possible application of these techniques to expressing deeper models to act as underlying models supporting conventional expert system rulebases. Desiderata for a qualitative reasoning system From the above discussion we can start to enumerate the features we should like a qualitative reasoner to have. No existing theory entirely meets these specifications. The modelling language should be capable of describing complex physical systems to varying levels of detail and granularity. Consequently, the grain of the output of the reasoner may vary as the input grain changes. Processes and interactions must be describable and moreover the reasoning system must be capable of instantiating such descriptions and, what is much more difficult, generating new descriptions to describe the (dynamic) behaviour of an entire system from the descriptions of the parts. The system should provide a unified structure for supporting a variety of different tasks such as design, diagnosis, planning and prediction. In view of the requirement to build descriptions of, and reason about, complex systems it must be possible to model individual parts of a system separately and have the system reason about the behaviour of the complete system. Thus the modelling language should support descriptions which are composable. Support should also be provided to help the user of the system to model their problem using Approaches to qualitative reasoning 183 the primitives. Such help might be provided partly by making the language sufficiently expressive, partly by providing a library of primitive descriptions (for processes, components, and their cause. Of course the problem of helping a user express their problem in a particular knowledge representation formalism is not unique to qualitative modelling. Finally, one would like to be able to integrate quantitative knowledge and inference into a qualitative reasoner when available and link a quantitative reasoner to a traditional 'surface' system. In fact one comes to realise that the deep/surface dichotomy is false and in reality there is a continuum of 'deepness' along several scales. (Some) history Most of the work in the field and everything that we shall discuss here has been published in the 1980s. There is however some earlier important work from which much of the work presented here descends and which is worth describing briefly. Perhaps the earliest published work in the area is de Kleer's NEWTON system (de Kleer, 1977). NEWTON is a system which attempts to solve simple mechanics problems qualitatively and only uses quantitative methods if qualitative reasoning fails to provide a solution; however, even in this case, the results of the qualitative reasoner may guide the selection of equations and the way they are solved quantitatively. NEWTON introduced the important idea of envisioning which is a qualitative state transition graph and captures the possible qualitative behaviour sequences. However, NEWTON was very limited in its representation and inference techniques and seemed very tied to the simple mechanics domain in which it operated. Moreover, it had virtually no notion of time. The other, now almost classical, research referenced by almost all papers in the literature is Hayes' work (1979, 1985a, 1985b) on Naive Physics. Hayes is particularly interested in axiomatizing our commonsense knowledge of the physical world (within a logical framework). He is more concerned with the modelling problem, i.e. the conceptualization and the ontological problems rather than with the reasoning aspects; he is concerned with what knowledge is represented, not how it is to be manipulated. The idea which we shall meet shortly of a qualitative quantity space is due to Hayes. His first paper, the Naive Physics Manifesto (Hayes, 1979), and the revised version (Hayes, 1985a) give the motivation for trying to build Naive Physics axiomatizations, the advantages of doing it in first order logic, and discuss the methodology and some particular problem areas. His first foray was into the world of liquids (Hayes, 1985b), a subject he had argued as being particularly hard to formalize in (Hayes, 1974). Briefly, the problem is hard because in a formal, propositional, representation, liquids are denoted by mass terms and the semantics of mass terms has been the subject of much philosophical debate (Bunt, 1985). Moreover liquids can divide, combine and deform with incredible ease compared to solid objects which are much more sharply individuated. He introduced what he called the contained space ontology which has been extensively used since. 184 A.G. Cohn Another concept introduced in these papers is the idea of a history, which is a piece of 4-D space time describing the 'life' of a particular object. He argues that histories can be of great help in solving the frame problem (McCarthy & Hayes, 1969) because if histories do not intersect then (assuming 'no action at a distance') the histories can be evolved separately; in a state based system such as the situational calculus, there is only a global state so all actions have to be reasoned about globally which can create great inefficiencies and problems in specifying what is affected by any action. Of course in the history-based approach the problem becomes one of computing history intersection. We will return to histories when discussing the work of Forbus (1984a) and Williams (1986). Hayes argued that although ultimately all Naive Physics concepts are related, they tend to form closely linked clusters which are only sparsely interlinked. We have already mentioned liquids as being one cluster; others which he identified include measuring scales, shape, assemblies, support and substances. Although these papers have been very influential in the field of qualitative reasoning as a whole, Naive Physics itself remains relatively unexplored. Other forays include Hobbs et al. (1985) and Cunningham (1985a). Hayes' investigation of the liquids cluster is only an initial investigation and there are many difficulties and inadequacies with the axiomatisation and many unanswered problems (see, for example, Welham & Hayes 1984; Cunningham 1985a; Hayes 1987). McDermott (1987) has come to believe that the whole enterprise is impossible, at least within the confines of formal logic. It should be noted, however, that the journal issue containing (McDermott, 1987) also contains extensive peer commentary and criticism including a rejoinder by Hayes (1987b) himself. Approaches to qualitative reasoning Broadly speaking there are three main approaches to qualitative modelling and reasoning. Perhaps the simplest form an ontological view is the so called constraint centred approach in which an entire system is described by a homogeneous set of constraints; typical of such an approach is the work of Kuipers (1984, 1986). A more structured approach is the component centred one where a system is modelled by instantiating components from a library which are then connected together explicitly. The work of de Kleer & Brown (1984) and Williams (1984) is typical of this approach. Finally, the process centred approach builds on the component centred approach by modelling not only individual components explicitly but also the processes which act on them. Forbus' (1984a) work exemplifies this approach. The next three sections will describe a constraint based system, a component centred system and a process centred system, respectively. Then I will try to compare and contrast the three approaches and draw some general conclusions. The next two sections will investigate some uses of qualitative reasoning and the problem of building efficient qualitative reasoners. The final sections will discuss time in more detail, qualitative spatial reasoning, order of magnitude reasoning, approaches to extracting higher level behaviour descriptions, various modelling problems and some current and future research directions. Approaches to qualitative reasoning 185 2. Constraint b a s e d qualitative reasoning The first approach to qualitative reasoning we shall examine is that presented by Kuipers (1986) which built on his earlier work (Kuipers, 1984). For Kuipers, a physical situation is modelled by a single set of constraint equations which are, essentially, qualitative differential equations. Thus, a model consists of a number of parameters, or variables, and some specified relationships between them. The main issues addressed by Kuipers (1986) are the provision of qualitative representation for quantities, an efficient qualitative simulation algorithm, a method for selecting state transitions, the fidelity of quantities to standard mathematical analysis, and the question of the fidelity of computed qualitative behaviours to real world (i.e. whether all possible behaviaurs are generated and whether any extraneous behaviours are generated). We shall cover all these issues below. First we will describe the representational apparatus Kuipers uses. At the heart of this is the notion of a qualitative variable i.e. a variable which can take one of a finite number of qualitative values and which is a function of time. The first section below describes the representation of values for qualitative variables. The way the behaviour of a system is described is through a set of constraints which relate the various qualitative values. The second section below describes the various primitive constraint types. Perhaps the most interesting of these are the so called monotonic function constraints (M ±) since these can be viewed as a 'qualitization' of more quantitative constraints; however quantitative contraints would be of little use given the purely qualitative variable values. We then proceed to define Kuipers notion of a qualitative simulation which will generate sequences of states, where each state is corresponds to a constraint-satisfying assignment of values to the qualitative variables and where the transition between one state and a neighbouring one obeys certain general continuity constraints. The representation of qualitative variables Landmarks are distinguished points on the real line. A quantity space is a finite set of totally ordered landmarks. Landmarks may be either numeric (e.g. 0) or symbolic (e.g. capacity42); it is their ordinal relationship which is important. A quantity space thus defines an alternating sequence of points and open intervals on R. A quantity space always includes the landmarks {minf, 0, inf} where inf and minf are plus and minus infinity respectively. New landmarks may be discovered dynamically (e.g. when a decreasing oscillation is predicted). At any time t a function f is described by a pair <qval,qdir>. The value qval may be a landmark 1 or two adjacent landmarks (11,12) i f f is between landmarks at t. The value qdir is one of (dec, std, inc}, standing for decreasing, steady or increasing, and is the qualitative derivative of f. Thus a qualitative derivative is of low fixed resolution while the qualitative value may be of higher, though still finite resolution. 186 A.G. Cohn Constraint equations Kuipers allows a variety of constraint primitives (two or three place): arithmetic: ADD(x,y,z), MULT(x,y,z), MINUS(x,y) functional: M+(x,y), M-(x,y) derivative: DERIV(x,y) AIJD(x,y,z) constrains z to be the sum of x and y and similarly for MULT(x,y,z). MINUS(x,y)constrains x to be - y . M+(x,y) states that y is some function of x which is strictly monotonically increasing. Similarly M-(x,y) states that y is some function of x which is strictly monotonically decreasing. DERIV(x,y) predicates that y is the derivative (with respect to time) of x. (The older formulation (Kuipers' (1984) E N V system) also had inequality and conditional constraints). M÷ and M- can also have c o r r e s p o n d e n c e s specified. A correspondence is a pair of landmarks 11 and 12 such that x is 11 when y is 12. If < 0 , 0 > is a correspondence we usually write M~-orMo. Earlier we said that Kuipers' constraints can be viewed as qualitative differential equations. The following example shows how a particular ordinary differential equation (ODE) can be transformed to a set of qualitative constraints in Kuipers' formalism. Suppose we have the ODE d2u du -+ - - = cot(cu) dt 2 dt We can rewrite this as the set of simultaneous equations displayed below on the left, whilst the corresponding qualitative constraints are on the right. fl = du/dt f2 = dflldt DERIV(u,fl) DEedV(fl,f2) f3 = CU MULT(c,a,f3) f4 = cot f3 f2 + fl = f4 M-(f3,f4) ADD(f2,ZI,f4) The set of qualitative constraints so derived will always be equivalent to, or (more usually) less restrictive than, the original ODE, so any solution to the ODE will also satisfy the qualitative constraints. D e s c r i b i n g a situation A physical situation is described by - - - a set of parameters (which represent continuous and continuously differentiable real-valued functions) each of which has an associated quantity space, and possibly range limits which define the operating range of constraints, a set of constraint equations, a set of qualitative values for each of the parameters at the specified time point. Approaches to qualitative reasoning 187 Qualitative simulation A qualitative simulation differs from a standard numerical simulation in several ways. For example, in a quantitative simulation each simulation step is usually a fixed, metric, time after the previous one. By contrast in all the qualitative simulation algorithms we shall examine, including Kuipers' which we shall describe now, the successive simulation steps are determined by establishing w h e n 'something interesting h a p p e n s ' rather than by any fixed time steps. For any individual function f, the distinguished time points, i.e. the places of interest, are those points in the domain of f where f reaches an e x t r e m u m or passes a landmark. The set of distinguished time points of a complete system is the union of the distinguished time points of all the functions comprising the system description. At every distinguished time point of the system at least one individual function will have reached or passed a landmark or achieved an extremum. The QSIM algorithm which we describe below will incrementally compute all the distinguished time points given an initial value for every function at some time point. Qualitative state transitions For Kuipers, (qualitative) time consists of a series of alternating points and open intervals between the points. Each state of the system predicted by QSIM wi!l thus either be an instant or will endure for some open ended interval. Successive state to state transitions are thus alternately from an time interval to a time point (Itransitions) or from a time point to an time interval (P-transitions). The driving force behind QSIM is a set of transition rules which match against individual function values and posit possible transition values for the 'next' state. Depending on the value and qualitative derivative there may be more than one possible transition for an individual variable (though global considerations m a y later rule some or all of these out). These transition rules are subdivided depending on whether we are considering I-transitions or P-transitions. At any time (interval or point) a quantity m a y be at a landmark or in the open interval between them; thus there are rules for both I- and P-transitions for dealing with quantities at a landmark (I1, P1, P2, P3, P4, P6) and rules for dealing with quantities between landmarks (I2-I9, P5, P6). The initial state is always given at a time point and it can be seen that there are P-transitions for every possible ~qval,qdir>. (To describe a quantity initially between two landmarks and steady requires a new landmark to be added to the appropriate quantity space). After a P-transition a quantity is either at a landm a r k and steady, in which case I1 will be applicable next, or the quantity will be between landmarks and non steady, in which case rules I2, I3, I4, I8 or I5, I6, I7, I9 will be applicable. P-Transitions (transitions from a time point to an interval): P1 P2 P3 ~1 i, s t d ~ ~1~, s t d ~ <lj, s t d > --~ --~ --~ ~lj,std> ~(lj,lj÷ 1),inc> ~(lj-l,l~),dec~ 188 P4 P5 P6 P7 A . G . Cohn d/i, i n c > <(lj,lj+l), i n c > <lj, d e c > <(l~,lj+~), d e c > -~ <(lj,lj+l),inc> ~ <(li,li+l),inc> ---, ~ <(/j_~,lj), d e c > <(lj,lj+a),dec> I-Transitions (transitions from a time interval to a point): I1 I2 I3 I4 I5 I6 I7 I8 I9 <li,std> <(li,/j..~),inc> <(lj,/j+l),inc> <(/j,/j+~),inc> <(lj,li÷l),dec> <(lj,lj÷l),dec> <(li,li+~),dec> <(lj,lj+l),inc> <(li,lj+l),dec> ~ ~ --~ -~ --~ --~ <lj,std> <li+~,std> <li÷l,inc> ~(lj,li÷l),inc> <li,std> <lj,dec> ~ ~(/i,li+ ~),dec> --~ --~ <l*,std> <l*,std> The rationale underlying these state transitions (which are taken from Table 1 of Kuipers, 1986) is that functions are assumed to be continuous and differentiable and thus qualitative versions of the mean value theorem and intermediate value theorem restrict the possible state transitions. Transitions P4, P5, P6 and P7 uniquely determine the next value of a variable which matches their left hand side; if a function is increasing or decreasing at a landmark then in an instant it will move to the adjoining open interval in the direction of change (rules P4 and P6) and a function cannot reach the endpoint of an interval instantaneously (rules P5 and P7). I1 also uniquely determines a next value since a function moves away from a landmark instantaneously rather than over an interval. The situation where a function is steady at a landmark at an instant is three ways ambiguous and the situation where a function is non steady in an interval and is transitioning to a time point is four ways ambiguous. In the latter case the possible cases are that it stays non steady in the interval (rules I4 and I7), that it reaches the landmark at the end of the interval either steady (rules I2 and I5) or not (rules I3 and I6), or it may become steady within the open interval thus splitting the open i n t e r v a / i n two by dynamically creating a new landmark (1") (rules I8 and I9). The situation where a quantity is at a landmark at a time point is three ways ambiguous: it may remain steady at the landmark (rule P1), or move into the open interval at either side (rules P2 and P3). The QSIM algorithm. The top level of the QSIM algorithm consists of selecting an active state, generating possible successor states, filtering these and repeating. If more than one successor state results then a branching tree of states is generated. Initially the set of active states consists of a single specified state. The possible successor states are generated thus: first, possible individual function transition rules from the set P1 to P7 or I1 or I9 are selected; functions may have invariant assertions (e.g. a/ways positive, always constant) and any potential rule applications violating these invariants are discarded. Then, for each constraint, two or three tuples of value pairs are built, using the previously se/ected transition Approaches to qualitative reasoning 189 rules, according to the strictures of the constraint. Consistency between each pair of constraints is checked using a Waltz (1975) filtering algorithm (the constraints are the nodes, variables in c o m m o n between two constraints are the arcs and tuples of variable assignments consistent with each constraint are the node labels). Complete state descriptions are now generated from the filtered tuples and these new states are made children states of current state. Finally, global filters are applied to these states and any which pass are added to the set of active states. Global filters are no change (is the new state identical to parent state?), divergence (some function reaches infinity; this might correspond to some component breaking in the modelled world), cycle (is the new state identical to some earlier state?). In addition, heuristic filters such as quiescence (the state is a time instant and all qdirs are std) may be activated. The individual constraint checks mentioned above are of two kinds: the directions of change must be consistent and corresponding values must be adhered to. For example M÷ requires both functions to have the same directian of change, ADD requires that if the first two arguments are increasing then so is the third, DERIV(f,g) requires the sign of g (determined with respect to landmark O) to agree with the qdir of f and M+ requires both functions to reach specified corresponding values at the same time instant. Complexity of QSIM Kuipers considers the complexity of QSIM and concludes that the complexity of each step (except generating global interpretations) is a linear function of the number of parameters. However, although generating a single global interpretation only takes O(n) there may (in the worst case) be exponentially many of them. In practice the runtime seems to be about O(mt) where m is number of constraints and t the length of the longest generated behaviour. Owing to landmark generation, QSIM may never terminate. 'Soundness' and 'Completeness' Kuipers proves that all actual possible behaviours (i.e. all solutions to all ODES which translate to a particular set of qualitative constraints) are found by QSIM. This is a kind of completeness result. QSIM may produce extra behaviours i.e. behaviours which do not correspond to any actual behaviour of a physical system modelled by the constraints. Thus, in a sense, QSIM is 'unsound'. The problem seems to be that simulation is local and a qualitative state description may not have enough information to determine the next state appropriately. For example, the system of the mass on a spring sliding on a frictionless surface quoted at the beginning of this paper might be represented to QSIM as a three variable system (a, v, x) representing the acceleration, velocity and x-coordinate of the mass with three constraints, two specifying the derivative relationships between a, v and x and a third which expresses the relationship between a and 190 A.G. Cohn x: M~(a,x). If the initial state is x=0, a=O, v=v*, where v* is some positive landmark, then the simulated behaviours include stable oscillation, increasing oscillation, decreasing oscillation, increasing then decreasing oscillation . . . . Only the first is an actual behaviour. In order to force QSIM to predict a unique behaviour further constraints specifying the conservation of energy must be added. We will return in a later section to Kuipers' more recent work on reducing the ambiguity in QSIM's behaviour predictions. Thus QSIM will not generate false negatives but may give false positives. It is easy to see that if a unique behaviour is predicted then it must be the real behaviour. Kuipers claims this 'unsoundness' theorem must apply to any purely local qualitative simulation algorithm. 3. A c o m p o n e n t centred a p p r o a c h The second approach to qualitative modelling that we shall examine is the so called component centred approach as exemplified by de Kleer & Brown (1984). Others who have taken a similar approach include de Kleer & Bobrow (1984), Williams (1984) and, in the digital domain, Davis (1984). De Kleer & Brown are particularly interested in building a qualitative physics which will provide explanatory and predictive power. They view a physical situation as a device, composed of individual components connected together. This is essentially the approach taken by the field of System Dynamics (Cochin, 1980) which de Kleer & Brown take as the theory for which they wish to develop a qualitative version. The main idea is to develop a library of device/component models, each with an associated behaviour description. However, it is very important that these behaviour descriptions do not make assumptions about how the components will be 'used' in a particular device so that the library is truly generic and, moreover, so that the behaviour of the overall circuit is not predetermined by purely local considerations. This prime assumption which de Kleer & Brown discuss at some length is the no function in structure principle. For example, the description of a valve must not say that liquid will flow if it is opened because this will depend upon, amongst other things, whether there is liquid in the pipes leading to the valve. However any behaviour description must make some assumptions which can be reasonably assumed to hold across a sufficiently wide class of systems of interest. Such assumptions are known as classwide assumptions; for example, one might assume that liquids are incompressable, that flows are laminar, that currents are low enough not to induce currents in other wires. Many classwide assumptions are about granularity, particularly with respect to time, i.e. a decision is made to ignore certain effects which only last a short time, such as settling behaviours. Device structure The total behaviour of a complex system is computed from the behaviours of the primitive constituents. There are three kinds of basic entity: materials (such as Approaches to qualitative reasoning 191 water, air, electrons), components (which operate on materials to alter their form and/or properties) and conduits (which merely transport material). A system m a y be viewed as a graph where the nodes are components and the edges are conduits. The behaviour of a c o m p o n e n t is described using two basic attributes of materials: 'pressure' and 'flow'. These two attributes m a y be termed differently depending on the domain; for example in electrical circuits, pressure is voltage and flow, current. Obviously not all physical systems are representable easily or at all in this view (consider a game of pool or billiards for example). Qualitative variables De Kleer & Brown also define a qualitative quantity space for variables which is a finite total ordering of intervals. These intervals must cover the real line. However, by far the most c o m m o n l y occurring quantity space in the paper under discussion and elsewhere, is the quantity space { - , 0, +}, i.e. the only qualitative distinctions m a d e are between negative numbers, strictly positive numbers and zero. Every attribute (such as pressure or flow) is represented by a set of variables, x, ax, 82x . . . . where 5 denotes a derivative with respect to time. 5 variables always have the quantity space { - , 0, +}. Like Kuipers, de Kleer & Brown can also induce a qualitative description of time; however their model of time is non dense: two consecutive states may both be time points (recall that Kuipers time line consisted of alternating points and open intervals). The consequences of this change do not seem to be great in de Kleer & Brown's system, however, see the discussion below concerning the possibility of stutter cycles in Forbus' system. All variables are assumed to be continuous and thus can not ' j u m p ' a qualitative value. For example, if x = 0 at two successive times, then dx = 0 at the first time. De Kleer & Brown define and use a qualitative calculus which is essentially the same as the qualative constraints of Kuipers. The tables for addition and multiplication are given below. plus 0 + 0 + + + 0 + + 0 0 0 0 - 0 + - ? 0 + ? times 0 + Notice that although multiplication is everywhere well defined, addition is sometimes ambiguous and this will lead to branching in the behaviour predictions. 192 A . G . Cohn Specifying component behaviours The behaviour of each part of a system is specified by a set of confluences, which can be viewed as qualitative differential equations. Each confluence is an equation of form: tl+t2 +...+tm=c where c is a constant (i.e. a m e m b e r of a quantity space) and the ti are terms which are of the form: variable or constant * variable. Confluences are satisfied by particular assignments to variables providing the confluence evaluates correctly in the qualitative calculus or cannot be evaluated because of ambiguity. Qualitative states A set of confluences alone may be insufficient to describe the behaviour of a device because a device may have different operating regions each of which m a y require a different set of confluences to describe the behaviour with that operating region. Qualitative states are introduced in order to increase the power of the modelling system. Each qualitative state for a c o m p o n e n t consists of a set of confluences and a precondition which determines w h e n the operating region is active. The precondition may only test non derivative variables (in order to satisfy the 'no function in structure principle', because operating regions are a structural device and derivative variables give information about behavionr over time) and has the form of a conjunction of inequality relationships between such variables and quantity space constants. For example the pressure regulator system depicted at the start of the article has a valve c o m p o n e n t which can be modelled as a three state component. state OPEN: precondition: a = amax; confluences: p = 0, ~p = 0 state WORKING: precondition: 0 ~ a ~ amax; confluences: p = q, ~p + p * ~ a - a q = 0 state CLOSED: precondition: a -- 0; confluences: q = 0,~q ~- 0 However the definition of a term given earlier did not allow for two variables being multiplied together; a model with multiplication signs occurring in the confluences is k n o w n as a mixed model. A pure model with no multiplication can be obtained by expanding the WORKINGstate to three states depending on the qualitative value of p (assuming a { - , 0 , + } quantity space for p). One might call these states CLOSING,OPENING and STEADY. This has the benefit of being able to subsequently provide a finer grain description of the system and of simplifying the calculus. In fact, as Struss (1987) points out, de Kleer & Brown also have a second definition of pure confluences where a confluence cannot mix derivative and non Approaches to qualitative reasoning 193 derivative variables. Again, by introducing extra states with appropriate conditions on the non derivative variables involved, such mixed confluences can be made pure. Apart from the effect on the granularity of description, it it not clear why de Kleer & Brown prefer confluences which do not mix derivative and nonderivative variables. Conduits Conduits are assumed to be always full of incompressible material. Their internal structure is just a set of n terminals (n 2 2), each of which has an associated flow parameter qi. There is just a single pressure parameter p for an entire conduit. Every conduit has a continuity confluence which captures the notion that material is conserved: ql + ... + qn -- 0 which also holds for the derivative variables: ~ql +... + ~qn = 0. There is also a compatibility confluence for every three conduits which have a path between them. If p I and p 2 are the pressures between conduits C1 and C2, and C2 and C3, respectively, then the pressure p 3 between C1 and C2 must be the sum of p l and p2; i.e. the compatibility condition is: p l + p 2 - p 3 -- 0. Again the compatibility condition may also be formulated for the derivative variables. Care is needed in identifying the parts of the system which are to be modelled as conduits. For example consider a simple two tank system connected by a pipe as depicted in Fig. 5. I~I~',~i~i~,#ii~F~I I I Fig. 5 Two tanks connected by a pipe: what are the components? If we model the pipe as a conduit then the pressure at each end must, by definition, be equal, so the levels in each tank must be equal! In order to reason about a situation where the two levels may be different we must model the pipe as a valve, not as a simple conduit. Producing an envisionment De Kleer (1977) coined the term envisioning to describe the process of inferring a behaviour description from a structural description. The resulting behaviour description, the envisionment, is also k n o w n as the qualitative state diagram, for it describes the possible transitions between c o m p o n e n t states. If a system comprises k devices and each device d has s(d) states then the state diagram for the entire i=k system has I-Is (dl) states; i.e. the system states are formed from the cross product i=1 of all the constituent c o m p o n e n t states. The envisionment thus completely describes all the possible inter state behaviours and certain system wide properties 194 A.G. Cohn may be determined by inspection of the envisionment such as existence of a cycle (e.g. oscillation) and that certain states cannot be reached from certain other states. What is not made explicit in an envisionment is the intra state behaviour, i.e. the changes within a state. A state is specified by conditions on certain variables (those which appear in the qualitative state preconditions in the individual component specifications) and it can be that more than one assignment of values to the complete vector of variables is consistent within a global state. The qualitative state diagram does not make transitions between these interpretations explicit, nor does it show how some variables constrain the values of others. Each internal description of each state of the envisionment is determined partly by simple constraint propagation; however this is not sufficient because the confluences may be simultaneous. Algebraic manipulation is not appropriate because qualitative arithmetic does not satisfy the field axioms (and hence multiple solutions may exist). So ENVISION uses a combination of constraint propagation and 'generate and test' (which they subsequently call plunking) in order to determine completely the possible interpretations of a state. (In an appendix, de Kleer & Brown briefly explain how an expanded envisionment where every state has a unique interpretation can be constructed). QSIM had explicit generating rules which, when applied to a particular variable, would posit 'next' values which satisfied the underlying continuity constraints. In ENVISION these constraints are specified explicitly. Thus any value generated for a variable must satisfy (inter alia) the following constraints. The limit rule states that if time t immediately precedes t' then x(t') = x(t] + ax(t). (The notation x[t) means the value of x at time t]. This effectively prohibits 'standing starts' (e.g. a quantity becoming non zero when its derivative is zero). The continuity rule states that if t immediately precedes t' then x(t) must be adjacent to x(t'); i.e. variables are continuous. The equality change rule ensures that if x = 0 (or any other point), and ax ~: 0, then a new state is created immediately, with x having a different value. Finally, the ordering rule is used in situations such as the following: suppose 3x--= + and y - z = + (i.e. y > z ] . If one component has a state specification s.t. x < y and another component has a state specification x < z , then the global state will alter with only the second component changing state. In their paper de Kleer & Brown show the complete envisionment for a model of the pressure regulator where the mass of the valve is explicitly modelled and thus the velocity and force of the valve are represented. The valve component has nine states because the preconditions depend on the force and velocity, each of which may have one of three qualitative values. The other components in the system (i.e. the sensor, spring and sump) only have a single state so there are only nine states in the total envisionment. The state diagram can be used to answer 'what if' type questions and make predictions. Various different models are analysed with different assumptions (whether there is a continuing input signal or not and whether there is friction). If there is no friction then their program ENVISION correctly predicts that there is no final state and the behaviour is cyclic. If there is friction then a possible predicted behaviour is that the oscillation may terminate (i.e. the Approaches to qualitative reasoning 195 envisionment contains a path that has a node which has no successor node). However there is also a behaviour which is oscillatory, although the real device will always settle to a final state. Note that analysis of the envisionment is 'outside' the theory, i.e. ENVISION leaves it up to a human to interpret the envisionment. Explanation De Kleer & Brown spend some time discussing what constitutes an explanation of behaviour and whether such an explanation is a causal explanation. They develop the notion of an explanationproof, which is a natural deduction style proof of why a particular variable has a particular value; the axioms are the confluences and any input signals. An explanationproof explains intra state behaviour, i.e. it can be used to complete interpretations from the input signals. Obviously in a different state a different set of axioms (confluences) would apply. However, de Kleer & Brown are not entirely happy with explanationproofs as a causal explanation for a number of reasons. Firstly, introduction of premises may be required, even if there is no ambiguity (i.e. the state has a unique interpretation) and these may appear unmotivated. Secondly, indirect proofs (reductio ad absurdum) are sometimes required and they consider these to be non causal, though others may disagree and be happy with explanations of the form 'this variable has this value because if it's this value we get a contradiction and similarly for these values'. The question is whether the proof has to 'simulate reality' or merely explain why a device operates in the way it does. However since we are now treading on very deep philosophical waters we shall not discuss this point further. See, for example, Sosa (1975) or Lucas (1984) for essays on the subject. Another problem that de Kleer & Brown identify with explanationproofs is that they may be non-unique, which they again find unsatisfactory for a causal explanation; the non-uniqueness is of course not surprising; much of the effort of the computational logic community during recent decades has been devoted to reducing the redundancy found in the search spaces induced by the proof system of a logic. Finally, explanationproofs may be 'causally misordered'; e.g. the steps in the proof may not be in the same order as the intuitive causal ordering. Thus, we can say that explanationproofs explain why a system operates in a particular way, not how. When one considers qualitative physics as a modelling process, it is perhaps not surprising that a (qualitative) model does not provide a perfect explanation, for any model makes assumptions about the modelled system and abstracts it; anything beneath the grain size of the model will not be explicable and the abstraction process will inevitably lead to ambiguity. Mythical causality In order to try and introduce a more compelling form of causal explanation, de Kleer & Brown introduce the notion of mythical causality. The idea is to regard change of state as: equilibrium state followed by a sequence of non equilibrium 196 A.G. Cohn states followed by an equilibrium state. Mythical causality 'explains' the sequence of non equilibrium states which cause the equilibrium state change. Assuming the device is initially at equilibrium (i.e. satisfying all the confluences of the state), a single disturbance is introduced (i.e. a parameter change) and constraints are propagated until a new equilibrium is reached. The infinitesimal time this takes in the actual device is called 'mythical time'. As already discussed, propagation may halt before all variables are determined; in order for propagation to continue, three heuristics (all of the form 'places where disturbances haven't yet reached aren't changing') are introduced. These are the component heuristic, the confluence heuristic and the conduit heuristic. For details of these refer to de Kleer & Brown (1984). However it is still possible for the mythical causal account not to be unique (perhaps because it may be possible to use heuristics in several ways; i.e. introduce alternate assumptions). ENVISION produces all mythical causal explanations in the envisionment and thus (unless there is no ambiguity) does not 'causally simulate' the device but rather constructs 'reasonable explanations of how it might work'. Of course, the above heuristics may not be the only ones that could be used when making assumptions, however de Kleer & Brown claim that they are natural in the sense that they were formulated as a result of analysing descriptions of device behaviour given by humans. The Iwaski & Simon debate An extended debate took place in Artificial Intelligence in 1986 (de Kleer & Brown, 1986; Iwasaki & Simon 1986a, 1986b) concerning the work we have been describing here. The main thrust of Iwasaki & Simon's (1986a) commentary was to question the applicability, validity and suitability of de Kleer & Brown's Qualitative Physics and in particular the work on mythical causality. They suggested an alternative methodology for reasoning about equations, such as those to be found in a de Kleer & Brown model, which comes from the mathematical economics literature. A system of equations can be analysed to determine the causal ordering. If no feedback is present then this will give a directed acyclical graph where each variable of the model is a node and the directed arcs are 'causal links'. Variables that depend on no others (i.e. with in-degree 0) are the 'uncaused causes' i.e. they can be regarded as exogonous variables. Actually the causal ordering technique requires n (independent) equations for n variables; if this requirement is not met then additional equations, of the form x=constant will be required. No advice on how to choose such equations however is given. Causal ordering is purely a structural analysis of the equations to determine a direction for each equality, and does not manipulate the functors i.e. no equation solving is performed; also no input signals are needed (unlike the mythical causality technique). Causal ordering is a one off static process, while determining mythical causality is a dynamic (runtime) computation requiring an input signal. Mythical causality will also determine the direction of change but Iwasaki & Simon Approaches to qualitative reasoning 197 claim that this could be added to the causal ordering method as an orthogonal technique. If there is no feedback then all concerned seem to agree that mythical causality and causal ordering are approximately equivalent. However when a feedback loop is present then mythical causality will determine all the interpretations and a (mythical) causal direction round the loop. In order to analyse systems with feedback loops, Iwasaki & Simon advocate the method of Comparative Statics where 2nd order equations are (manually) added (i.e. as part of the process of building the model) and these will usually give a unique solution (provided the feedback loop is stable). However it doesn't determine an ordering for variables in loop: a feedback loop just is; according to Iwasaki & Simon there is no sense in which one event can be said to precede another in a feedback loop. Iwasaki & Simon conclude that Causal Ordering and Comparative Statics are more general than the Mythical Causality technique and also give a formal justification to it (e.g. the assumptions that are introduced by the plunking heuristics are that certain variables are exogonous as determined by the Causal Ordering technique). De Kleer & Brown (1986) constitutes a reply to these comments. They remark that the concerns of those modelling Economics and those modelling physical systems seem to be different. They argue that whereas the form of equations in Economics may be somewhat arbitrary, in physical systems there are real components which naturally give rise to particular kinds equations and that it is natural to think of physical feedback systems having an ordering round the loop. (Of course, some physical systems might be modelled by having virtual sub components (e.g. physiological models are often like this) and the argument may lose some of its force in such systems). They also comment that, as we have already seen, qualitative reasoning generally makes multiple predictions owing to ambiguity; in such cases ENVISION will determine all globally consistent interpretations whereas Iwasaki & Simon's method will only determine a single labelling leaving ambiguous variables unlabelled. They point out that Iwasaki & Simon do not address the problem of how to produce a model (whereas they appeal to their component library). ENVISION is also implemented as a computer program while Iwasaki & Simon's method is not (though for some progress in this direction see Iwasaki, 1987). De Kleer & Brown also make the somewhat controversial claim that ENVISION is a general procedure for solving (possibly non linear) sets of qualitative differential equations. However in their reply, Iwasaki & Simon (1986b) dispute this and state that ENVISION will only deal correctly with non linear differential equations when the model is close enough to equilibrium for linear assumptions to apply. They also ask for a more precise definition of Qualitative Physics: they find it too ad hoc, but perhaps it is too early on to hope for this. They take de Kleer & Brown to task for unstated assumptions behind ENVISION. Finally they ask for clarification of the 'no function in structure' principle. What does it really mean and how can one tell if one has followed it? 198 A.G. Cohn 4. A p r o c e s s c e n t r e d a p p r o a c h We now turn to the final commonly found approach to qualitative modelling in the literature, based on an explicit representation of processes. This approach is due to Forbus (1984a); he is still working on it (Forbus, 1986a, 1986b), and others are now taking a similar approach including Weld (1985), D'Ambrosio (1987), Manzo & Trucco (1987) and Bredeweg (1987). Here, we shall concentrate on the original theory, called Qualitative Process Theory (QPT) as described in Forbus (1984a and b). Unlike Kuipers and de Kleer & Brown, who seem to be primarily interested in building a qualitative version of conventional physics, Forbus is more interested in following on from the ideas of Naive Physics (Hayes, 1979, 1985a, 1985b); however, unlike Hayes, he is interested not only in representational issues but also in the computational aspects. He is influenced by the histories idea from Hayes' work and views QPT as being a Hayes style cluster. From de Kleer's work he uses the idea of envisioning and the qualitative quantity spaces. Of the three approaches we have examined, QPT has the most sophisticated conceptual mechanisms for modelling. Not only do we find representational apparatus for qualitative quantity spaces, differential equations and function descriptions, but also a way of viewing collections of individuals satisfying certain conditions as aggregates with particular behavioural properties. There is also an explicit representation for processes of course. Modelling primitives Forbus assumes Allen's (1983) interval calculus as an underlying temporal basis. Thus 'instants' are just intervals with no subintervals and there are certain primitive relationships between intervals such as starts, ends and meets. Time is not dense because two intervals may have no intervening interval. Forbus defines two functions start and end which map intervals to instants denoting their 'endpoints'. The function during maps an interval to the set of intervals in it, and duration maps an interval to a number (which is 0 for intervals which are instants). T(x,y) means x is true at/during time y. A quantity q represents a continuous function of time which has an amount (A[q]) and derivative (D[q]) (both numbers); numbers are represented by a sign and magnitude (notated by s[] and m[] respectively); a sign is one of - 1 , 0 or I but there is no way of directly representing a magnitude: only a partial ordering on symbolic magnitudes can be given by defining a quantity space. Two points in a quantity space are neighbaurs when they are no intervening points in the partial order; (determining neighbours is important for detecting when processes start/stop). All quantity spaces include zero so that a connection can be made to the sign of a number. This sign and magnitude representation of quantities helps Forbus disambiguate addition of signs which was ambiguous in the positive + negative case in de Kleer & Brown's algebra because if the magnitudes of the two numbers being added are totally ordered in the quantity space then the addition is not ambiguous. Individual views are the modelling device for describing an object (or more Approaches to qualitative reasoning 199 usually a collection of objects) satisfying certain conditions which have a particular behaviour. For example individual views might be created to describe an extended spring, a compressed spring and a relaxed spring. There are four parts to an individual view: individuals are the objects that must exist for the individual view to exist; quantity conditions are inequalities between individuals and predications on other individual views (or processes); preconditions are other conditions; relations are things that are true w h e n the individual view is active. The difference between preconditions and quantity conditions is that the former conditions m a y be affected by the system, the latter are 'external' conditions which cannot be affected by any process. (For example, amount of current drawn versus a switch being on or off; the former quantity may be affected by other quantities but the latter can only be changed by an external agent). An individual view instance will exist whenever a set of individuals satisfies the individuals conditions; it will be active w h e n e v e r the preconditions and quantity conditions are satisfied. Certain kinds of creation and destruction of objects can be modelled by the activity level of an individual view. In particular Forbus (1985) discusses the modelling of quantity conditioned existence. Thus an individual view may be of use even if the relations field is null (no behaviour is specified) because we can use it to model the conditions w h e n an object will cease to exist (for example, Forbus (1984a) models states of matter this way). Normally Forbus represents individual views using a kind of frame notation. He does give an example translation of an individual view so represented into first order logic syntax; however, in the absence of a formally specified translation procedure and m u c h greater discussion of the ontological status of entities such as liquid objects or pieces of stuff which he quantifies over, and without an axiomatization of the envisionment procedure, it is not clear how m u c h this is worth. Some m e c h a n i s m is required in the relations field of an individual view in order to express the behaviour of the objects in the view and in particular the functional relationships that may hold between quantities w h e n the conditions specified in the view are satisfied. Forbus introduces qualitative proportionalities in order to fulfill this need. q I ~Q÷ q 2 means that q I is qualitatively proportional to q 2 and is monotonically increasing in its dependence, q l ~Q_ q2 means that q l is qualitatively proportional to q 2 and is monotonically decreasing in its dependence. For example one might write level(p) ~Q÷ amount-of(p) to express that the level of water in a container increases as the amount increases. Qualitative proportion° alities are similar to Kuipers' monotonic function constraints but differ in that q I ~Q÷q 2 means that q I will increase if q 2 increases and everything else relevant stays the same (relevant quantities are all those which influence ql; see below). Thus q I m a y be a function of more than just q 2: this is not expressible by Kuipers' M ± constraints. Furthermore, the implied function behind a qualitative proportionality can be n a m e d so that it can be used more than once if desired; thus one can express the fact that two (or more) qualitatively expressed functions are the same function. This could be used, for example, to enable the system to infer that if there are two containers whose bottoms are at the same height and which have fluid at the same level, then the pressure at the bottom of each container is identical 200 A.G. Cohn (provided of course the liquids have the same specific gravity). It is also possible to specify that the functions behind qualitative proportionalities are dependent on things other than quantities (e.g. shapes), so that one could restrict the qualitative proportionality concerning the level of fluid above to depend on the shape and size of the container remaining the same (to stop an incorrect prediction being made, when filling a balloon, for example). Correspondences can also be used to further specify the implied function in the same way as we saw with Kuipers' system. Forbus builds on Hayes' (1979) idea of using four-dimensional pieces of space time called histories to describe the behaviour of an object over time. In fact, it would seem that Forbus' histories are configuration space (Lozano-Perez, 1983) histories rather conventional four-dimensional histories, for an object's possible histories include all of the histories of its parameters which measure some linear attribute of the object. The other histories of an object are the histories for the processes it participates in. Hayes' original motivation for introducing histories was to try and provide a more tractable approach to dealing with time and change in order get round the frame problem which is traditionally associated with situational calculus type approaches. The advantage claimed for the histories approach is that by spatially delimiting change one would not have to evolve a complete global sequence of changes and compute the effects of a change on the whole universe; rather one could evolve a set of parallel local histories which could be reasoned about separately until they intersect. Forbus briefly discusses how one might try to separate out what histories can be reasoned about separately and suggests that the frame problem has now been changed to the problem of computing history intersections. However in all the examples he gives, the state is still a global state. Hayes (1987) briefly discusses some further problems with the histories approach. We can now turn our attention to describing how a process is to be represented in more detail. In fact a process is represented in the same way as an individual view except that there is an additional part which specifies the influences which are the source of any change to a quantity in a model. One may write I+(q,n) to specify that the number n positively influences the quantity n; similarly one may write I-(q,n) with the obvious meaning; I ± (q,n) defines an influence with an unspecified sign. For example in the definition of a heat flow process one might write I+(heat(destination),A[flow-rate]) and I-(heat)source),A[flow-rate]). Specifying these influences does not mean that the destination will heat up or the source will cool when the process is active, because there may be other competing influences (from other processes). The influences specified in the influences section of a process are direct influences. Indirect influences on quantities arise because of propagation through qualitative proportionalities. The system manipulates the influences on a quantity in order to determine its derivative which will in turn affect the amount of the quantity over time through an integration procedure called limit analysis. If a quantity is directly influenced, then its derivative is the sum of all the direct influences (it is illegal to write process and view specifications which result in a quantity being simultaneously directly and indirectly influenced). If a quantity is directly influenced both positively and negatively then unless the quantity space can be used to determine whether the positive influence has a Approaches to qualitative reasoning 201 greater magnitude than the negative influence (or vice versa) then the situation is ambiguous and the envisioner will have to fork. Resolving positive and negative indirect influences is more difficult because the lack of information about the exact functions behind the qualitative proportionalities means that the quantity space cannot be used to resolve ambiguities in the same way as when combining direct influences. (However see D'Ambrosio (1987) for some ideas on how to extend QPT to help in this situation by providing a mechanism for specifying which indirect influences dominate). A process instance will exist whenever a set of individuals satisfies the individual's conditions component of the process specification; it will be active whenever preconditions and quantity conditions are satisfied just as is the case with individual views. New individuals may also be introduced in the relations field so that, for example, the steam produced by a boiling process can be explicitly represented. QPT rests on the assumption that 'all changes in physical systems are caused directly or indirectly by processes', what Forbus calls the sole mechanism assumption. A consequence of this is that provided we make a closed world assumption that the model contains all definitions of all relevant processes then we can reason by mutual exclusion about what can change and how. The final modelling primitive provided by QPT is the encapsulated history. Some phenomena (such as collisions between moving objects) are not easily represented by processes; rather Forbus uses encapsulated histories which have the same syntax as individual views (i.e. individuals, preconditions, quantity conditions and relations) but where the relations specify pieces of histories (i.e. slices) for the individuals involved. For example a simple encapsulated history for a collision event e (in one dimension) between a moving object b with direction dir and an immobile object c might have a relations field which specified M[A[velocity(b)],start(e)] = -M[A[velocity(b)],end(e)] M[velocity(b),during(e)] = ZERO duration(e) = ZERO T( direction-towards(c,b,dir),end( e) ) T(contact(b,c,dir),end(e)) where M[x,t] denotes the magnitude of x at time t and T(p:t) means that p is time at time t. Encapsulated histories are somewhat ad hoc since they violate the principle of composibility; we are not describing a situation by describing its parts but by describing a behaviour which refers to times explicitly. Forbus does not describe how encapsulated histories are integrated into or used by the deductive mechanism described below. Deductive apparatus We will now examine the machinery which manipulates the modelling primitives we have been describing in order to produce a behavioural description. The main activities are as follows. 202 A . G . Cohn Instantiation of processes and individual views creates individual view and process instances given a particular domain description of individuals w h i c h exist and a library of process and individual view definitions (the process and individual view vocabulary). Given a collection of process and individual view instantiations then the process structure can be created, i.e. the quantity and pre-conditions of these instances are examined to determine which instances are currently active. Given a process structure, the influences (both direct and indirect) must be resolved to determine the derivatives of all the quantities. Note that feedback loops will always contain a process which will start an influence chain, so there is no possibility of a circular loop of indirect influences causing problems in the implementation. Limit analysis is a procedure which determines how quantities being influenced will change their amount, which may in turn lead to changes in the process structure because activation conditions may be altered. Finally, a complete envisionment can be built where each node of the envisionment has a unique process structure. Forbus also describes a summarization procedure on an envisionment. The limit analysis procedure mentioned above deserves a little further explanation. Most elements of a quantity space will come from (be used in) the quantity conditions of processes and individual views. Such conditions act as boundary conditions and these elements are called limit points. For each changing quantity q (i.e. s(D[q]) ~ O) all neighbouring points in quantity space to A[q] are found (these are other quantities). The signs of the derivatives of the quantities involved are examined to determine if inequality can change. (Rates (derivatives) are assumed not be infinitesimals so a quantity 'moving' towards a point in the quantity space will eventually reach it). The set of single such changes plus consistent combinations are the quantity hypotheses. Quantity hypotheses which change the process structure are called limit hypotheses. Ambiguity (i.e. several quantity hypotheses) can occur for several reasons: for example the quantity space may not be a total ordering; a process may influence more than quantity; more than one process may be active. QP theory cannot disambiguate in general except in the special case when the equality change law helps: 'With two exceptions a process structure lasts over an interval; it lasts for an instant only w h e n either (1) a change from equality occurs in a quantity condition or (2) a change to equality occurs between two quantities in a quantity condition and they were only influenced from equality for an instant'. Thus change from equality only takes an instant, but to equality usually takes some interval of non zero duration. For example, if b=c and d~e and all the derivatives are non zero then b and c will change from equality before d=e. The equality change law means that it is possible for two consecutive states to be instants and more generally for there to be a cycle in the envisionment consisting entirely of such instantaneous states. Forbus calls such cycles stutter cycles since they do not reflect true oscillations but rather dynamic equilibrium behaviours such as a rising heat equilibrium between a series of objects with heat flows between them. His program summarizes such cycles into single states. Approaches to qualitative reasoning 203 Causal reasoning in QPT Forbus observes that traditionally equations and constraints are not used in all directions when reasoning 'causally'. Thus in QPT there are no bi-directional equations, only influences and qualitative proportionalities which are unidirectional. Therefore when building a model one has to decide in which direction(s) causality can operate across an equation which will in turn decide which quantities are directly influenced by processes and those only indirectly via qualitative proportionalities. The fact that all changes originate from some process gives a very strong direction of propagation of change in the system (compared to the other systems we examined earlier). Forbus discusses this and sees it as a strong point of QPT and embodies this way of dealing with change and causality in his Causal Directedness Hypothesis: 'Changes in physical situations which are perceived as causal are due to o u r interpretation of them as corresponding either to direct changes caused by processes or propagation of those direct effects through functional dependencies'. Thus, unlike the situation in de Kleer & Brown's theory where mythical causality and plunking heuristics were introduced, in QPT we never have to guess or make assumptions about whether a variable is changing or not, only whether a process is active and the best way to resolve influences. Building domain theories Although we have so far been concerned with the development of QPT, Forbus was originallymotivated to develop this representational and inferential apparatus in order to develop a naive physical theory of the world. He envisages a library of general process and individual new descriptions which can be used to model and then reason about physical situations. His doctoral thesis (Forbus, 1984b) contains the beginnings of such a library. 5. C o m p a r i s o n of a p p r o a c h e s It is appropriate to step back and try to review the three approaches we have described to compare and contrast them. Apart from the obvious differences of whether or not the approach is component, constraint or process centred, we could identify a number of other dimensions along which the systems could be compared, including the representation of quantities, the language for describing behaviour, the nature of the qualitative simulation, the extent to which the theory makes predictions which are faithful to reality and the treatment of causality. We shall examine each of these. Qualitative quantity spaces Common to all the approaches we have examined is the idea of a qualitative quantity space. It turns out that even only making the distinction between +, - and 0 can be very effective: de Kleer & Brown always use this quantity space for derivatives (and for non derivafive variables as well usually} and Kuipers uses this 204 A.G. Cohn quantity space for his 'qualitative directions'. It has the advantage of making computation easy and faster because there are fewer possible states and thus fewer branches when ambiguity occurs. However, it is less expressive. In order to make more distinctions using this three valued quantity space, extra variables have to be introduced; for example if we wanted to have a quantity space for some variable x which represented possible temperatures and we wanted to distinguish the regions separated by absolute zero, freezing/melting, and boiling/condensing, then we would have to introduce a further three variables (called, say, az, fm and bc) and defining equations, e.g. bc - fm = +, fm - az = +, az = 0. Three regions and three landmark values (not counting infinity) are now possible compared to the normal two regions and one landmark value. A precondition on a qualitative state, could now depend on the condition x ~ f m (in this example all states would obviously have the precondition x - a z ) . However introducing extra variables seems to be less natural and perhaps less efficient compared to building additional divisions into the quantity space itself. Moreover the results of Struss (1987) concerning the special status of the quantity space { - , 0 , + ) would seem to imply that we have lost absolute expressive power. Forbus alone allows partially ordered quantity spaces, which is more expressive, though of course the above auxiliary variable mechanism could be used to code up partial orderings. A distinguishing feature of Kuipers' quantity spaces is the dynamic landmark creation. This enables him to distinguish between increasing, steady and decreasing oscillation but means that his simulation may never terminate and thus he can only simulate from a starting state and cannot consider producing an envisionment as can Forbus and de Kleer & Brown. Kuipers does point out that it is very easy to change his transition tables to stop dynamic landmark creation if desired. The crucial point about a qualitative quantity space is that it is a finite, discrete space which is much more amenable to reasoning about than the underlying continuous quantitative space. In particular sets of equations can be solved by a finite number of guesses if required and the number of possible states and behaviours is also finite (unless dynamic landmark creation is allowed). Behaviour specification l a n g u a g e All three languages include plus and minus but only Kuipers includes multiplication (de Kleer & Brown prefer to eliminate multiplication by creating more states). All three languages have explicit three valued derivatives. Both Kuipers and Forbus have abstract function descriptions which may have corresponding values; Forbus' representation is the more general and powerful. Forbus also has a mechanism for the partial specification of functional relationships through his mechanism of influences. De Kleer & Brown do not have a monotonic function constraint, but it would be less useful with only ( + , - , 0 ) quantity spaces. A weak form of monotonic function constraint between two variables can be encoded in their system by saying ~x = ~y. In all three systems there is a mechanism provided so that different Approaches to qualitative reasoning 205 operating regions can be specified. This can be used to break up a non monotonic function into series of monotonic operating regions. In Kuipers' case this is only at the global level: an entire model is swapped in or out; in the other approaches individual components can have different qualitative states and behaviour specifications (de Kleer & Brown) and different individual views can be specified with different relation fields (Forbus). Constraint versus component versus process centred approaches A comparison of different approaches to qualitative modelling including the component, constraint and process centred approaches can be found in Bonissone & Valavanis (1985) who survey the field briefly and build a model of a coffee maker in each of the theories. The constraint centred approach is certainly the simplest in many ways but unfortunately provides no explicit help with the hard task of modelling, nor is there any attempt to build a qualitative physics; the main emphasis is on the simulation algorithm. Of course one could imagine building an interface which helped with modelling and in fact this has been done for the case of physiological compartmental systems (Leaning & Nicolosi, 1986). The device centred approach aids modelling, not only by encouraging a user to modularize the system description but also by having a component library available. Causal connections between components are made explicit in the model by specifying the linking conduits. Provided the component descriptions obey the 'no function in structure principle', decriptions should be composable. Of course, it may still be a problem for the modeller to choose component descriptions from the library to fit the system (cf. the discussion earlier about a pipe needing to be modelled as a valve). Some systems (for example electronic circuits or pneumatic systems) can be very naturally viewed as networks of standard components; however it is not clear that all physical systems fall into this category, even such a simple system as a ball bouncing on a table top. Forbus' Qualitative Process Theory certainly has the most sophisticated set of modelling features and the most complex ontology. Arguably, this allows better explanations of device behaviour because, for example, processes can be explicitly discussed. Causal connections are not explicitly built in, but are discovered dynamically by influence resolution. Moreover, the explicit representation of processes and the sole mechanism assumption seems to allow for a more natural representation for causal reasoning compared (say) to de Kleer & Brown's mythical causality. Moreover, because all influences and qualitative proportionalities have a built in direction, there is no need for any input assumptions or causal ordering as required in bi-directional equational systems. QPT can also explicitly represent and reason about state changes such as turning water to steam which can be at best implicitly represented in the other systems. Of course the underlying machinery is much more complicated, difficult to implement and would seem to be more computationally expensive. Moreover, while both QSIM and ENVISION are based on traditional mathematical theories, QPT has a 206 A.G. Cohn much less well defined formal semantics. ENVISION can display a logical derivation of the envisionment, while the inferential procedure of QPT is defined purely procedurally. (Forbus displays informal logical translations of some process and individual view descriptions but does not attempt to axiomatise the envisionment procedure). However Forbus is particularly interested in modelling naive physics and thus is perhaps less concerned as to how or even whether his theory corresponds to traditional theories or to reality. Of course, in the absence of a semantics, one can not even ask such questions. (See Hayes, 1974, 1977; McDermott, 1978; Israel, 1985 for further discussion of this last point). The question of correctness of qualitative simulation algorithms is further discussed below. Other approaches to structuring qualitative models include Addanki & Davis (1985) and Bylander & Chandrasekaran (1985). Qualitative simulation Although this article is entitled 'Qualitative reasoning', the actual reasoning techniques we have discussed have been mainly limited to some form of 'qualitative simulation'. In each case this has lead to an induced qualitative description of time (though QPT also allows some explicit description of time via encapsulated histories). In de Kleer & Brown's system, mythical causality also induces a finer level of qualitative time, consisting entirely of instants, within a qualitative state, which they call mythical time. Owing to the low grain of resolution in qualitative quantity spaces, qualitative simulation may give rise to ambiguous predictions, unlike a standard quantitative simulation. A distinction can be drawn (see Forbus, 1986a) between a total envisionment and an attainable envisionment. In the latter only all states attainable from some initial start state are generated (as in the programs NEWTON (de Kleer, 1977), QUAL (de Kleer, 1979) and GIZMO (Forbus, 1984b)). In a total envisionment all possible start states are considered (e.g. ENVISION (de Kleer & Brown, 1984) and QPE (Forbus, 1986b)). A history is just a path through an envisionment. Kuipers' QSIM does not produce an envisionment since there are potentially infinitely many states owing to landmark generation. If there were no dynamic landmark creation then the simulation structure would resemble an attainable envisionment. Each state in a QSIM simulation is distinguished by being a unique assignment of values to variables, in de Kleer & Brown's representation by being a unique selection of individual component qualitative states and in Forbus' system by being a unique process structure (i.e. collection of active processes and individual views). Cycles in a simulation represent oscillation (possibly a rising equilibrium if a QPT cycle contains only instantaneous states). A distinction that could be made between qualitative and quantitative simulation, is that the latter produces an exact (within the precision of the machine) answer which is possibly inaccurate owing to rounding error, whilst the former produces an exact prediction, but at lower precision. Approaches to qualitative reasoning 207 What are valid state transitions? All systems we have discussed so far enforce continuity constraints on the qualitative quantity space. Corresponding value contraints may be present in Forbus' and Kuipers' systems. Obviously any new state must be internally consistent (all equations and conditions must be satisfied). De Kleer & Brown enumerate a number of transition rules between qualitative states. These have analogs in the other two representations. The limit rule is encoded in Kuipers' transition tables and in QPT by the fact that variables do not change unless influenced. The adjacency rule is encoded in QSIM's transition tables and because of the total ordering of his quantity spaces and in QPT's use of neighbours during limit analysis. The ordering rule has no real analog in QSIM because there are no components but has an analog in QPT in the partial orderings of the quantities specified in quantity conditions and the neighbourhood relation. The equality change rule is encoded into Kuipers transition tables and Forbus' equality change law; however in QPT there is a second part to the equality change law which has no analog in the other systems. Correctness Kuipers asks the question: do the behaviours predicted by qualitative simulation correspond to reality? Although he can show QSIM to be complete (i.e. all real behaviours are predicted), QSIM may also predict extraneous behaviours. This analysis depends on the assumption that the qualitative model is an abstraction of an underlying quantitative ODE and the notion of correctness is relative to this semantics. Since a set of qualitative constraints may represent more than one quantitative ODE, behaviour predictions may relate to any of these. However it is also possible, because of the local nature of the simulation, for genuinely spurious behaviours to be predicted. Neither Forbus nor de Kleer & Brown explicitly discuss the mathematical correctness of their theories. Struss (1987) has investigated the correctness of the qualitative arithmetic in a variety of systems including QSIM and ENVISION. Assuming that the correctness is defined with respect to standard arithmetic on the real numbers and qualitative constraints or equations are to be viewed as abstractions of standard equations on the reals then he produces a number of important negative results about qualitative reasoners in general. In particular, he shows that no qualitative reasoning method which has finite quantity spaces preserves the associativity of the arithmetic operators unless the quantity spaces are all just -/0/+. Lack of associativity means that different orders of computation may yield different solutions. He defines notions of soundness and completeness for qualitative reasoners with respect to an underlying gold standard of the reals and shows that no qualitative reasoning method can be sound (even what he calls 'weakly sound') for sets of even very simple kinds of equations. He demonstrates that this unsoundness arises due to the same variable occurring more than once. Of course transforming a set of equations to satisfy this requirement amounts to virtually solving them and we would expect variables to 208 A.G. Cohn occur many times in general so this is a very strong limitation on the soundness of qualitative arithmetic. The number of spurious solutions can be reduced by ensuring that each equation or constraint does not contain more than one occurrence of a variable but this does not ensure global soundness. Apart from algebraic manipulations to transform equations locally, he suggests combining quantitative knowledge and qualitative knowledge where available using a formalism such as that in Simmons (1986). Struss also wonders whether the condition enforcing the exclusivity of qualitative values (i.e. existing qualitative reasoners always assume that the intervals denoted by values in a qualitative quantity space are pairwise non intersecting sets) could be relaxed. He points to the work on qualitative quantity spaces based on non standard analysis (Lutz & Goze, 1981; Raiman, 1986) as a possible step in this direction. He also suggests using Partial Sets (Klaua, 1969) as a representation technique which might help. 6. Uses of q u a l i t a t i v e r e a s o n i n g We have already come across some uses to which qualitative reasoners might be put, in particular explanation (how does this system work) and prediction (what might happen if). Other tasks that one might want to use qualitative models for include diagnosis (why does the system behave in this way and how could we make it behave in that way), measurement interpretation (what is the system doing if we observe these parameter values; clearly this might form part of the diagnosis task), verification and mental modelling. One can obviously imagine combinations of these tasks such as what Forbus calls a 'Doubting Thomas' system (-- measurement interpretation + explanation), which could be used in critical applications to help avoid the human operator of a physical system being blinkered. We have already discussed explanation of behaviour using qualitative models when discussing de Kleer & Brown's work. Other work on explanation using qualitative models which has not been mentioned includes Forbus & Stevens (1981) and Laughton (1985). Diagnosis One approach to diagnosis is to build in faulty behaviours into component descriptions, as is done in, for example, Kardio (Bratko et al., 1986) which we will describe below. This is not the same as a global list of faults for the entire system, for it is much easier and more viable to imagine specifying a fault list for every component type rather than globally for an entire system. The process of envisioning would then build a description of all ways in which faults or combinations of faults affect the global system behaviour. One obvious disadvantage of such an approach is that it will not deal with assembly or design errors, nor with faults which are not explicitly foreseen in any component description. Nor will it deal with changes in structure (owing perhaps to a short circuit). However, a greater problem in practice is likely to be the combinatorial explosion. This results from considering all the Approaches to qualitative reasoning 209 possible interactions of faulty and correct behaviours of individual components. Of course one can imagine certain strategies to help here, such as multi-level models, or making a single fault assumption at first but there is still something rather inelegant about having to pre-ordain all the ways in which all the components can fail. Also note that this technique is only applicable in a component centred approach (where one would have a different qualitative state within each component state for each faulty behaviour) or the QPT approach (where one would have a different individual view for each faulty mode of behaviour of a component), but not in the global constraint model of Kuipers. The alternative approach is to dispense with explicit fault models and dynamically infer which components are faulty. This is the technique Davis (1984) used. More recently this approach has been investigated by de Kleer & Williams (1987) and, independently, Reiter (1987), with particular attention to the problem of diagnosis in the presence of multiple faults. Reiter's approach is more formal, whilst de Kleer & Williams have implemented a system, based on the ATMS (de Kleer, 1986a, 1986b, 1986c; Reiter & de Kleer 1987). Their program, called GDE (General Diagnostic Engine), tries to manipulate sets of candidate assumptions about which components are faulty, as efficiently as possible. Moreover GDE will propose further measurements to help distinguish between candidate sets. Given information about the likely failure of candidates, it will do this optimally (from the standpoint of the likely number of such tests). The input to GDE consists of the structure of the system, the component behaviour definitions, the a priori probabilities of every component failing and an input vector of observations. So far, the technique has only been applied to digital domains (though see Dague et al., 1987). Other work on diagnosis in a qualitative reasoning setting includes Bareiss & Farquhar (1986) who built a diagnostic engine on top of QSIM (the report includes the PROLOG code) and Chandrasekaran et al. (1987) who discuss diagnosis using a deep model of the domain. Measurement interpretation An interesting use of a qualitative envisionment to help interpret numerical data is described by Forbus (1986a). The technique itself is domain independent but assumes that a total envisionment can be generated and the availability of some (probably domain specific) technique for translating numerical values to qualitative values. The input to the measurement interpretation procedure is a set of sequences of measurements of certain parameters which occur in the envisionment (the relative times of all the measurements must be known). Initially, an assumption is also made that all measurement sequences are close, i.e. are taken often enough not to miss anything 'of interest'. The input measurements for each variable are grouped into a sequence of maximal intervals (which meet, since closeness is assumed), during which the parameter does not change qualitative value; these intervals are called segments. Each such interval may or may not be associated with a single qualitative state in the envisionment. 210 A.G. Cohn Global segments (i.e. which contain all the observed parameters) are constructed from these individual parameter segment sequences. During each such global segment, no individual measurement changes, and every global segment starts some individual segment and finishes some individual segment. Each global segment is likely to correspond to a single qualitative state in the envisionment. A global segment can be viewed as a partial description of one or more qualitative states in the envisionment. The p-interps of a global segment are the qualitative states which are consistent with it (these can be computed dynamically or simply looked up if the total envisionment is already built). If the system is large and only a few variables are being measured then each global segment is likely to have many p-interps so some kind of pruning is required. Domain specific knowledge can be used if available; however a Waltz filtering algorithm can prove remarkably effective. Since the data is assumed to be close, for every pair of global segments gl and g2, such that gl meets g2, any p-interps of gl which do not have a successor in the p~interps of g2 can be discarded from the set of possible p-interps for gl. Similarly any p-interps of g2 which are not a successor of some p-interp of gl can also be filtered out. This procedure is repeated as usual until it can be applied no longer or some global segment has no p-interps left; in this latter case either the initial data was inconsistent, the assumption that the data was close is false or there is a hidden transition problem. A hidden transition problem occurs when two adjacent states in envisionment are identical with respect to the measured variables; this can be dealt with by including extra states in p-interps. If the Waltz filtering algorithm terminates normally, then the remaining p-interps can be used to construct possible behaviour sequences. Forbus describes a simple example which demonstrates this technique very effectively. The system consists of a beaker whose temperature can be measured and which contains liquid. The only liquids in the world are alcohol and water. The model states that the boiling temperature of alcohol is lower than that of water (but the absolute temperatures are not known). The only processes modelled are heatflow and boiling. The model ignores heat flow to the atmosphere, any gasses produced, and possibility of the beaker exploding or melting. A sequence of temperatures of the beaker are available but only the derivative of this parameter is any use since the absolute boiling points are not known. Thus the global segments are trivial to compute and consist of (as it happens) six intervals during which the derivative of the temperature is alternatively positive and zero. There are alternately seven and four p-interps for each of the global segments. However, after Waltz filtering, a unique prediction of the behaviour which produced the observation set is made. Firstly there is water and alcohol in the beaker and heat flow to the beaker. Next the alcohol starts boiling. Then there is just water left in the beaker. Then the water starts boiling. After that the beaker is empty and finally the heat flow stops when the beaker reaches an equilibrium temperature. It is worth making a small aside here: M. Mavrovouniotis (personal communication) has pointed out that the input data Forbus gives could not be actually obtained in the real world: the temperature of a beaker containing water and alcohol being heated will not have an alternating sequence of zero and positive gradients; such Approaches to qualitative reasoning 211 behaviour will only occur when the two liquids are not miscible (e.g., mercury and water). If sparse data is given or detected Forbus suggests using the above procedure to try and detect close sub-sequences and then finding a path in the envisionment to close the gap. He admits that cycles in the envisionment may cause problems but does not make any particular suggestions to cope with this. Other applications of qualitative reasoning Other applications of qualitative reasoning which we do not have the space to describe further here include control, planning and design. Clocksin & Morgan (1986) describe a qualitative controller. Hogge (1987) is an account of his investigations into building planning operators from QPT theories. Dyer et al. (1986, 1987) is a fascinating account of their theory of 'naive invention'. 7. Efficiency issues So far we have talked little of the practicality of the techniques we have been describing for large problems; almost all the examples in the literature are limited to small systems (this perhaps applies less to those working in digital domains such as Davis (1984) or Barrow (1984)). However even for small systems the qualitative simulation can be quite expensive; for example GIZMO, Forbus' first implementation of QPT took one and three quarter hours to produce a 14 state attainable envisionment of a problem involving just three containers (Forbus, 1986b). Of course, it is reasonable to expect that large systems will have complex behavioural descriptions and will thus give rise to large envisionments; however, the problem of qualitative ambiguities may result in a combinatorial explosion of possible state transitions. Work on improving the efficiency of qualitative reasoners has proceeded on a number of fronts. For example the basic implementations have been improved. Methods are being developed to reduce the problem of qualitative ambiguities. Hierarchically organized qualitative models have been shown to be of help. If the model is fixed, then one can produce the envisionment once and for all and subsequently use it for tasks such as explanation, diagnosis or measurement interpretation: this effectively amounts to a compilation of the model. We will discuss all these approaches below. Progress on the basic implementation of qualitative reasoners include Forbus' new implementation of QPT (called QPE) using de Kleer's ATMS (de Kleer, 1986a, 1986b, 1986c; Reiter & de Kleer, 1987) which appears to run approximately 95 times faster (Forbus, 1986b). Thus QPE takes less than four minutes to produce an envisionment for the three container problem mentioned above. Moreover QPE produces a total envisionment, rather than an attainable envisionment, which has more states, 66 in this example.) The QSIM implementation of Kuipers' theory described in Kuipers (1986) runs some 30-60 times faster compared to his earlier program (Kuipers, 1984), in part attributable to the use of Waltz filtering. 212 A.G. Cohn An important part of qualitative reasoning involves manipulating constraints and reasoning about inequalities: it is clearly important that this kind of reasoning is efficiently implemented. Forbus (1987a) describes the inequality reasoning in QPE using an ATMS. Simmons (1986) describes a constraint reasoning system in which both qualitative and quantitative information can be combined and integrated efficiently. The systems described in Simmons & Davis (1983) and Mohammed & Simmons (1986) both use the quantity lattice representation developed in Simmons (1986). Sacks (1987a) describes his program BOUNDER, which reasons about inequalities efficiently. In fact, BOUNDER contains four different inequality reasoning algorithms, arranged hierarchically from the point of view of both efficiency and the range of problems they can solve. Davis (1987) reviews a number of constraint propagation algorithms and analyses them from a theoretical viewpoint. One approach to reducing qualitative ambiguities is to use higher order derivatives. The use of higher order derivatives in qualitative reasoning was first investigated by de Kleer & Bobrow (1984). Morgan (1987) uses a vector of qualitative values and their derivatives in order to be able to differentiate and integrate within a qualitative algebra. Here, we will consider Kuipers & Chiu (1987) work which has extended Kuipers' representation in order to reduce the qualitative ambiguities which can be particularly harmful in his system because unnecessary landmark creation may result. They consider coupled systems such as two cascaded tanks. QSIM exhibits chatter with this system; i.e. a variable (representing the net flow into the second tank) remains positive, but its derivative wanders between the three qualitative values and new landmarks also get created. Very many behaviours are thus predicted. The problem is that not enough is known about the function behind a monotonic function constraint to know what to do at critical points (i.e. when the derivative is std). Two solutions are proposed. The first collapses behaviours, by telling QSIM to ignore derivatives of the chattering parameter. The second involves making additional assumptions about all the variables and automatically analysing the set of constraints to derive additional rules for what to do at critical points. In order to collapse behaviours, an extended version of QSIM can be told that the qdir of certain parameters can only have a new value ign. Thus, for these parameters, values of the form <c~,inc> <c~,std> <c~,dec> are collapsed to <c~,ign> eliminating the possibility of chatter occurring. Certain checks are still required to ensure that continuity conditions are not violated. For the two cascaded tanks, only two behaviours are now predicted: (i) both tanks reach equilibrium simultaneously and (ii) tank A reaches equilibrium before tank B. It turns out that (ii) is spurious and that (i) represents several real behaviours. The second technique involves trying to use higher order derivatives. In a quantitative linear ODE, the behaviour at a critical point is determined by the first non zero higher order derivative (the curvature of the parameter). However unless care is taken, introducing higher order derivatives may just increase opportunity for ambiguity and increase the complexity of simulation because more variables are Approaches to qualitative reasoning 213 present. Higher order derivatives are only needed when the first order derivative is zero (i.e. std). The essential idea of Kuipers & Chiu's method is to find automatically the highest order derivatives (HODs) of a system and then automatically derive constraints on the second derivatives of these when their first derivative is zero, in terms of the other existing parameters. (Of course if the second derivative is also zero the ambiguity is still present). F i n d i n g HOD(s) is easy: the constraints are represented as a network, and paths from DERIV constraints are traced through M ± and MINUS constraints and further DERIVconstraints until blocked by an ADD or MULTconstraint; maximal derivatives in these paths are the HODS. (If a path is circular and thus there is no HOD then the curvature constraint is already encoded in the system). A simple algorithm is given to define the second derivative of HODs in terms of other parameters. The algorithm assumes that the functions behind monotonic function constraints are approximately linear locally. For example, in a two tank coupled system, the HODs are the netflows through the two tanks and the method derives expressions for the second derivative of each of these in terms of the first derivative of the other. QSIM then predicts a unique behaviour. The first method must be hand applied (at present); the second method is automated, but makes stronger assumptions. Kuipers & Chiu claim that both these techniques are more generally applicable than just to QSIM. In further work jointly with Lee (Lee et al., 1987), they continue the development of the technique of using higher order derivative constraints for reducing ambiguity. They also give consideration to the use of extremum constraints and system properties. For example, when QSIM simulates a damped spring the behaviour tree is very explosive (at depth eight, approximately half an oscillation, there are already 35 leaves in the simulation tree!). Applying second order derivative constraints gives a unique behaviour at depth eight, but 21 behaviours at depth 16. Analysis of the underlying ODEs implies that oscillation should decrease. They derive extremum constraints which then restrict the number of behaviours to six at depth 16 (including one cycle of length 11). Analysis of system properties can also have a dramatic effect on QSIM's branching behaviour. For example when the first branch occurs in the simulation of the damped spring the state is x=<(O,inf),dec>, v=<(minf,O),inc>, a=<(O,inf),inc>. QSIM predicts three successor states: x=<(0,inf),dec> x=<0,dec> x = <O,dec> v=<(minf,0),inc> v=<:(minf,0),inc> v= < (minf,O),inc> a=<(O,inf),std> a=<(O,inf),std> a = <(O,inf),inc> However any given spring will behave in the same way so the same decision should be made subsequently. This yields a simulation with one cycle and three infinite branches. Analysis of the initial state can constrain simulation to predict unique behaviour. At present none of the above analysis and application of extremum and system property constraints is implemented. 214 A.G. Cohn The Kardio project An interesting piece of work which deserves study especially given our current concerns with efficiency is the Kardio project (Bratko et al., 1986; Mozetic 1987a, 1987b). Kardio is a qualitative model of the electrical control system of the heart. An ECG measures electrical activity and can be used to help diagnose electrical disorders of the heart. The question is, if an ECG is not normal, what disorders could have caused it. There are 30 basic disorders (cardiac arrhythmias). However, what complicates the issue is that multiple arrhythmias (up to seven) are not uncommon. Bratko et al. (1986) report that it has proved difficult to construct a conventional 'surface' rule base from clinical interviews. So they constructed a qualitative model of the heart where electrical signals are not represented as voltages but symbolically, specifying qualitative features of signals. The model is a component model consisting of a network of components such as impulse generators, conduction pathways, impulse sumators and ECG generators. Normal and abnormal behaviours were associated with components (e.g. blocked, block every third impulse .... ). A dictionary of simple arrhythmias also formed part of the model. A qualitative simulation algorithm was implemented which would predict an ECG from a given combination of arrhythmias. Running the simulation backwards would enable diagnosis, but proved to be much too inefficient because of the higher branching in this direction. Their solution was to compile the qualitative model to create a surface style rule base. The simulation algorithm was run on all possible legal combinations of arrhythmias (2419 out of 2804011 mathematically possible combinations). This was rather expensive computationally, but was a 'one off' computation. This produced a set of 8314 <arrhythmia, ECG description> pairs which could be used for diagnosis or prediction equally efficiently. Also described in the paper is an interesting application of an inductive learning algorithm which was used to compact this rule set by a factor of about 200. More recently, Mozetic (1987b) has reformulated the qualitative model as a three level hierarchical qualitative model. The abstraction levels are created by varying the Component granularity (i.e. a component at one level may be a set of components at another level), by introducing more variables and by making the qualitative quantity spaces more finely grained (for example, at level one there is only the distinction as to whether an electrical pulse is present or not; at the second level the pulse type is distinguished and at the most detailed level the precise shape of the pulse is represented). It turned out that with this hierarchical model it was computationally feasible to perform diagnosis directly from the qualitative model rather than having to compile a set of surface rules because the solutions at more abstract levels could be used to constrain the solution process at the lower levels. Temporal abstraction Kuipers (1987a) describes an interesting way of improving the efficiency of reasoning about an equilibrium system. It depends on being able to view a device as a set Approaches to qualitative reasoning 215 of interacting sub-devices which operate at very different speeds. An intermediate speed device can then regard a faster one as operating instantaneously and a slower one as constant. He outlines a technique for exploiting such a temporal device hierarchy and gives an example drawn from medical physiology: the water sodium balance system. 8. T i m e As just indicated, temporal reasoning can be very important when reasoning about physical systems but has somewhat second class status in most of the systems we have described. Only in QPT are there explicit primitives for referring to temporal intervals. Temporal knowledge and constraints are generally built into the systems at a very low level such as continuity assumptions. Unsatisfied with this state of affairs, Williams (1986) has tried to separate out the temporal reasoning component of a qualitative reasoner. He built a temporal constraint propagator (TCP) which can be used as the temporal reasoning component of a qualitative reasoner such as his earlier system (Williams, 1984). His major motivation for this is to be able to reason more efficiently about time and to be able to change and experiment with different ontologies for time without having to change the rest of the qualitative reasoning system. Thus there should be a clean and well-defined interface to the temporal reasoner. He notes that all the qualitative reasoners we have been describing here (and others) are essentially based on a single global state and thus suffer from all the problems of the situational calculus; in particular, unnecessary temporal distinctions have to be made as to the temporal ordering of essentially unrelated events. This in turn leads to extra states and therefore larger envisionments and more inference. The problem is essentially the well-known frame problem. Moreover, in existing systems (perhaps with the exception of Forbus' measurement intepretation procedure) prediction, diagnosis and other tasks always assume an input with no temporal extension; ideally one would like to be able to describe time varying inputs. Another problem Williams identifies is the difficulty of describing actions (or processes) with a delayed effect. In TCP, every variable is represented by a sequence of ~interval,value~ pairs such that the intervals are contiguous and no two adjacent intervals have the same value (i.e. the intervals are maximal). He calls such a sequence a concise value history for the variable. The basic inference mechanism in TCP is constraint propagation, where the values being propagated are ~interval,value~ pairs. Values can be propagated through constraint equations provided the intervals involved intersect, in which case the propagated value will refer to the interval which is the intersection of the values involved in the deduction. It is also possible to associate a (possibly infinitesimal) delay with a rule so that the new interval starts later. TCP checks consistency by ensuring that overlapping episodes for the same variable have the same value. TCP also ensures that all histories are maintained in a concise state. The inputs to TCP are any input histories and of course the equations defining the model and the qualitative description of the domain. The outputs are the value 216 A.G. Cohn histories for all the variables and their justification histories i.e. the reasons why they have the values they do (in terms of the deductions made). TCP will make calls to a special interval reasoner which will answer questions about relationships between intervals (for the same variable). Special care is required for disjunction (e.g. intersection is expressed using disjunction and start and end points), because reasoning with disjunctive intervals is potentially explosive; the algorithms exploit the fact that the disjunctions have a common time point. His interval reasoner is polynomial (but unfortunately incomplete!). In order to build a Qualitative Physics system on top of TCP one has to specify the details of the representation for time (e.g. whether intervals are open or closed) and write constraints which define the qualitative arithmetic to be used, the continuity constraints in variables across adjacent intervals and of course the particular system to be modelled. In his paper he gives an example from the digital domain of an SR-latch built with crosscoupled NO~ gates and also the mass on a spring example we have seen before. We mentioned above that an explicit theory of time is required by TCP. Work on building temporal logics and axiomatising theories of time suitable for qualitative reasoners and naive physics includes McDermott, 1982; Allen, 1983; Allen & Hayes, 1985; Ladkin, 1987; Hayes & Allen, 1987. Shoham has published extensively on time and causality. Shoham (1985c) discusses criteria for a good theory of time and change. Shoham (1985d) discusses temporal representations for reasoning about causation. 9. Qualitative s p a t i a l r e a s o n i n g It will be noticed that none of the examples which we have discussed so far require any sophisticated spatial reasoning or representation. In particular all spatial reasoning and representation has been one dimensional (for example, the level of a liquid, the 'x' position of a spring on a surface). Moreover all derivatives have been with respect to time. To develop a general qualitative physics would obviously require more powerful qualitative spatial reasoning. There has been very little work in this area. Much of the work in AI generally on spatial representations, for example for Robotics or Vision, has been explicitly quantitative. Moreover Saund (1987) argues for a much richer representation language than one based on generalized cylinders because qualitatively useful information is not made explicit in such representations: a greater number of shape primitives and attributes should be available. What work there has been has led some researchers to believe that it is impossible to develop purely qualitative spatial reasoners. Davis (1986) discusses some of the difficulties and poses a set of deceptively simple challenge problems for a qualitative spatial reasoner. In (Davis, 1987) he describes the kind of representation and reasoning which would solve these problems. He reports on an axiomatization of geometry, motion and simple physics which allows him to infer that, given certain conditions, an object thrown into a steep sided funnel will come out of the bottom. The reasoning required is surprisingly complex given this apparently simply stated problem. There are about Approaches to qualitative reasoning 217 140 axioms and 90 nonlogical symbols. No actual implementation of the theory exists yet, so the proof is done by hand. What should be noted is that the reasoning is not a simulation of any kind but rather a proof that the object must come out of the bottom because no other behaviour is possible. Following the earlier work of Shoham (1985a, 1985b), Forbus et al. (1987) have been investigating the possibility of producing a qualitative kinematics. Qualitative kinematics would be a qualitative theory for spatial reasoning about the geometry of motion. However Forbus, et al. conjecture (their Poverty Conjecture) that there is no purely qualitative general purpose kinematics. They base this surmise on the following premises: nobody has done it yet; people tend to use diagrams when doing such tasks; and quantity spaces rely on transitivity and most higher dimension relations are not transitive. They suggest that any qualitative kinematics must be backed up by a complementary quantitative representation: essentially a diagram. They call this paradigm the Metric Diagram~Place Vocabulary model. The former is an oracle for answering simple spatial questions and contains both quantitative and symbolic knowledge; the latter is a purely qualitative representation of shape and space and is created by abstracting from the metric diagram. This view of qualitative spatial reasoning is based on Forbus' earlier FROB system (Forbus, 1980) which reasoned about a bouncing ball in 2-D space using a qualitative vector representation. In kinematics, the basic criterion for differentiating states would seem to be connectivity, since changes in connectivity usually imply changes in force. The potential connecting points of the various objects must be found from the metric diagram (Forbus et al. liken this to computing process and view instances). The problem of finding kinematic states, i.e. computing all possible consistent combinations of connections may also require the metric diagram (they liken this to computing the process and view structure). The analogue of influence resolution is the process of completing the qualitative kinematic state descriptions by computing all the active forces and freedoms of movements. Computing possible state transitions to produce an envisionment can be done purely qualitatively without consulting the metric diagram. Faltings (1987) has been working on the metric diagram computations whilst Nielsen (1987) has concentrated the latter stages of reasoning within this paradigm which do not require any use of the metric diagram. They choose to view the world using configuration space (Lozano-Perez, 1983) which enables the motion of an arbitrary shaped object to be viewed as the motion of a point. Configuration space has as many dimensions as there are parameters of motion in the situation of interest; (e.g. a cog and ratchet has two dimensions). In order to specify a place vocabulary, the configuration space has to be divided up into a finite number of regions (the places) and their connectivity has to be specified (the place vocabulary can be thought of as a kind of qualitative quantity space). Constraints on the motion of objects divide configuration space into free and filled space. Faltings gives requirements for places (e.g. separate contact points must be different places; multiple equivalent paths through free space must be collapsed) and specifies how to compute places from configuration space to meet 218 A.G. Cohn these requirements. Faltings (1987) gives an example of the place vocabulary obtained by his methods for a simple two dimensional, two component cog and ratchet system and shows the envisionment which can be obtained. Places can be distinguished according to how many degrees of freedom there are (e.g. in the cog and ratchet system there are two degrees of freedom if the parts are not touching, one degree of freedom if the parts are touching and able to slide without changing connectivity and zero degrees of freedom if neither part can move without a change of connectivity, for example if the ratchet is touching a point of the cog). It is possible to inspect the envisionment and check that, provided the initial state is appropriate, the system will indeed function as a ratchet; it is also possible to infer that the system may lock from certain other initial places. Other qualitative spatial reasoning research includes Shoham's (1985a,b) foray into naive kinematics where he analyses fit and freedom and starts to formulate a first order logical theory of this. Simmons & Davis (1983) built a system for reasoning about geological formations and inferring how particular structures might have occurred. Their work uses an explicit representation of process, a quantitative data representation analagous to the metric diagram discussed above, and both quantitative and qualitative simulations. Stanfill (1985) built a program (MACK) to reason about devices such as pistons based on a library of standard shapes. Joskowicz (1987) presents an investigation into rotational devices and, unusually, considers a three dimensional world rather than the simplified two-dimensional world that others are currently working in. Hayes (1985b) started to formulate a first order theory of naive geometry which has been continued in Welham & Hayes (1984) and Cunningham (1985a). 10. Order of m a g n i t u d e r e a s o n i n g Suppose we are trying to model a system with a partly full tank which is being filled but also has two open outlets at the bottom, and we want to know what might happen. Any of the theories we have described so far will predict (at least) three basic behaviours (i.e. the tank will fill, empty or stabilize at some partly full level). Suppose further that the rate of filling is very much greater than the rate at which each of the outlets is emptying; we would want our system to be able to predict that the tank will definitely fill to the top. However we cannot represent this order of magnitude difference in the quantities to any of the theories we have described so far. If there had been only one outlet then we could have solved the problem using techniques we have already presented, because the fact that the input rate was greater than the output rate would have been sufficient to disambiguate the situation; however unless we explicitly tell the system that the inflow is greater than the sum of the outflows, the qualitative reasoner will not be able to predict a unique behaviour. Of course, we would prefer only to give local information to the system (e.g. the inflow is very large, the outflows are both very small). So it would be valuable to be able to represent and reason about order of magnitude information, which is of course still essentially of a qualitative nature. Approaches to qualitative reasoning 219 Sometimes the problem to be solved cannot be expressed using simple partially ordered qualitative scales; for example a system may be faulty, but the s y m p t o m is that two quantities are greatly differentiated; in normal operation they are never exactly equal but are never very far apart. Raiman (1986) built a system called FOG (Formal System for Order of Magnitude reasoning). He defines three binary relations whose intuitive interpretations are thus: A ne B: A v o B: A co B: A is negligible compared to B A is close to B (i.e. A - B ne B) A is the same sign and order of magnitude as B There is one axiom (A vo A) and 30 inference rules (e.g. transitivity of ne, vo, co). It turns out that vo and co are both equivalence relations, and that vo implies co, but not vice versa. Raiman uses Non Standard Analysis (Lutz & Goze, 1981) to provide a theoretical foundation for FOG. Basically, the idea is to add very small ' n u m b e r s ' called infinitesimals to the reals. An infinitesimal is a number with the property that a real multiplied by an infinitesimal is still an infinitesimal. The way the above defined relations relate to the qualitative reasoning techniques we have been discussing is that they could be used to structure qualitative quantity spaces. The co and vo relations group quantities with the same order of magnitude while the ne relation sets up the partial ordering hierarchy. One needs to define h o w the standard arithmetic operators operate in the context of these relations, for example A ne B --, (A+B) vo B 'defines' addition across equivalence classes and A ne B v C co D --~ A*C ne B*D 'defines' multiplication across equivalence classes. Raiman's intended applications include trouble shooting analog circuits (he is constructing a program called DEDALE (Dagne et al., 1987) to perform this task) and building a qualitative model of macroeconomics (from a text book). More recently Mavrovouniotis & Stephanopoulos (1987) have come up with an alternative formulation. They enumerate certain problems they see with Raiman's FOG, in particular the lack of well-defined semantics, an apparently arbitrary set of rules, no methodology given for how to extend the rules to cope with other functions apart from addition and multiplication and no defined way to integrate quantitative information. They also point out that the co relation combines sign and magnitude information and would prefer to keep sign information separate from order of magnitude information (we have already seen the benefits Forbus derived from this separation). Finally disjunction and negation are required even to express quite simple problems and they point to the computational complexity these connectives tend to engender. Actually, notwithstanding Raiman's intuitive definition of co and the consequent criticisms of Mavrovouniotis & Stephanopoulos, the semantics that Raiman (1986) gives, means that co does not carry any sign information. The problem with non-standard analysis as a semantics for FOG is not that it does not provide a sound basis for FOG, but rather that there is a danger that this semantics might not correspond to the intuitions a h u m a n user might have about the relations. 220 A.G. Cohn Mavrovouniotis & Stephanopoulos go on to present their O[M] formalism for order of magnitude reasoning. Quantities have a sign, magnitude and dimension. Links relate pairs of quantities giving all the known relative order of magnitude information between them. Reasoning involving the sign of a quantity is done as in conventional qualitative reasoning systems. They define seven primitive order of magnitude relations to relate magnitudes. These are: A < < B (intuitively: A is much smaller than B), A - < B (intuitively: A is moderately smaller than B), A--<B (intuitively: A is slightly smaller than B) and A= =B (intuitively: A is exactly equal to B). The first three relations also have their obvious duals making seven in all. A further 21 compound relations (i.e. their semantics are defined as disjunctions of primitive relationships, though implemented in the system as primitives) are also defined and given an intuitive semantics. They claim that their system subsumes FOG (ne is < < ; vo is - < . . > - and co is - < . . > - , where opl..op2 means the disjunction of all relations between o p l and op2, where the relations are ordered as given above; note that not all disjunctions of operators can be thus expressed; this restriction is for efficiency reasons). Some, but not all negations can be expressed (e.g. there is no representation for 'not roughly equal to'; again this restriction is for efficiency reasons; Mavrovouniotis & Stephanopolous are particularly concerned to create an efficient reasoning system). They also give a precise semantics for the primitive relations in terms of an arbitrary accuracy parameter e. The truth of A op B (where op is one of the primitive relations) is defined in terms of A/B which is compared against e, 1/(1+e), 1, l + e , 1/e. These expressions effectively divide the real line into six intervals and the single point (unity) which correspond to the seven relations. They discuss whether this semantics is too strict to conform to 'naive' order of magnitude reasoning. For example a human would probably want to conclude A > - C from A > - B and B > - C , but the formal semantics just given only allows the weaker inference A > ~ . . > - C . They go on to define a more 'aggressive' semantics which effectively loses accuracy but might be construed as a more natural system. (They point out that FOG's reasoning is even more 'aggressive'). Finally they overview their ATMS based implementation, some strategies for dealing with contradictions due to aggressive inferences and their application of the system to reasoning about biochemical pathways. They also claim that the formalism allows an easy integration of quantitative and qualitative knowledge. The formalism and its application is discussed in greater detail in Mavrovouniotis et al. (to appear) Mavrovouniotis & Stephanopolous (to appear). We have already briefly mentioned the work of Kuipers (1987); this can also be seen as an application of order of magnitude reasoning (at the meta level), by declaring one system to operate an order of magnitude faster or slower than another, the qualitative simulation of a complex device can be made faster and simpler. 11. R e c o g n i z i n g higher level processes In the case of a reasonably complex system, an envisionment can be very large and complicated and it may be difficult for a human to interpret an overall behavioural Approaches to qualitative reasoning 221 description from it. The only summarization process we have mentioned is the stutter cycle recognition procedure of Forbus which replaces cycles of instantaneous nodes by a node describing a dynamic equilibrium. In general, one might hope to make progress on this problem in a number of ways. Multiple models at different levels of abstraction is clearly likely to be of help. One could also imagine having a library of 'cliches' (cf. the Programmer's Apprentice project; Rich et al., 1979) against which envisionment fragments could be matched. Weld (1986) has also done some interesting work on cycle extraction in the case where the cycle is not maintaining an equilibrium (i.e. he will recognize a cycle even if the state at the end of the cycle is not exactly the same as an earlier state). He terms this cycle extraction procedure aggregation. Weld concentrates on recognizing and extracting serial cycles in a process centred representation. In order to see if a currently active process is the same as a previously active process, each variable in the quantity conditions of the processes involved must be identical if the quantity space is unordered and the two values must not be distinguished by the conditions otherwise. For example, from the simulation of a cascaded clocked decade counter, Weld shows how aggregation will recognize and summarize the events which cause the least significant digit to count to zero, and subsequently for other more significant digits. Thus there is some ability to deal with nested cycles. The entire lengthy simulation is eventually summarized to a few instances of automatically created countdown processes and the definition of the countdown process itself. The work prepared is at an early stage and there are still problems for example with deadlock in multiple cycles and determining an appropriate theoretical foundation. Downing (1987) reports on a system for improving a diagnostic system based on de Kleer and Brown's (1984) representation and aggregation. The system is able to aggegrate variables to produce a simplified model under particular assumptions. 12. Multiple m o d e l s We have already mentioned the work of Mozetic (1987b) in employing a hierarchy of models for qualitative modelling and reasoning. It seems to be very important to investigate and use multiple and hierarchical models further in order to improve the efficiency of qualitative inference, the size of problems that can be tackled, and also, by employing models with different views or ontologies, enable problems to be solved that could not be solved with reference to a single model. For example Forbus (1984b) suggests that reasoning about the superheated steam boiler referred to at the beginning of this paper requires not only a contained liquid ontology but also the ability to reason about a particular bit of water (the molecular collection ontology) in order to solve the problem. Collins & Forbus (1987) investigate the molecular ontology and describe an extension to QPE which reasons about fluid granules. They argue that it is not possible to reason about fluids using the molecular collection ontology in isolation, but that it must be parasitic on a contained fluid model. Thus they first compute a 222 A.G. Cohn standard envisionment using a contained liquid model and then reason about the history of particular 'bits of liquid'. Although they have not yet built a system which can actually solve the superheated steam boiler problem, they argue that they are now much closer; all that remains is to perform automatically a differential qualitative analysis (Forbus, 1984b) on the computed histories. In unpublished work, Weld has been developing hierarchical models of a refrigerator so that it can be represented and reasoned about at a variety of levels of deepness and detail. The topmost model might thus be of a box with a cold interior. Successively more detailed models might be: an insulated box with heat being p u m p e d out; a model where refrigerant is circulated by a pump which carries heat to an outside radiator; a model where the evaporation of the refrigerant in low pressure tubing inside the refrigerator, its absorbtion of heat and its subsequent compression to hot liquid in an outside radiator by a pressurizing pump is detailed. The most detailed model might enable a behaviour description such as the following to be produced: in the evaporator, high pressure liquid is released into nearvacuum; since the boiling point is much lower, the liquid evaporates and cools; the temperature inside the refrigerator is above the new boiling point, so the liquid continues to evaporate absorbing heat from the refrigerator interior; eventually all the liquid will have evaporated and the box temperature will be cooler. Klein & Finin (1987) discuss how models can be differentiated according to the 'depth' of the knowledge represented and illustrate the distinctions with several examples. Of course, one can imagine a variety of ways in which models of the same system may differ. A hierarchical model may have a varying level of component granularity (a primitive component at one level may be expanded to a whole subsystem at another level}. This is the kind of model to be found in for example Davis {1984}, Genesereth (1984} or Barrow (1984}. A hierarchical model can also be built by simplifying at different levels and leaving out certain attributes of concepts (for example as in the classical ABSTRIPS (Sacerdoti, 1973) planning system}. One might also obtain a hierarchy by having different grained quantity spaces at the different levels. At one end of this hierarchy all the quantity spaces might just have + / 0 / - values, at the other end we have a normal quantitative model. An important study into the theory of creating abstraction hierarchies by varying the granularity of the model is Hobbs (1985). If one moves to a finer grained qualitative quantity space than just + / 0 / - , then Struss (1987) has pointed out that the arithmetic operators can no longer be associative. The problem with lack of associativity is that it means the results of calculation may be dependent on the order of calculation. We have already mentioned the possibility of changing the ontology entirely, for example from a continuous to a discrete representation when discussing the super heater example above. Other work on models differentiated thus includes the work of Bunt (1985) and the work of Gentner & Gentner {1983) where they investigate people's mental models of electricity using a continuous 'pneumatic' model and a discrete 'moving crowd' model. Raulefs (1987} describes a system for reasoning about continuous objects and processes built using Bunt's ensemble theory. Approaches to qualitative reasoning 223 Some models will provide support for others in the sense that they provide justifications (e.g. proofs) of assumptions in other models. Having such models may be important for providing good explanations of physical systems. Of course, difficulties will arise where models are inconsistent with each other (i.e. make different predictions) and developing models of the utility of models is an important subject for future research in this area. If different predictions are made then it may be appropriate to intersect the solution set if this is non null, otherwise a more detailed model might be of use in resolving the contradiction. The most appropriate model(s) must be selected to help solve a particular problem. If the problem involves reasoning about the effects of a particular parameter perturbation then a good first choice might be to choose the simplest model(s) which mention that parameter. If several models are required to solve a particular problem then the question of how the models communicate has to be addressed (perhaps via a shared vocabulary or via support/justification links). 13. H o w a r e q u a l i t a t i v e m o d e l s g e n e r a t e d ? We have not paid any particular attention so far on the problem of how to actually construct a qualitative model for a given situation or system. Of course if a library of generic components, processes or individual views is available this will help at the detailed level though there will still be the problem of choosing items from the library, instantiating them and connecting them together appropriately. However there is still the problem of how to construct or add to the library. This problem is not peculiar to qualitative modelling but is faced by anybody trying to build a model. To state the problem succinctly I can do not better than to quote Letovsky (1983): 'A major unsolved question for reasoning systems of this type is, where are the causal models supposed to come from? All these models are descriptions of situations that carefully include certain features and ignore others in order to produce descriptions that are precisely tailored for the performance of a specific task. How is such a model extracted from a richer description? How does the extractor know which features are worth including in the causal model, and which can be neglected for the current purposes? This question definitely deserves further consideration.' Of interest in this context is Mozetic's work (Mozetic, 1987a) on learning a qualitative model from a set of behaviour observations. Given the structure of the model only (i.e. the network structure but with no component behaviours specified), Mozetic used a learning algorithm to induce the component behaviours. Twenty-five observations were input originally and after eight learning cycles, during which a further 19 behaviour observations were supplied by a human, the complete model was acquired. The computation required approximately one week on a SUN2. Interestingly, if no structure was given (i.e. the task was to learn a black box behaviour) then the same observation set resulted in a model which would correctly predict ECGs for 80% of all possible arrhythmia combinations. Selfridge et al. (1985) describe an interactive program which acquires qualitative 224 A.G. Cohn causal models by comprehending explanations of behaviour stated in natural language. It is also worth mentioning briefly the experiences learned by those attending 'Commonsense Summer' (Hobbs et al., 1985). The participants were particularly interested in model building within a Naive Physics framework and their methodology is obviously affected by this. They worked on a number of domains including Naive Kinematics (Shoham, 1985b) and properties of stuff (Hager, 1985). When first investigating an area (a Naive Physics cluster) it is obviously important to clarify the conceptual structure of the domain. A thesaurus can be a useful tool here, but they point out that a classification of concepts is not an end in itself: it is important to extract the principles behind the classifications i.e. why these distinctions are relevant. In order to limit the area of investigation it is important to isolate the cluster of interest and to circumscribe it. They advise looking for typical examples rather than pathological examples which tend to cloud the issue (and which, they suggest, may be 'cross cluster' examples). Of course, this begs the question of what a pathological example is. In order to make progress, the participants felt it important to devise target problems at the outset otherwise the problem of trying to model a moving target might occur. They did not try to aim for 'psychologically real' models, the problem seemed to be hard enough in any case! Nor did they stick to standard mathematical theories of, for example, space. Like Hayes' original foray into Naive Physics they tried to avoid thinking of implementation which they felt was a distraction to the modelling process. They also tried to avoid some well known 'black holes' such as the 'I need to invent a new knowledge representation language in order to describe this situation' syndrome. (In fact most, but not all, of the work over the summer was done in first ~rder logic). The participants tried to be 'ontologically promiscuous' and not worry about whether possible worlds, points, or any other virtual object really existed, but just to use whatever ontology seemed to be helpful. They realized that always giving exact definitions with necessary and sufficient conditions can be difficult and were content to write down partial definitions of concepts, at least in the first instance. The problem of the real world always seeming to provide counter-examples to a theory was discussed. They felt perhaps the best approach here was to hope that some higher level process may be able to help by choosing the appropriate model and knowing the limitations of a theory. However they did not research what such a higher level process might really look like at all. One problem which affects any modeller is to know precisely what has been captured by one's axiomatization, i.e. what interpretations satisfy it, and indeed to know whether the theory is in fact consistent. This is a very hard and difficult problem particularly as the theory becomes larger and less trivial. Cunningham (1985a) points out that Hayes failed to realize in his liquids paper (Hayes, 1985b) that his 'toso' function ('the other side of') was not a function at all (e.g. toso(rooml,wall2) may be cupboard22 and room3). Approaches to qualitative reasoning 225 Cunningham also writes of the difficulty he found in writing large consistent sets of axioms for a Naive Physics cluster, and built a program to find (finite) satisfying interpretations of his axioms (Cunningham, 1985a, 1985b). Note that the notion of a model being inconsistent presupposes a clean representation language with a well defined semantics. (For further discussion on this see Israel, 1985; Hayes, 1985a; McDermott, 1978.) Of course, any language with the expressive power of full first order logic is only semi decidable, so determining consistency in general is not actually possible. However there are still research opportunities for building (possibly interactive) consistency checkers which may be constrained by partitioning of the theory and by results of verification of higher or lower level models. Jackson's game theoretic approach (Jackson, 1988) to consistency checking is another avenue of attack. Features of the representation language such as a powerful sortal apparatus may also be of help (see Cohn, 1985, for further discussion of this point). 14. Current a n d future t r e n d s Rather than trying to summarize the preceding text, we will finish by drawing attention to some current work not mentioned elsewhere and possible future trends. It will have been observed that all the examples discussed have been rather simple and much simpler than any system to be found in an industrial setting. In fact there has been some work applying techniques such as we have described here to industrial and real life systems. We have already mentioned the DEDALE system (Dagne et el., 1987) which is reported to troubleshoot failures on complex analog circuits occurring in actual systems. Rajagopalan (1984) describes his work on qualitative modelling of turbojet engines and Gallanti et el. (1986) report on their system which reasons both qualitatively and quantitatively about a condenser in a power plant in a diagnostic setting. Lepetit & Vernet (1987) describe their experience with qualitative modelling using a constraint model in a process control domain. Hamilton (1987) describes a diagnostic system based on de Kleer & Brown's work for reasoning about mechanical subsystems of a helicopter. A hierarchy of models (of depth four at present) is created by representing a subsystem of components by a single component; the behaviour confluences for the higher level component are formed by equation solving on the confluences of the constituent lower level components. Diagnosis is performed by constraint suspension in a similar fashion to Davis (1984). Mohammed & Simmons (1986) describe their approach to qualitative reasoning about semiconductor fabrication which is built using the same system as Simmons & Davis (1983) earlier used to reason about geological structures. Preliminary investigations of qualitative reasoning techniques in financial applications include Apte & Hong (1986) and Hart et el. (1986). No doubt with increasing awareness of qualitative reasoning techniques and as further technical progress is made exploitation of the ideas in applications may increase. There is certainly much work still to do at a theoretical level, for example 226 A. G. Cohn providing secure foundations for existing theories such as QPT and in developing and extending qualitative reasoning methods to cope with a wider range of problem types. The results of Struss (1987) mentioned earlier provide an important impetus for doing this. Kokar (1987) discusses the problem of determining a landmark set (i.e. the set of points in the quantity spaces) for a problem and remarks that it is often not possible to find a finite set of such points; he suggests that quantity conditions should be specified not by particular values of certain parameters but by 'some hypersurfaces in the cross-product of the parameters'. He presents a way of determining such 'critical hyperspaces'. Forbus (1987b) discusses the formal relationship between specific histories and envisionments such as he used informally in Forbus (1986a). All the systems discussed thus far have assumed that variables are continuous (except for Forbus' encapsulated histories technique). Nishida & Doshita (1987) consider methods for reasoning about discontinuous changes. We remarked in the introduction that qualitative reasoning is seen as a complement rather than a replacement for quantitative reasoning. However the interface between the two reasoning paradigms still needs to be researched. Some work has been done in this area, for example Simmons & Davis (1983), Gallanti et al. (1986) and Forbus (1986a). However, a proper theory still needs to be worked out. Another area which is important to research further is the relationship between deep (qualitative models) and surface style knowledge bases. The Kardio work on producing the latter from the former has already been mentioned, but a more thorough investigation of how a qualitative model can and should be used as an underlying deep, supporting representation for (perhaps several different) surface knowledge bases is certainly needed. Reasoning about space and shape seems to be a very difficult and still largely unexplored area but is very important, for solving problems about many physical systems requires sophisticated spatial reasoning. All the derivatives in the systems we have described have been with respect to time; could one build a qualitative reasoner which represented partial derivatives with respect to a spatial dimension? Finally, we might remark that most of the work in qualitative reasoning seems to have involved simulation. However, there are clearly other possible reasoning modes and in particular one might like to do problem solving by reasoning about the model rather than simulating it. To take a very simple and classical example, consider McCarthy's mutilated chessboard and the computational efficiency achieved by reasoning about what a solution would look like rather than actually trying to achieve it by a process akin to simulation. Similarly, Davis (1986) has suggested that the problems alluded to earlier, concerning the difficulty of building a qualitative spatial reasoner might be overcome, not by attempting to simulate the physical system, but by looking for a proof of the correct behaviour. He does, however, admit that finding and reasoning with such proofs would be non trivial. Sacks (1987b) also eschews qualitative simulation and describes a methodology for reasoning about dynamic systems by constructing piecewise linear approximations of systems of non linear differential equations and thus building a phase diagram. Approaches to qualitative reasoning 227 Bylander & Chandrasekaran (1985) describe a technique they call consolidation which computes a behavioural description for a composite system, not by qualitative simulation but by composing behaviour descriptions. They see their technique as a c o m p l e m e n t a r y technique to qualitative simulation. Also relevant is the work of Weld (1987) who has built a system which will take the results of a qualitative simulation (QSIMs) and reason about the effects of a perturbation. For example it can answer the question about what would h a p p e n to the period of the mass on the spring system previously discussed if the mass were heavier. 15. A c k n o w l e d g m e n t s There are m a n y people with w h o m I have discussed the issues presented in this chapter and I should like to thank them all. In particular I am grateful to all the members of the Alvey DKBS SIG. Moreover Ivan Bratko, Ben Kuipers, Ken Forbus, Olivier Raiman, Peter Struss and Brian Williams all gave invited papers to various Alvey DKBS workshops and I have benefited tremendously from these and discussions in the working groups afterwards. I should also like to thank the participants at ACAI87 in Oslo where the lectures on which this paper is based were first given for their c o m m e n t s and feedback. Bert Bredeweg falls into both these last two categories and I thank him for the detailed comments he made on an earlier version of this paper. Members of the AI group at Warwick University have given helpful c o m m e n t s and criticism on the material presented here; in particular, Kathy Courtney, Felix Hovsepian and Guy Saward. Especial thanks are due to David Randell for this careful reading and criticism of the manuscript and the discussions I have had with him. I have also benefitted from the comments provided by an a n o n y m o u s referee. Some of the material presented here was presented at the tutorial on qualitative reasoning at ECAI 1986 which was presented jointly with Pat Hayes. I would like to thank my wife, Gillian, for help with proof reading. Of course I take full responsibility for any remaining errors or misrepresentations in the work. This work was partly financed by the SERC under grant GR/E/O0273. I should also like to thank the Alvey Directorate for the funding of the DKBS workshops. References Addanki, S. & Davis, E. (1985) A Representation for Complex Physical Domains. In Proceedings of the IJCAI 1985, Morgan Kaufmann, Calif. Allen, J. F. (1983) Maintaining knowledge about temporal intervals. CACM, 26(11), 832-843. Allen, J. F. &Hayes, P. J. (1985) A Common-Sense Theory of Time. In Proceedings of the IJCA11985, Morgan Kaufmann, Calif. Apte, C. & Hong, S. (1986) Using Qualitative Simulation to Understand Financial Arithmetic. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Badii, A. (1987) Proceedings of the Third Alvey Workshop on Deep Knowledge Based Systems, Farnborough. Bareiss, R. & Farquhar, A. (1986) Fault Diagnosis Using Qualitative Simulation. AI TR86-25, University of Texas at Austin, Texas. 228 A . G . Cohn Barrow, H. G. (1984) VERIFY: A Program for Proving Correctness of Digital Hardware Designs, Artificial Intelligence, 24, 437-491. Bobrow, D. (ed) (1984) Qualitative Reasoning about Physical Systems. North Holland. Bonissone, P. P. & Valavanis, K. P. (1985) A Comparative Study of Different Approaches to Qualitative Physics Theories. In Second AI Applications Conference, IEEE. Bratko, I., Mozetic, I. & Lavrac, N. (1986) Automatic Synthesis and Compression of Cardiological Knowledge. In Machine Intelligence 11 (eds J. Hayes, D. Michie & J. Richards), Oxford University Press. Bredeweg, B. (1987) Modelling Physical Systems with QP Theory, University of Amsterdam, Holland. Bunt, H. (1985) The Formal Representation of (Quasi-) Continuous Concepts. In Formal Theories of the Common Sense World, (eds J.R. Hobbs & R. Moore), Ab|ex Publishing Corporation, Norwood. New Jersey. Bylander, T. & Chandrasekaran, B. (1985) Understanding Behavior Using Consolidation. In Proceedings of the IJCAI 1985, Morgan Kaufmann, Los Altos. Chandrasekaran, B, Smith, I. W. & Sticklen, J. (1987) Deep Models and Their Relation to Diagnosis, Ohio State University. Clancey, W. I. & Letsinger, R. (1981) Neomycin: Reconfiguring a Rule Based Expert System for Application to Teaching. In: The Proceedings of the IJCAI 7, 2. Clocksin, W. & Morgan, A. (1986) Qualitative Control. In Proceedings of the ECAI, Brighton. Cochin, I. (1980) Analysis and Design of Dynamic Systems, Harper & Row, New York. Cohn, A. G. (1985) Deep Knowledge Representation Techniques. In Expert Systems 85, (ed M. Merry), Cambridge University Press. Cohn, A. G. (1988) Qualitative Reasoning. In Advanced Topics in Artificial Intelligence, Lecture Notes in Artificial Intelligence (Subseries of Lecture Notes in Computer Science), 345 (ed R. Nossum). pp. 60-95, Springer Verlag, Berlin. Collins, J. W., Forbus, K. D. (1987) Reasoning about Fluids via Molecular Collections. In The Proceedings of the AAAI, pp. 590-594, Morgan Kaufmann, Los Altos, Calif. Cunningham, J. (1985a) A Methodology and a Tool for the Formalization of "Common Sense" (Naive Physical) Knowledge. PhD Thesis, University of Essex, U.K. Cunningham, J. (1985b) Comprehension by Model Building as a Basis for an Expert System. In Proceedings of Expert Systems 85, (ed M. Merry) pp.259-272, Cambridge University Press. D'Ambrosio, B. (1987) Extending the Mathematics in Qualitative Process Theory. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Dague, P.. Raiman, O. & Deves, P. (1987) Troubleshooting: when modelling is the trouble. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Davis, E. (1986) Conflicting Requirements in Reasoning about Solid Objects, Courant Institute, New York University, U.S.A. Davis, E. (1987) Constraint Propagation with Interval Labels. Artificial Intelligence, 32, 281-331. Davis, R. (1984) Diagnostic Reasoning Based on Structure and Behavior. Artificial Intelligence, 24, 347-410. Downing, K. (1987) Diagnostic Improvement though Qualitative Sensitivity Analysis and Aggregation. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Dyer, M., Flowers, M. & Hodges, J. (1987) Naive Mechanics and Comprehension in EDISON. In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Dyer, M., Flowers, M. & Hodges, J. (1986) Edison: An Engineering Design Invention System Operating Naively. In Proceedings of the First Conference on AI in Engineering, (eds D. Sriram & R. Adey), Springer Verlag, Berlin. Falkenhainer, B., Forbus, K. D. & Gentner, D. (1986) The Structure-Mapping Engine, UIUCDCS-R86-1275, University of Illinois, U.S.A. Faltings, B. (1987) Qualitative Kinematics in mechanisms. In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Forbus, K. D~ (1980) Spatial and Qualitative Aspects of Reasoning about Motion. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos, Calif. A p p r o a c h e s to q u a l i t a t i v e reasoning 229 Forbus, K. D. (1984a) Qualitative Process Theory, Artificial Intelligence, 24, 85-168. Forbus, K. D. (1984b) Qualitative Process Theory. Tech. Report 789, MIT Press, Cambridge, Mass. Forbus, K. D. (1985) The Problem of Existence, UIUCDCS-R-85-1239, University of Illinois, U.S.A. Forbus, K. D. (1986a) Interpreting Measurements of Physical Systems. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Forbus, K. D. (1986b) The Qualitative Process Engine, UIUCDCS-R-1288, University of Illinois, U.S.A. Forbus, K. D. (1987a) Inequality reasoning with an ATMS, University of Illinois, U.S.A. Forbus, K. D. (1987b) The Logic of occurrence. In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Forbus, K. D, Nielsen, P. & Faltings, B. (1987) Qualitative Kinematics: a Framework~ In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Forbus, K. D. & Stevens, A. (1981) Using Qualitative Simulation to Generate Explanations. Report No. 4490, Navy Personnel Research & Development Center, San Diego. Gallanti, M, Gilardoni, L., Guida, G. & Stefanini, A. (1986) Exploiting Physical and Design Knowledge in the Diagnosis of Complex Industrial Systems. In Proceedings of the ECAI, Brighton. Genesereth, M. R. (1984) The Use of Design Descriptions in Automated Diagnosis, Artificial Intelligence, 24, 411-436. Gentner, D. & Gentner, D. R. (1983) Flowing Waters of Teeming Crowds: Mental Models of Electricity. In Mental Models (eds D. Gentner & A. Stevens), Lawrence Earlbaum, London. Gentner, D. & Stevens, A. L. (1983) Mental Models, Lawrence Earlbaum, New Jersey, U.S.A. Hagar, G. (1985) Naive Physics of Materials: a Recon Mission in Commonsense Summer: Final Report (eds J. Hobbs et al.), University of Stanford. Hamilton, T. P. (1987) HELIX: An Application of Qualitative Physics to Diagnostics in Advanced Helicopters. In The Proceedings of the AAAI Workshop on Qualitative Physics, University of Illinois, Champagne-Urbana. Hart, P. E., Barzilay, A. & Duda, R. O. (1986) Qualitative Reasoning for Financial Assessments: a Prospectus, Artificial Intelligence Magazine, 7(1), 62-73. Hayes, P. J. (1974) Some problems and non-problems in representation theory. In Proceedings of the AISB. Reprinted in Reading in Knowledge Representation, (eds R. Brachmann & H. Levesque) 1985, Morgan Kaufmann, Los Altos, Calif. Hayes, P. J. (1977) In Defence of Logic. In Proceedings of the IJCAI 5, Morgan Kaufmann, Los Altos. Hayes, P. J. (1979) The naive physics manifesto. In Expert Systems in the micro Electronic Age, (ed D. Michie), Edinburgh University Press, U.K. Hayes, P. J. (1985a) The Second Naive Physics Manifesto. In Farmal Theories of the Common Sense World, (eds J. R. Hobbs & R. Moore), Ablex Publishing Corporation, Norwood, New Jersey. Hayes, P. J. (1985b) Ontology of liquids. In Formal Theories of the Commonsense World, (eds J. Hobbs & R. Moore), Ablex Publishing Corporation, Norwood, New Jersey. Hayes, P. J. (1987a) The Frame Problem in Histories. In The Frame Problem in Artificial Intelligence, (ed F. M. Brown), Morgan Kaufmann, Los Altos. Hayes, P. J. (1987b) A Critique of Pure Treason. Computational Intelligence, 3, 179-184. Hayes, P. J. & Allen, J. (1987) Short Time Periods. In Proceedings of the IICAI 1987, Morgan Kaufmann, Los Altos. Hobbs, J. R. (1985) Granularity. In Proceedings of the IJCAI, Morgan Kaufmann, Los Altos. Hobbs, J. R., Blenko, T., Croft, B., Hager, G., Kautz, H. A., Kube, P. & Shoham, Y. (1985) Commonsense Summer: Final Report, CSLI-85-35, Stanford University, Stanford. Hobbs, J. R. & Moore, R. C. (1985) Formal Theories of the Commonsense World, Ablex Publishing Corporation, Norwood, New Jersey. Hogge, J. (1987) Compiling Plan Operators from Domains Expressed in Qualitative Process Theory. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Israel, D. (1985) A Short Companion to the Naive Physics Manifesto. In Formal Theories of the Common Sense World (eds J. R. Hobbs & R. Moore), Ablex Publishing Corporation, Norwood, New Jersey. 61262OGEM740 A I R 3:2 - 76 C o h n (13) 230 A . G . Cohn Iwasaki, Y. (1987) Generating Behaviour Equations from Explicit Representation of Mechanisms. In Proceedings of the AAAI Workshop on Qualitative Physics, University of Illinois, U.S.A. Iwasaki, Y. & Simon, H. A. (1986a) Causality in Device Behavior, Artificial Intelligence, 29, 3-32. Iwasaki, Y. & Simon, H. A. (1986b) Theories of Causal Ordering: Reply to de Kleer and Brown, Artificial Intelligence, 29, 63-72. Jackson, P. (1988) On Game-Theoretic Interactions with First-Order Knowledge Bases. In Non Standard Logics (eds P. Smets, E. H. Mamdani, D. Dubois & H. Prade) Academic Press, London. Joskowicz, L. (1987) Shape and Function in mechanical Devices. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Klaua, D. (1969) Partielle Mengen und Zahlen, Monatsberichte der Deutschen Akademie der Wissenschaften, 11,573-584. Kleer, J. de (1977) Multiple Representations of Knowledge in a Mechanics Problem-Solver. In Proceedings of the IJCAI 1977, Morgan Kaufmann, Los Altos. Kleer, J. de (1979) Causal and teleological reasoning in circuit recognition, Report AI-TR-529, MIT Press, Cambridge, Mass. Kleer, J. de (1986a) An Assumption-based TMS, Artificial Intelligence, 28, 127-162. Kleer, J. de (1986b) Extending the ATMS, Artificial Intelligence, 28, 163-196. Kleer, J. de (1986c) Problem Solving with the ATMS, Artificial Intellience, 28, 197-224. Kleer, J. de & Bobrow, D. G. (1984) Qualitative Reasoning with Higher-Order Derivatives. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Kleer, J. de & Brown, J. S. (1984) A Qualitative Physics Based on Confluences, Artificial Intelligence, 24, 7-83. Kleer, J. de & Brown, J. S. (1986) Theories of Causal Ordering, Artificial Intelligence, 29, 33-61. Kleer, J. de & Williams, B. (1987] Diagnosing Multiple Faults, Artificial Intelligence, 32 (1), 97-130. Klein, D. & Finin, T. (1987) What's in a Deep Model? In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Kokar, M. (1987) Critical Hypersurfaces and the Quantity Space. In Proceedings of the AAAI, pp. 616-620, Morgan Kaufmann, Los Altos, Calif. Kuipers, B. (1984) Commonsense Reasoning about Causality: Deriving Behavior from Structure, Artificial Intelligence, 24, 169-203. Kuipers, B. (1986) Qualitative Simulation, Artificial Intelligence, 29, 289-338. Kuipers, B. (1987) Abstraction by Time-Scale in Qualitative Simulation, Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Kuipers, B. & Chiu, C. (1987) Taming Intractible Branching in Qualitative Simulation. In Proceedings of the IJCAI 1987, Morgan Kaufmann, Los Altos. Kuipers, B. & Kassirer, J. P, (1983) How to Discover a Knowledge Representation for Causal Reasoning by Studying and Expert Physician. In Proceedings of the IJCAI 1983, Morgan Kaufmann, Los Altos. Ladkin, P. (1987) Models of Axioms for Time Intervals. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Laughton, S. (1985) Explanation of Mechanical Systems Through Qualitative Simulation, AITR8519, University of Texas at Austin, U.S.A. Leaning, M. S. & Nicolosi, E. MODEL - - Software for knowledge based modelling of compartmental systems, Biomedical Measurement, Information and Control, 1, 171-181. Lee, W., Kuipers, B. & Chiu, C. (1987) Steps toward constraining qualitative simulation, TR-87-44, University of Texas at Austin, U.S.A. Lepetit, M. & Vernet, D. Qualitative Physics Applied to a Depropanizer in Process Control. In Proceedings of the AAAI Workshop on Qualitative Physics, University of Illinois, U.S.A. Letovsky, S. (1983) Qualitative and Quantitative Temporal Reasoning, YALEU/DCS/BR*296, Yale University, U.S.A. Lozano-Perez, T. (1983) Spatial planning: A Configuration space approach, IEEE Transactions on Computers, C-32, 108-120. Approaches to qualitative reasoning 231 Lucas, J. R. (1984) Space, Time and Causality, Oxford University Press. Lutz, R. & Goze, M. (1981) Non Standard Analysis, Lecture Notes in Mathematics, 881, SpringerVerlag, Berlin. Manzo, M. di &Trucco, E. (1987) Commonsense Reasoning about Flexible Objects: A Case Study. In Advances in Artificial Intelligence, (eds C. Mellish & J. Hallam). John Wiley, Chichester. Mavrovouniotis, M. & Stephanopoulos, G. (1987) Reasoning with Orders of Magnitude and Approximate Relations. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Mavrovouniotis, M., Stephanopolons, G. & Stephanopolous, G. Formal Modelling of Approximate Relations in Biochemical Systems, Biotechnology and Bioengineering, to appear. Mavrovouniotis, M. & Stephanopolous, G. Formal Order of Magnitude Reasoning in Process Engineering, Biotechnology and Bioengineering, to appear. McCarthy, J. & Hayes, P. J. (1969) Some philosophical problems from the standpoint of AI. In Machine Intelligence 4 (eds B. Meltzer & D. Michie), Edinburgh University Press, U.K. McDermott, D. (1978) Tarskian semantics, or no notation without denotation, Cognitive Science, 2, 277-282. McDermott, D. (1982) A Temporal Logic for Reasoning about Processes and Plans, Cognitive Science, 6, 101-156. McDermott, D. (1987) A Critique of Pure Reason, Computational Intelligence, 3. Mohammed, J. & Simmons, R. (1986) Qualitative Simulation of Semiconductor Fabrication. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Morgan, A. J. (1987) Predicting the Behaviour of Dynamic Systems. In Proc AISB, (eds C. Mellish & J. Hallam), John Wiley, Chichester. Mozetic, I. (1987a) Learning of Qualitative Models. In Proceedings of the Second EWSL, Sigma Press, distributed by John Wiley, Chichester. Mozetic, I. (1987b) The Role of Abstractions in Learning Qualitative Models. In Proceedings of the Fourth International Workshop on Machine Learning, Irvine. Nielsen, P. (1987) A Qualitative Approach to Mechanical Constraint, University of Illinois, U.S.A. Nishida, T. & Doshita, S. (1987) Reasoning about Discontinuous Change. In Proceedings of the AAAI, pp. 643-648. Morgan Kaufmann, Los Altos, Calif. Raiman, O. (1986) Order of Magnitude Reasoning. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Rajagopalan, R. (1984) Qualitative Modelling in the Turbojet Engine Domain. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Raulefs, P. (1987) A Representation Framework for Continuous Dynamic Systems. In Proceedings of the IJCAI, Morgan Kaufmann, Los Altos. Reiter, R. (1987) A Theory of Diagnosis from First Principles, Artificial Intelligence, 32 (1), 57-95. Reiter, R. & Kleer, J. de (1987) Foundations of Assumption Based Truth Maintenance Systems: Preliminary Report. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Rich, C., Shrobe, H. & Waters, R. (1979) Overview of the programmers apprentice. In Proceedings of the IJCAI 6, MIT Press, Cambridge, Mass. Roshelle, J. (1987) Qualitative Processes and Scientific Reasoning. In Proceedings of the AAAI Workshop on Qualitative Physics, University of Illinois, U.S.A. Sacerdoti, E. D. (1973) Planning in a Hierarchy of Abstraction Spaces. In Proceedings of the IICAI, 1973, Morgan Kaufmann, Los Altos. Sacks, E. (1987a/ Hierarchical Inequality Reasoning. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Sacks, E. (1987b) Piecewise Linear Reasoning. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Sound, E. (1987) Qualitative Physics and the Shapes of Objects. In Proceedings of the AAAI Workshop on Qualitative Physics, University of Illinois, U.S.A. Selfridge, M., Daniell, J. & Simmons, D. (1985) Learning Causal Models by Understanding RealWorld Natural Language Explanations. In Proceedings of the Conference on Applications of AI, IEEE. 232 A . G . Cohn Shoham, Y. (1985a) Naive Kinematics: One Aspect of Shape. In Proceedings of the IJCAI 1985, Morgan Kaufmann, Los Altos. Shoham, Y. (1985b) Naive Kinematics: Two Aspects of Shape. In Commonsense Summer: Final Report, (eds J. Hobbs et al.) University of Stanford. Shoham, Y. (1985c) Ten Requirements for a Theory of Change, New Generation Computing, 3, 467-477. Shoham, Y. (1985d) Reasoning about Causation in Knowledge-Based Systems. In Proceedings of the Conference on Applications of AI, IEEE. Simmons,R. (1986) 'Commonsense' Arithmetic Reasoning. In Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Simmons, R. G. & Davis, R. (1983) Representation for Reasoning about Change, AI Memo No. 702, MIT Press, Cambridge, Mass. Sosa, E. (1975) Causation and Conditionals, Oxford University Press, London. Stanfill, C. (1985) MACK, a Program which Deduces the Behavior of Machines from their Forms, SIGART Newsletter, 93, 12-16. Struss, P. (1987) Problems of Interval-Based Qualitative Reasoning-- a preliminary report. In Wissenrepraesentation und Schlussfolgerungsveffahren fuer technische Expertensysteme (eds Fruectenicht et al.), Munich. Waltz, D. (1975) Understanding line-drawings of scenes with shadows. In The Psychology of Computer Vision, (ed P. Winston), McGraw Hill, New York. Weld, D. S. (1985) Combining Discrete and Continuous Process Models. In Proceedings of the IJCAI 1985, Morgan Kaufmann, Los Altos. Weld, D. S. (1986) The Use of Aggregation in Causal Simulation. Artificial Intelligence, 30, 1-34. Weld, D. S. (1987) Comparative Analysis. In Proceedings of the I]CA11987, Morgan Kaufmann, Los Altos. Welham, B. & Hayes, P. (1984) Notes on Naive Geometry, HP Labs Bristol & Schlumberger Palo Alto Research Labs. Williams, B. C. (1984) Qualitative Analysis of MOS Circuits. Artificial Intelligence, 24, 281-346. Williams, B. C. (1986) Doing Time: Putting Qualitative Reasoning on Firmer Ground. Proceedings of the AAAI, Morgan Kaufmann, Los Altos. Zadeh, L. A. (1983) Commonsense Knowledge Representation Based on Fuzzy Logic, IEEE Computer, 16(10), 61-65.