Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
From: AAAI-86 Proceedings. Copyright ©1986, AAAI (www.aaai.org). All rights reserved. Interpreting measurements of physical systems Kenneth D. Forbus Qualitative Reasoning Group Department of Computer Science University of Illinois 1304 W. Springfield Avenue Urbana, Illinois, 61801 Abstract An unsolved problem in qualitative physics is generating a qualitative understanding of how a physical system is behaving from raw data, especially numerical data taken across time, to reveal changing internal state. Yet providing this ability to “read gauges” is a critical step towards building the next generation of intelligent computer-aided engineering systems and allowing robots to work in unconstrained envirionments. This paper presents a Importantly, the theory is domain theory to solve this problem. independent and will work with any system of qualitative physics. It requires only a qualitative description of the domain capable of supporting envisioning and domain-specific techniques for providing an initial qualitative description of numerical measurements. The theory has been fully implemented, and an extended example using Qualitative Process theory is presented. 1. Introduction Interpreting numerical data is an important part of monitoring, operating, analyzing, debugging, and designing complex physical systems. A person operating a nuclear power plant or propulsion plant must constantly read and interpret gauges to maintain an understanding of what is happening and take corrective if necessary. Designing a new system requires running action, numerical simulations (or building models of the system) and Diagnosis requires interpreting behavior, analyzing the results. both to see if the system is actually operating correctly and to determine if a hypothesized fault can account for the observed behavior. All of these problems require the ability to deduce the of the system across time from changing internal state measurements. Currently there is a great deal of interest in applying qualitative physics to engineering tasks such as diagnosis (e.g., the 19851). For such efforts to be successful, a articles in (Bobrow, theory about how to translate observed behavior, including numerical data, into useful qualitative terms is essential. This The theory is domain independent paper presents such a theory. and makes only two assumptions about the nature of the underlying domain model. Specifically, it assumes that: 1. Given behaviors a particular physical situation, a graph - an envisionment - may be generated. of all possible 2. Domain-specific criteria are available for quantizing data into an initial qualitative description. the envisionment plays the role imposing compatibility conditions adjacent partitions. 1.1. of grammatical constraints, between the hypotheses for Overview The goal of this theory is to produce a general solution for the problem which can be instantiated for any particular physics and domain. Consequently we couch the analysis in an abstract vocabulary and specify what domain-dependent modules are required to initial qualitative descriptions. We produce demonstrate how the theory can be instantiated using an example Qualitative Process theory [Forbus, 1981, 19841. The involving theory has been implemented, and the performance of the implementation on these examples is demonstrated. It should be noted that the theory and implementation have also been successfully applied to a completely different system of qualitative physics, the qualitative state vector ontology ([de Kleer, 19751, [Forbus, 1980, 1981b]), as described in (Forbus, 19861. The next section provides a vocabulary for describing the initial data and places constraints on the segmentation process. Section 3 generalizes an earlier theory of interpreting measurements taken at an instant for QP theory [Forbus, 19831 and shows how the envisionment can be used to locally prune interpretations of segments. constructed ’ Section 4 illustrates how global interpretations are and how gaps in the input data can be filled. Finally we discuss planned 2. extensions and some implications of the theory. Input Data and Segmentation First we describe the kinds of inputs the theory handles. We assume a function time which maps measurements to real numbers, and that the duration of an interval is simply the difference between the times for its start and end points. We also assume the temporal relationships described in [Allen, 19811 may be applied to intervals (i.e., Meet, Starts, and Finishes.) We say Observable (Cp>, <I>) when property <p> can be observed in principle by instrument <I>. To say that we can measure the level of water in a can with our eyes we write2 Observable (A [Level (C-S (water, llquld, can) ) 1 , eyes) To say that some property is in fact observable at some time, we use the predicate Observable-at, which takes a time as an extra argument. numerical The theory is analogous to AI models of speech understanding (e.g., [Reddy, et. al, 1973]). In these models the speech signal is partitioned into segments, each of which is explained in terms of Grammatical constraints are imposed phonemes and words. prune the possible the hypothesized words to between interpretations. In this theory, the initial signal is partitioned into pieces which are interpreted as possible particular qualitative states of the system. By supplying information about state transitions, Qualitative ’ An “envisionment”is, roughly, “the set of all qualitatively distinct possible behaviors of a system.” However, sometimes it is used to refer to “all behaviors possible from some given initial state” and sometimes to “all behaviors inherent in some fixed collection of objects in some configuration, for each possible initial state ” We call the first type attarnable envisionments, and the second total envisionments. Here we are’only be concerned with total cnvisionments ’ The first argument uses notation from QP theory; A is a function that maps from a quantity to a number representing the value of that quantity, Level is a function mapping from individuals to quantities, and C-S is a function denoting an individual composed of a particular substance in a particular state, distinguished by virtue Reasoning of being in a particular and Diagnosis: place. AUTOMATED REASONING / 11 .i associated with distinct segments of a measurement sequence to be adjacent if there is no interval in between them (by assumption, I, and 12 cannot overlap). If the minimum distance between the times of the end points is not greater than st, we also say that the intervals Meet, as defined in Allen’s time logic. The function Int maps segments to intervals. We sav The input of a measurement interpretation problem is a set of measurement sequences, each consisting of a set of measurements totally ordered by the times of the measurements. Suppose we have some “grain” on time, St, such that events of duration shorter than st will not be considered relevant. (The problem of instantaneous events will be discussed in section 4.1.) Then two types of measurement sequences must be considered: Close: The data is complete, in the sense that over the total interval of interest measurements are separated by durations no larger than St. Sampled: There larger than st. are temporal gaps in the data whose duration is The local information provided by the segmentation of measurement sequences must be combined to form global segments, intervals over which the qualitative state of the system is not obviously different. We define global segments as follows. Let {MS13 be a collection of measurement sequences, each of which has a segmentation <Si 3. The global segmentation consists of a set of global segments <&8 $ such that 1. The value over GSk. of the property measured for each MS1 is constant 2. Starts (GSk, Int (S l,3>) for some S1 , i.e., the start time of each global segment corresponds to the hl arting time of some segment in one or more of the segmented measurement sequences. 3. Finishes (GSk, Int (S-& 1 for some S1 k, i.e., the end time of each global segment corresponds to the &d time of some segment in one or more of the segmented measurement sequences. Given an assumption of a finite “grain size” of analysis, with close data we are justifictl in assuming that centiguous segments of the data correspond to successive states of the system. With sampled data wc can only make this assumption on close subsequences. Regular sequences are a subclass of close sequences where successive measurements are exactly St apart. The first constraint prevents a global stgment fmm straddling an obvious qualitative boundary, and the last two constraints ensure it spans the largest possible interval where quaitative values are constant. Thus global segments are good candidates for explanation by a single qualitative state. 2.1. 2.2. Segmenting the input data The first problem is to partition the measurement sequences into meaningful pieces. We define a segment of a measurement sequence to be the largest contiguous intervaJ over which the measured property is “constant”. A symbolic property is constant over an interval if its value is identical for all measurements within that interval. Notice that in QP theory signs of derivatives are symbolic properties in this sense. A numerical parameter is constant over a segment if the same qualitative value can be used to describe each measurement in the segment. The exact notion of qualitative value depends of course on the choice of domain representation and ontology.3 All we require is that algorithms exist for taking numerical values and producing at least some qualitative description sanctioned by the representation used. In QP theory, for example, numerical values can be described in terms of inequalities, the quantity space representation. If some domain-specific constants are unknown, such as the boiling temperature information derivative of a particular substance at a certain pressure, partial can be delivered. In the worst case, the sign of the can be estimated. Once numerical parameters are translated to qualitative values segmentation becomes simple. However, these segments cannot necessarily be identified with a single qualitative state. First, the qualitative value may be partial, as noted above. Second, a state transit ion may leave the measured parameters constant for some time (possibly forever). Consider a home heating system. Suppose you turn the thermostat up past the ambient temperature. If you cannot hear the furnace firing or touch a radiator, then you will not know for some time whether or not the system is actually This hidden transition problem must be taken into working. account when pruning interpretations, discussed below. Each collection there will data set. Ilr:lximum 11-i / segment of a measurement sequence covers a non-empty of data, and since the data is temporally well-ordered be a maximum and minimum time associated with this Let the minimum time be the start time and the time be the end time. We define two intervals I,, I2 SCIENCE QP Example, Part 1 Many changes in the physical world can be characterized as the result of physical processes, such as heat flow, liquidflow, boiling, and motion. Q ua“l’tI a t ive Process theory formalizes this intuitive notion of physical process and provides a qualitative language for differential equations that preserves distinctions required for causal reasoning. QP including theory provides several types of measurable properties, the truth of predicates and relations, whether or not about processes are acting, and of course information different Ideally measurements of amounts and magnitudes should numbers. their descriptions in terms of quantity be segmented whenever spaces change. However, as we will see a great deal of information can be gleaned from just the signs of derivatives (i.e., the DS value of a quantity, which ranges over c-1, 0, 13). Suppose we have a beaker that has a built-in thermometer. Suppose we also know that the beaker either contains some water, some alcohol, or a mixture of both. In this case we can always measure the temperature, i.e. V t E time Observable-at (A [Temperature (Inside (beaker) )1, thermometer, t) If we plot the temperature with respect to time we might get the graph shown in Figure 1.4 If we don’t know the numerical values for the boiling points of water and alcohol, then all we can get from this graph is the DS value for temperature as a function of time. Providing this list of Ds values to the program results in six segments. Since this is the only property measured, each segment gives rise to a single global segment. The program’s output is shown in Figure 2. purpoee a To be a qualitative representation some such notion of such representations ia to provide quantizations which form useful vocabularies for symbolic reasoning. must exist; the primary of the continuousworld measurements. Figure 1 - Temperature plotted as tl, function of time The “one look” theory of measurement inf c~r.l.~~tation cited previously describes a solution to this prol,lcl~, 1’1’r ( :I’ theory. We now generalize it. Call the states in the tot:>; 81.i.ioument which are consistent with the measurements represt 1 1t (1 by some global segment its p-interps. The possible interpretntions of each global segment is exactly this collection of states. As the 1983 paper illustrated, this set may be computed via dependency-directed search over the space of possible qualitative states, pruning those which are not consistent with the measurements. If instead the total envisionment has been explicitly generated, then p-interps can be computed by table-lookup (the implications of this fact are discussed below). any system of reasonable However p-interps are computed, complexity will give rise to many of them. Therefore it is important to prune out inconsistent interpretations as quickly as possible. Any domain-specific information applicable to the onelook case, as described in the 1983 paper, could again be useful in However, when we have close data we can impose this context. “grammatical” constraints, ruling out those p-interps which cannot possibly be part of any consistent pattern of behavior. To impose these constraints we need to refer to the possible transitions between qualitative states contained in the total envisionment. We assume that associated with each qualitative state St is a set of ufters which are the set of states which can be reached from St via a single transition. The following assumption is needed to apply this information: Simplest Action Assumption: The qualitative states St1 and St2 which describe the behavior of two global segments Sl and S2 which are temporally adjacent in a close sequence (i.e., Meet(Int(Sl), Int(S,>)) are temporal successors in the total envisionment, i.e. St2 E Af ters (St11 . Figure 2 - Segments Here are the segments and global segments for the QP problem and global segments generated by the imple- mentation from the data in Figure 1. ATMI: Finding initial segments... lpropertieshavebeenmeasured. For Ds of (T INSIDE-BEAKER) : Starttime =O.O, Endtlme=ll.7. 117 samples, taken O.ltlme units apart. Divided Into 8 segments. DS 0f (TINSIDE-BEAKER) is 1 fromO.Oto 1.3. Ds of (T INSIDE-BEAKER) Is0 froml.4to2.1. Ds of (T INSIDE-BEAKER) Is lfrom2.2to4.l.. Ds of (T INSIDE-BEAKER) Ds of (T INSIDE-BEAKER) Ds of (T INSIDE-BEAKER) Given global segments Sl, S 2 s.L. Meets (Int (S1) , Int (S2)), ForeachStl Ep-interps(S1) andSt2 Ep-lnterps(S2) if 13 St0 E p-lnterps (S2) s.t. St0 E Afters (Stl), then prune St1 from p-interps (Sl) if 13 St0 E p-lnterps (S1) s.t. St2 E Afters (StO), then prune St2 from p-lnterps (S2) Is 0 from4.2t05.8. Is 1 from 5.9 to 8.5. 1s 0 from8.6to ATMI: Findlngglobalsegments... There are 6globalsegments. constraint” applied to In essence, this is a “compatibility action. For it to be true st, our sampling time, must be small enough so that all important changes are reflected in the data. The temporal adjacency between Sl and S2 implies that any state which serves as an explanation for S1 must have a transition that leads to some state which explains S2. Similarly, any state which explains S2 must result from some state which explains Sl. These facts can be used locally, via Waltz filtering, to prune p-interps as follows: 11.7. These rules must be applied to each global segment in turn until no more p-interps are pruned. Suppose for some global segment S, p-lnterps(S) 8. Interpreting segment5 If the segmentation based on domain-specific constraints is correct, a global segment should typically be explained as the manifestation of a single qualitative state. A qualitative state consists of a finite number of components,’ some fraction of which are fixed by the measurement sequences. If every component of the qualitative state is measured, then there can be only a single so we interpretation for each segment. Usually there are several, must generate the set of qualitative states that could give rise to the ’ This graph was generated by a numerical simulation program; it does represent actual measurements. The numbers were hand-translated to DS values. Suppose the p-interps temporally adjacent, that for a segment is, for some include states that are St1 and St2 in p- lnterps(S), St2 E Afters(St1). SinceStl*and St2 are in the with same set p-lnterps(S), they must be indistinguishable respect to the measurements provided. This is exactly how the hidden transition problem arises, and in fact is the only way it ca.n arise - otherwise, the set of p-interps would be incomplete. Thus to find hidden transitions it suffices to extend the collection of p - not parts. Qualitative = C). Then either(a)the dataisinconsistent or (b) the simplest action assumption is violated, either because there is more than one qualitative state required to explain a particular global segment (the hidden transition problem described previously) or the sample time st is not short enough. Reasoning 6 This would not be true if our system model contained We assume such models can always be avoided. and Diagnosis: AUTOMATED an infinite REASONING number of / 11 j interps to include all sequences of states from the original collectron which are temporally adjacent. Two points should be made about this pruning algorithm. First, in cases where the measurements are not very constraining the number of such sequences could grow very large. In the limiting case of no relevant measurements, the set of p-interps would correspond to the set of all possible paths and connected subparts of paths through the envisionment ! We suspect such cases could arise when reasoning about a very large system with several looselyconnected components while only watching a little piece of it, and hence suggest instead a scheme combining pruning with backup for those circumstances. Second, the algorithm can easily tolerate extra states sets of p-interps, but will be sensitive to missing states. properties follow directly from the fact that states are only when certain other states cannot be found. This means that the initial data will show up very rapidly, without extensive computations. 8.1. QP example, part in the These pruned gaps in global 2 Consider again the physical situation involving liquids discussed previously. The only processes we will be concerned with are heat flow to the liquids (if any), heat flow to the beaker, and boiling. We ignore any gasses that are produced, the possibility of the beaker melting or exploding, and any heat flow to the atmosphere. While we do not assume knowledge of the actual boiling points of water or alcohol, we assume that the boiling temperature of alcohol is lower than the boiling temperature of Given these assumptions, Figure 3 shows the total water. envisionment for the possible configurations of objects. Since our only available measurement is temperature there is a great deal of ambiguity, as indicated by the p-interp lookup table in Figure 4. Allowing the program to apply the pruning rules, we find that after four Figure 5). iterations a unique solution Even with very little initial data, we can conclude (se&\ from this result that originally there was a mixture of water and alcohol in the beaker (S9). The mixture heated up until the alcohol started to boil (SlO). Aft er the alcohol boiled away the water heated up (SB) and began to boil (S7). After the water boiled away, the beaker heated up (SZ) until thermal equilibrium was attained (Sl). 4. Constructing global interpretations Suppose the initial data is close. Then if it is correct we have a complete collection of initial hypotheses, and if the simplest action assumption is not violated and that the data is consistent, as indicated by a non-null set of p-interps for each total segment, then we have an exhaustive set of possibilities for each segment. the hypotheses for each segment are temporally Furthermore, adjacent, i.e. they are plausible candidates to follow one another in Given these assumptions, of behavior. a valid description constructing all the consistent global interpretations is simple: Figure 4 - Table of Ds values and corresponding P-interps 31 1. Select an element of the p-interps for the earliest segment. 2. Walk down the after links between p-interps, Each such path is a consistent Figure 8 - Total Envisionment for liquids problem The states in the picture below are divided into rows based on the contents of the beaker. A thick arrow from the burner through the beaker indicates heat flow, and small bubbles indicate boiling. A thin arrow indicates a possible transition from the state at the tail to the state at the head. has emerged depth first. global interpretation. However, close data can be hard to get. Many physically important transitions occur in an instant. For example, collisions can happen very fast; we may see a ball head into a wall and head out again without actually seeing the collision. In general we must live with sparse data. Consequently, we next describe how gaps in the data can be filled. 4.1. Filling gaps in sparse data The procedure above can be modified to work on sparse data, although more ambiguity, and hence more interpretations, are likely. 1. Use the procedure Alcohol Only above on all close subsequences. 2. For each gap between close subsequences, let S1 be the segment which ends at the start of the gap, and let S2 be the segment which starts at the end of the gap. 2.1 Select an element of p-lnterps Water OdY AkohoV Water Miiture 116 / SCIENCE (Sl) . 2.2 Walk down the after links through states in the envisionment until an element of p-lnterps (S2) is reached. Each such path is part of a global interpretation. There are two cases where gaps can arise. Gaps can be small because instantaneous states have been missed, or large because the sequences are sparse. An example of a large gap is when we see a Figure 6 - Applying Here is the program’s Waltz filtering to P-interps operation on the p-interps shown in Figure4. data will ‘~~l’llllities. ATMI: Flndlngp-interps... Global Segment lhas 4p-interps. Global Segment2 has 7 p-lnterps. Global Segment3 has 4p-lnterps. Global Segment4 has 7 p-lnterps. GlobalSegment5has 4p-lnterps. Global Segment6 has 7 p-lnterps. ATMI: Filterlngp-interps... After4rounds, 27p-lnterps excluded. ATMI: Finding global Interpretations... There Is aunlque global lnterpretatlon: (59 SlO S6 s7 the be system that uses continuous An interesting opportunilj *r&es when the particular physical syslem is known in advance, as is typically the case when dealing with engineered :;y::~erns. Current qualitative reasoning programs are often slow', clspecially when generating the entire space of possible behaviors while taking different fault modes into account. However, given a description of the structure of the system and an adequate qualitative physics, the total envisionment (or several total envisionments, representing typical fault modes) can be precomputed and preprocessed to provide a set of state tables, indexed by possible values of measurements or sets of measurements. These lookup tables, while possibly quite large, could make the interpretation process very fast. It does not Seem unlikely that, given fast signal-processing hardware to perform the initial signal to symbol translation, special-purpose measurement interpretation programs which operate in real time on affordable computers might be written. As qualitative physics progresses, leading to standardized domain models and fault models, diagnostic expert systems could be automatically compiled from the structural description of a system. s2 Sl) The qualitative states are: S9: water and alcohol, heatflowtobeaker, temperature Increasing. SlO: water and alcohol, heatflowtobeaker, alcoholbolllng, temperature constant. S6: water, heatflowtobeaker. temperature Increasing. S7: water, heatflowtobeaker, water bolllng, temperature constant. 52: empty, heatflowtobeaker, temperature Increasing. Sl: empty, thermal equlllbrlum, temperature constant. 5.1. Acknowledgements Discussions with Johan de Kleer, Dan Weld, Brian Falkenhainer, Dave Waltz, and Dave Chapman led to sienifican t improvements in both form and content. John Hogge provided glassof water sittingon a table one day and come back the next invaluableprogramming assjstance. This researchjs supported by the Officeof Naval Elesearch, contractNo. N00014-85-K-Q22~ day to find the glass turned over and a puddle of water on the floor. The above procedure is quite useful for small gaps,sincetherewill 6. However, explicitly generating the set of global interpretations In the worse for large gaps can lead to combinatorial explosions. case the number of interpretations is the set of all paths through the envisionment. If the envisionment has cycles, corresponding to oscillations in behavior, the number of paths can be infinite. An alternate strategy is to use the envisionment as a “scratchpad”, using the measurements to directly rule certain states in or out, and using algorithms akin to garbage collection to determme the indirect consequences of these constraints. Algorithms to do this have been implemented (see [Forbus, 1980]), and have been successfully used with the measurement interpretation program (see (Forbus, 19861). 6. Bibliography Allen,J. "Maintainingknowledge about be few states(usually one) between Sl and S2. Discussion has presented a theory of interpreting This paper measurements taken across time, illustrating its utility by extended in qualitative example. The theory solves a central problem physics, and has many potential applications. For example, this theory is useful for diagnosis problems because it provides a general ability to test fault hypotheses to see if they actually explain the observed behavior. Currently we are coding routines to automatically perform the signal/symbol transformation for several domains and generalizing the implementation to handle sparse data. Importantly, the theory relies on very few assumptions. The small number of assumptions makes the theory applicable to many different representations and domains. The assumptions of a total envisionment and of algorithms which can provide some qualitative description of numerical parameters are very mild restrictions which most systems of qualitative physics can easily satisfy. There is no apparent reason why this theory cannot be used with devicecentered models, such as [de Kleer & Brown, 19841, [Williams, 19841, or discrete-process models, such as [Simmons, 19831, [Weld, 19841, or even equation-centered models, ,11ch as [Kuipers, 19841. In fact, we expect that the constraints OII \)ilrtitioning numerical Qualitative temporal intervals”, TR-86, Department of Computer Science, January 1981 Bobrow, D., Ed. Qualitative Reasoning about Physical Systems., MIT Press, 1985. knowledge in classical and quantitative de Kleer, J. “Qualitative mechanics”, MIT Artificial Intelligence lab TR352, December, 1975 de Kleer, J. and Brown, J. “A qualitative physics based on confluences”, Artificial Inntelligence, 24, 1984 Forbus, K. “Spatial and qualitative aspects of reasoning about motion” Proceedings of the first annual conference of the American Association for Artificial Intelligence, August 1980. Forbus, K. “Qualitative reasoning about physical processes” Proceedings of the seventh International Joint Conference on Artificial Intelligence, August, 1981 Forbus, K. “A study of qualitative and geometric knowledge in reasoning about motion” MIT ArtiEcial Intelligence labTR-615,February, 1981 Forbus, K. “Measurement interpretation in qualitative process theory” in Proceedings of IJCAI-8, Karlsruhe, Germany, 1983 Forbus, K. “Qualitative process theory” Artificral Intelligence, 24, 1984, pp 85-l68. Forbus,K. “Interpreting observations of physical systems”, Report No. UIUCDCS-R-86-1248, Department of Computer Science, University of Illinois, Urbana, Illinois. Kuipers, B. “Commonsense reasoning about causality: Deriving behavior from structure”, Artificial Intelligence, 24, 1984, pp 169-204 Reddy, D.R., L.D. Erman, R D Fennel, and R B. Newly “The HEARSAY process” speech understandlng system, an example of the recognition IJCAI-3, 1973, pp 185-193 “Representing and reasoning about change in geologic Simmons, R interpretation” MIT Artificial Intelligence Lab TR-749, December, 1983 Williams, B. “Qualitative analysis of MOS circuits”, Artlficrd Intelltgence, 24, 1984 Weld, D. “Switching between discrete and continuous process models tc predict genetic activity” MlT Artificial Intelligence Lab TR-793, October 1984 ’ Although efficicrlcy can be improved. Our new implementation of QP theory (QPE)18currently running 95 times faster than our old implementation (GIZMO). Reasoning and Diagnosis: AUTOMATED REASONING / 11‘I